-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
39ba661
commit e8f538b
Showing
14 changed files
with
138 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ pwd= | |
mid= | ||
buvid= | ||
csrf= | ||
appKey= | ||
access_key= | ||
cookieStr= | ||
device_id= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
meta { | ||
name: app.bilibili.com | ||
} | ||
|
||
script:pre-request { | ||
const CryptoJS = require('crypto-js'); | ||
|
||
console.log("start"); | ||
|
||
const md5 = (str) => CryptoJS.MD5(str).toString(CryptoJS.enc.Hex); | ||
|
||
const replacePlaceholders = (body) => { | ||
for (const key in body) { | ||
if (typeof body[key] === 'string') { | ||
// Check if value contains {{}} placeholders | ||
const matches = body[key].match(/{{(.*?)}}/g); | ||
if (matches) { | ||
matches.forEach(match => { | ||
const placeholder = match.slice(2, -2); // Remove the {{ and }} | ||
const value = bru.getEnvVar(placeholder); | ||
body[key] = body[key].replace(match, value); | ||
}); | ||
} | ||
} | ||
} | ||
}; | ||
|
||
function appSign(params, appkey, appsec) { | ||
params.appkey = appkey; | ||
delete body.sign; | ||
delete body.task_sign; | ||
const sortedKeys = Object.keys(params).sort(); | ||
const sortedParams = sortedKeys.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`).join('&'); | ||
console.log(sortedParams); | ||
return md5(sortedParams + appsec); | ||
} | ||
|
||
const body = req.getBody(); | ||
|
||
if (body.hasOwnProperty('sign')) { | ||
replacePlaceholders(body); | ||
const sign = appSign(body, bru.getEnvVar("appKey"), bru.getEnvVar("appSec")); | ||
console.log("calculate sign:" + sign); | ||
|
||
body.sign = sign; | ||
body.task_sign = sign; | ||
} | ||
|
||
req.setBody(body); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,19 +18,17 @@ headers { | |
session_id: e04d2e05 | ||
env: prod | ||
app-key: android64 | ||
user-agent: Mozilla/5.0 BiliDroid/7.72.0 ([email protected]) os/android model/Nexus mobi_app/android build/7720200 channel/yingyongbao innerVer/7720210 osVer/10 network/2 | ||
user-agent: {{user-agent}} | ||
x-bili-trace-id: a301946d9621645a707b40973f67755c:707b40973f67755c:0:0 | ||
x-bili-aurora-eid: UlAAQFkMBVkH | ||
x-bili-mid: {{mid}} | ||
x-bili-aurora-zone: | ||
x-bili-gaia-vtoken: | ||
x-bili-ticket: eyJhbGciOiJIUzI1NiIsImtpZCI6InMwMyIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MzU3NzI2NDcsImlhdCI6MTczNTc0MzU0NywiYnV2aWQiOiJYVzcyNEQxNzI0Njg3MTlDQzI1NjA1REIyNDI0NzhEMkUxMjE5In0.eafhpooLoe2q6cA45_Xrgq1VO-y490pxP5gwJ4qm_ik | ||
bili-http-engine: cronet | ||
content-type: application/x-www-form-urlencoded; charset=utf-8 | ||
} | ||
|
||
body:form-urlencoded { | ||
access_key: {{access_key}} | ||
appkey: {{appKey}} | ||
build: 7720200 | ||
c_locale: zh_CN | ||
|
@@ -41,9 +39,40 @@ body:form-urlencoded { | |
s_locale: zh_CN | ||
statistics: {"appId":1,"platform":3,"version":"7.72.0","abtest":""} | ||
task_id: 4320003 | ||
token: 6c54c1256a | ||
access_key: {{access_key}} | ||
task_sign: 78cf66f2699393751c41c2fda27c2ccf | ||
timestamp: 1735744760834 | ||
token: 4c2cba3427 | ||
ts: 1735744760 | ||
sign: 2292d647d9b3f6dbd2f99b5a90cbddaf | ||
} | ||
|
||
script:pre-request { | ||
const CryptoJS = require('crypto-js'); | ||
|
||
console.log("start"); | ||
|
||
const md5 = (str) => CryptoJS.MD5(str).toString(CryptoJS.enc.Hex); | ||
|
||
function appSign(params, appkey, appsec) { | ||
console.log("appkey:"+appkey); | ||
console.log("appsec:"+appsec); | ||
params.appkey = appkey; | ||
const sortedKeys = Object.keys(params).sort(); | ||
const sortedParams = sortedKeys.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`).join('&'); | ||
console.log(sortedParams); | ||
return md5(sortedParams + appsec); | ||
} | ||
|
||
const body = req.getBody(); | ||
|
||
if (body.hasOwnProperty('sign')) { | ||
body.access_key=bru.getEnvVar("access_key"); | ||
const sign = appSign(body, bru.getEnvVar("appKey"), bru.getEnvVar("appSec")); | ||
console.log("calculate sign:" + sign); | ||
|
||
body.sign = sign; | ||
} | ||
|
||
req.setBody(body); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,7 +65,9 @@ body:form-urlencoded { | |
|
||
docs { | ||
终端:APP | ||
|
||
作用:领取大会员赚大积分任务-购买指定装扮商品 | ||
|
||
入口: | ||
- 我的->会员中心->赚大积分->查看8项任务->领取任务 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,7 +65,9 @@ body:form-urlencoded { | |
|
||
docs { | ||
终端:APP | ||
|
||
作用:领取大会员赚大积分任务-观看剧集内容 | ||
|
||
入口: | ||
- 我的->会员中心->赚大积分->查看8项任务->领取任务 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,7 +65,9 @@ body:form-urlencoded { | |
|
||
docs { | ||
终端:APP | ||
|
||
作用:领取大会员赚大积分任务-购买单点付费影片 | ||
|
||
入口: | ||
- 我的->会员中心->赚大积分->查看8项任务->领取任务 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,7 +65,9 @@ body:form-urlencoded { | |
|
||
docs { | ||
终端:APP | ||
|
||
作用:领取大会员赚大积分任务-购买指定会员购商品 | ||
|
||
入口: | ||
- 我的->会员中心->赚大积分->查看8项任务->领取任务 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters