buvid fix
This commit is contained in:
+2
-1
@@ -1,4 +1,5 @@
|
||||
/.nyc_output
|
||||
/coverage
|
||||
/node_modules
|
||||
/build
|
||||
/build
|
||||
/.VSCodeCounter
|
||||
|
||||
Binary file not shown.
+10
-8
@@ -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
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"package": "com.searchstars.hyperbilibili",
|
||||
"name": "澎湃哔哩",
|
||||
"versionName": "1.0.4",
|
||||
"versionName": "1.0.4.1",
|
||||
"versionCode": 1,
|
||||
"minPlatformVersion": 1000,
|
||||
"minAPILevel": 2,
|
||||
|
||||
Reference in New Issue
Block a user