yz-yuki-plugin 2.0.5-6 → 2.0.5-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -21,9 +21,8 @@ class BiliApi {
|
|
|
21
21
|
/**header */
|
|
22
22
|
static BILIBILI_HEADERS = {
|
|
23
23
|
'Accept': '*/*',
|
|
24
|
-
'Accept-Language': 'zh-CN,
|
|
25
|
-
'Accept-Encoding': 'gzip, deflate, br',
|
|
26
|
-
'Content-type': 'application/json;charset=UTF-8',
|
|
24
|
+
'Accept-Language': 'zh-CN,en-US;q=0.5',
|
|
25
|
+
'Accept-Encoding': 'gzip, deflate, br, zstd',
|
|
27
26
|
'Cookie': '',
|
|
28
27
|
'pragma': 'no-cache',
|
|
29
28
|
'Cache-control': 'max-age=0',
|
|
@@ -35,15 +34,15 @@ class BiliApi {
|
|
|
35
34
|
'Sec-Fetch-Mode': 'cors',
|
|
36
35
|
'Sec-Fetch-Site': 'same-site',
|
|
37
36
|
'Sec-Fetch-User': '?0',
|
|
37
|
+
'Priority': 'u=4',
|
|
38
38
|
'TE': 'trailers',
|
|
39
|
-
'
|
|
40
|
-
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0'
|
|
39
|
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0'
|
|
41
40
|
};
|
|
42
41
|
/**Login header */
|
|
43
42
|
static BIlIBILI_LOGIN_HEADERS = {
|
|
44
43
|
'Accept': '*/*',
|
|
45
|
-
'Accept-Language': 'zh-CN,
|
|
46
|
-
'Accept-Encoding': 'gzip, deflate, br',
|
|
44
|
+
'Accept-Language': 'zh-CN,en-US;q=0.5',
|
|
45
|
+
'Accept-Encoding': 'gzip, deflate, br, zstd',
|
|
47
46
|
'DNT': '1',
|
|
48
47
|
'Sec-GPC': '1',
|
|
49
48
|
'Upgrade-Insecure-Requests': '1',
|
|
@@ -56,8 +55,8 @@ class BiliApi {
|
|
|
56
55
|
/**FullArticle header */
|
|
57
56
|
static BILIBILI_ARTICLE_HEADERS = {
|
|
58
57
|
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8',
|
|
59
|
-
'Accept-Language': 'zh-CN,
|
|
60
|
-
'Accept-Encoding': 'gzip, deflate, br',
|
|
58
|
+
'Accept-Language': 'zh-CN,en-US;q=0.5',
|
|
59
|
+
'Accept-Encoding': 'gzip, deflate, br, zstd',
|
|
61
60
|
'Content-type': 'text/html; charset=utf-8',
|
|
62
61
|
'Cookie': '',
|
|
63
62
|
'pragma': 'no-cache',
|
|
@@ -71,7 +70,7 @@ class BiliApi {
|
|
|
71
70
|
'Sec-Fetch-User': '?1',
|
|
72
71
|
'TE': 'trailers',
|
|
73
72
|
'Upgrade-Insecure-Requests': '1',
|
|
74
|
-
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:
|
|
73
|
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0'
|
|
75
74
|
};
|
|
76
75
|
}
|
|
77
76
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**获取dm参数 */
|
|
2
|
+
async function getDmImg() {
|
|
3
|
+
const dm_img_list = [];
|
|
4
|
+
//Buffer.from("WebGL 1", 'utf-8').toString("base64") //webgl version的值 WebGL 1 的base64 编码
|
|
5
|
+
const dm_img_str = 'V2ViR0wgMS';
|
|
6
|
+
//webgl unmasked renderer的值拼接webgl unmasked vendor的值的base64编码
|
|
7
|
+
const dm_cover_img_str = 'QU5HTEUgKEludGVsLCBJbnRlbChSKSBIRCBHcmFwaGljcyBEaXJlY3QzRDExIHZzXzVfMCBwc181XzApLCBvciBzaW1pbGFyR29vZ2xlIEluYy4gKEludGVsKQ';
|
|
8
|
+
return {
|
|
9
|
+
dm_img_list: dm_img_list,
|
|
10
|
+
dm_img_str: dm_img_str,
|
|
11
|
+
dm_cover_img_str: dm_cover_img_str
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { getDmImg };
|
|
@@ -3,6 +3,7 @@ import lodash from 'lodash';
|
|
|
3
3
|
import { BiliApi } from './bilibili.api.js';
|
|
4
4
|
import { readSyncCookie, cookieWithBiliTicket, readSavedCookieItems, readSavedCookieOtherItems } from './bilibili.models.js';
|
|
5
5
|
import { getWbiSign } from './bilibili.wbi.js';
|
|
6
|
+
import { getDmImg } from './bilibili.dm.img.js';
|
|
6
7
|
|
|
7
8
|
class BiliGetWebData {
|
|
8
9
|
constructor(e) { }
|
|
@@ -11,6 +12,7 @@ class BiliGetWebData {
|
|
|
11
12
|
const url = BiliApi.BILIBIL_API.biliDynamicInfoList;
|
|
12
13
|
let { cookie } = await readSyncCookie();
|
|
13
14
|
cookie = await cookieWithBiliTicket(cookie);
|
|
15
|
+
const dmImg = await getDmImg();
|
|
14
16
|
const data = {
|
|
15
17
|
'offset': '',
|
|
16
18
|
'host_mid': uid,
|
|
@@ -18,7 +20,7 @@ class BiliGetWebData {
|
|
|
18
20
|
'platform': 'web',
|
|
19
21
|
'features': 'itemOpusStyle,listOnlyfans,opusBigCover,onlyfansVote',
|
|
20
22
|
'web_location': '333.999',
|
|
21
|
-
|
|
23
|
+
...dmImg,
|
|
22
24
|
'x-bili-device-req-json': { platform: 'web', device: 'pc' },
|
|
23
25
|
'x-bili-web-req-json': { spm_id: '333.999' }
|
|
24
26
|
};
|
|
@@ -35,8 +37,8 @@ class BiliGetWebData {
|
|
|
35
37
|
headers: lodash.merge(BiliApi.BILIBILI_HEADERS, {
|
|
36
38
|
Cookie: `${cookie}`,
|
|
37
39
|
Host: `api.bilibili.com`,
|
|
38
|
-
Origin: 'https://
|
|
39
|
-
Referer: `https://
|
|
40
|
+
Origin: 'https://space.bilibili.com',
|
|
41
|
+
Referer: `https://space.bilibili.com/${uid}/dynamic`
|
|
40
42
|
})
|
|
41
43
|
});
|
|
42
44
|
return res;
|
|
@@ -83,12 +83,12 @@ class BiliTask {
|
|
|
83
83
|
}
|
|
84
84
|
else if (resp.code !== 0) {
|
|
85
85
|
logger.error(`获取 ${subInfoOfup.uid} 动态失败,resCode:${resp.code}`);
|
|
86
|
-
|
|
86
|
+
return;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
else {
|
|
90
90
|
logger.error(`获取 ${subInfoOfup.uid} 动态失败,无响应数据,请待下次任务自动重试`);
|
|
91
|
-
|
|
91
|
+
return;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
const chatIds = Array.from(new Set([...Object((chatTypeMap.get(subInfoOfup.uid) && chatTypeMap.get(subInfoOfup.uid).chatIds) || []), chatId]));
|