yz-yuki-plugin 2.0.5-5 → 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.
|
@@ -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');
|
|
@@ -89,12 +83,12 @@ class BiliTask {
|
|
|
89
83
|
}
|
|
90
84
|
else if (resp.code !== 0) {
|
|
91
85
|
logger.error(`获取 ${subInfoOfup.uid} 动态失败,resCode:${resp.code}`);
|
|
92
|
-
|
|
86
|
+
continue;
|
|
93
87
|
}
|
|
94
88
|
}
|
|
95
89
|
else {
|
|
96
|
-
logger.error(`获取 ${subInfoOfup.uid}
|
|
97
|
-
|
|
90
|
+
logger.error(`获取 ${subInfoOfup.uid} 动态失败,无响应数据,请待下次任务自动重试`);
|
|
91
|
+
continue;
|
|
98
92
|
}
|
|
99
93
|
}
|
|
100
94
|
const chatIds = Array.from(new Set([...Object((chatTypeMap.get(subInfoOfup.uid) && chatTypeMap.get(subInfoOfup.uid).chatIds) || []), chatId]));
|