yz-yuki-plugin 2.0.5-4 → 2.0.5-6
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.
package/CHANGELOG.md
CHANGED
|
@@ -17,13 +17,10 @@ class BiliTask {
|
|
|
17
17
|
this.privateKey = 'Yz:yuki:bili:upPush:private:';
|
|
18
18
|
}
|
|
19
19
|
async hendleEventDynamicData(uid, count = 0) {
|
|
20
|
+
let { cookie } = await readSyncCookie();
|
|
20
21
|
const resp = await new BiliGetWebData().getBiliDynamicListDataByUid(uid);
|
|
21
22
|
const resjson = await resp.data;
|
|
22
|
-
|
|
23
|
-
if (resjson.code === 0) {
|
|
24
|
-
return resjson;
|
|
25
|
-
}
|
|
26
|
-
else if (resjson.code === -352) {
|
|
23
|
+
if (!resjson || resjson.code !== 0 || resjson.code === -352) {
|
|
27
24
|
await postGateway(cookie);
|
|
28
25
|
if (count < 3) {
|
|
29
26
|
await this.randomDelay(2000, 8000); // 随机延时2-8秒
|
|
@@ -32,12 +29,9 @@ class BiliTask {
|
|
|
32
29
|
}
|
|
33
30
|
else {
|
|
34
31
|
count = 0;
|
|
35
|
-
return resjson;
|
|
36
32
|
}
|
|
37
33
|
}
|
|
38
|
-
|
|
39
|
-
return resjson;
|
|
40
|
-
}
|
|
34
|
+
return resjson;
|
|
41
35
|
}
|
|
42
36
|
async runTask() {
|
|
43
37
|
let biliConfigData = await Config.getUserConfig('bilibili', 'config');
|
|
@@ -72,28 +66,30 @@ class BiliTask {
|
|
|
72
66
|
// 检查是否已经请求过该 uid
|
|
73
67
|
if (requestedDataOfUids.has(subInfoOfup.uid)) {
|
|
74
68
|
resp = requestedDataOfUids.get(subInfoOfup.uid); // 从已请求的映射中获取响应数据
|
|
69
|
+
const dynamicData = resp.data?.items || [];
|
|
70
|
+
dynamicList[subInfoOfup.uid] = dynamicData;
|
|
75
71
|
}
|
|
76
72
|
else {
|
|
77
73
|
resp = await this.hendleEventDynamicData(subInfoOfup.uid);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
74
|
+
if (resp) {
|
|
75
|
+
if (resp.code === 0) {
|
|
76
|
+
requestedDataOfUids.set(subInfoOfup.uid, resp); // 将响应数据存储到映射中
|
|
77
|
+
const dynamicData = resp.data?.items || [];
|
|
78
|
+
dynamicList[subInfoOfup.uid] = dynamicData;
|
|
79
|
+
}
|
|
80
|
+
else if (resp.code === -352) {
|
|
81
|
+
logger.error(`获取 ${subInfoOfup.uid} 动态失败,resCode:-352`);
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
else if (resp.code !== 0) {
|
|
85
|
+
logger.error(`获取 ${subInfoOfup.uid} 动态失败,resCode:${resp.code}`);
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
84
88
|
}
|
|
85
|
-
else
|
|
86
|
-
logger.error(`获取 ${subInfoOfup.uid}
|
|
89
|
+
else {
|
|
90
|
+
logger.error(`获取 ${subInfoOfup.uid} 动态失败,无响应数据,请待下次任务自动重试`);
|
|
87
91
|
continue;
|
|
88
92
|
}
|
|
89
|
-
else if (resp.code !== 0) {
|
|
90
|
-
logger.error(`获取 ${subInfoOfup.uid} 动态失败,resCode:${resp.code}`);
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
logger.error(`获取 ${subInfoOfup.uid} 动态失败,resp 为空`);
|
|
96
|
-
return;
|
|
97
93
|
}
|
|
98
94
|
const chatIds = Array.from(new Set([...Object((chatTypeMap.get(subInfoOfup.uid) && chatTypeMap.get(subInfoOfup.uid).chatIds) || []), chatId]));
|
|
99
95
|
const bot_id = subInfoOfup.bot_id || [];
|
|
@@ -46,14 +46,16 @@ class WeiboTask {
|
|
|
46
46
|
// 检查是否已经请求过该 uid
|
|
47
47
|
if (requestedDataOfUids.has(subInfoOfup.uid)) {
|
|
48
48
|
resp = requestedDataOfUids.get(subInfoOfup.uid); // 从已请求的映射中获取响应数据
|
|
49
|
+
const dynamicData = resp || [];
|
|
50
|
+
dynamicList[subInfoOfup.uid] = dynamicData;
|
|
49
51
|
}
|
|
50
52
|
else {
|
|
51
53
|
resp = await await new WeiboGetWebData().getBloggerDynamicList(subInfoOfup.uid); // 获取指定 uid 的动态列表
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
if (resp) {
|
|
55
|
+
requestedDataOfUids.set(subInfoOfup.uid, resp); // 将响应数据存储到映射中
|
|
56
|
+
const dynamicData = resp || [];
|
|
57
|
+
dynamicList[subInfoOfup.uid] = dynamicData;
|
|
58
|
+
}
|
|
57
59
|
}
|
|
58
60
|
const chatIds = Array.from(new Set([...Object((chatTypeMap.get(subInfoOfup.uid) && chatTypeMap.get(subInfoOfup.uid).chatIds) || []), chatId]));
|
|
59
61
|
const bot_id = subInfoOfup.bot_id || [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yz-yuki-plugin",
|
|
3
|
-
"version": "2.0.5-
|
|
3
|
+
"version": "2.0.5-6",
|
|
4
4
|
"description": "优纪插件,yunzaijs 关于 微博推送、B站推送 等功能的拓展插件",
|
|
5
5
|
"author": "snowtafir",
|
|
6
6
|
"type": "module",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"md5": "^2.3.0",
|
|
37
37
|
"moment": "^2.30.1",
|
|
38
38
|
"node-fetch": "^3.3.2",
|
|
39
|
-
"puppeteer": "^23.
|
|
39
|
+
"puppeteer": "^23.6.0",
|
|
40
40
|
"qrcode": "^1.5.4",
|
|
41
41
|
"react": "^18.3.1",
|
|
42
42
|
"react-dom": "^18.3.1",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"node-fetch": "^3.3.2",
|
|
69
69
|
"postcss": "^8.4.47",
|
|
70
70
|
"prettier": "^3.3.3",
|
|
71
|
-
"puppeteer": "^23.
|
|
71
|
+
"puppeteer": "^23.6.0",
|
|
72
72
|
"qrcode": "^1.5.4",
|
|
73
73
|
"react": "^18.3.1",
|
|
74
74
|
"react-dom": "^18.3.1",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"ts-node": "^10.9.2",
|
|
78
78
|
"tsx": "^4.19.0",
|
|
79
79
|
"typescript": "^5.5.4",
|
|
80
|
-
"yunzaijs": "^1.0.0-rc.
|
|
80
|
+
"yunzaijs": "^1.0.0-rc.5"
|
|
81
81
|
},
|
|
82
82
|
"files": [
|
|
83
83
|
"public",
|