buvid fix

This commit is contained in:
Searchstars
2024-03-12 21:25:23 +08:00
parent 91f1671937
commit afb57df620
4 changed files with 13 additions and 10 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
/.nyc_output
/coverage
/node_modules
/build
/build
/.VSCodeCounter
Binary file not shown.
+10 -8
View File
@@ -80,19 +80,17 @@ export async function InitBiliBUVID3() {
resolve();
} else {
try {
var req_homepage_ret = await SendBiliGETReturnAll("https://bilibili.com");
var headers = ParseSetCookie(req_homepage_ret.headers["Set-Cookie"]);
for (var i = 0; i < headers.length; i++) {
console.log(headers[i]);
if (headers[i]["buvid3"] !== void 0 && headers[i]["buvid3"] !== undefined && headers[i]["buvid3"] !== "") {
buvid3 = headers[i]["buvid3"];
}
console.log("buvid3: Send GET Request To https://api.bilibili.com/x/frontend/finger/spi")
var ret_buvids = await SendBiliGET("https://api.bilibili.com/x/frontend/finger/spi");
console.log("buvid3: reading")
if (ret_buvids !== void 0 && ret_buvids !== undefined && ret_buvids !== "") {
buvid3 = ret_buvids.data.b_3
}
storage.set({
key: "BUVID3",
value: buvid3.toString(),
success: (data) => {
console.log("Inited buvid3");
console.log("Inited buvid3=" + buvid3);
resolve(); // 成功回调后解决Promise
},
fail: () => reject(), // 如果set失败,拒绝Promise
@@ -179,6 +177,10 @@ export async function InitBiliRequest(JumpToHomePage){
}
}
export async function GetBUVID3(){
return buvid3
}
export async function SendBiliGET(url, type){
var headers = BILI_BASE_HEADERS;
headers["Cookie"] = "DedeUserID=" + DedeUserID + "; DedeUserID__ckMd5=" + DedeUserID__ckMd5 + "; SESSDATA=" + SESSDATA + "; bili_jct=" + bili_jct + "; buvid3=" + buvid3;
+1 -1
View File
@@ -1,7 +1,7 @@
{
"package": "com.searchstars.hyperbilibili",
"name": "澎湃哔哩",
"versionName": "1.0.4",
"versionName": "1.0.4.1",
"versionCode": 1,
"minPlatformVersion": 1000,
"minAPILevel": 2,