koishi-plugin-bilibili-notify 3.3.13-alpha.2 → 3.3.13-alpha.3
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/lib/index.js +4 -12
- package/lib/index.mjs +4 -12
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1377,7 +1377,7 @@ var ComRegister = class {
|
|
|
1377
1377
|
this.logger.info(res.choices[0].message.content);
|
|
1378
1378
|
return res.choices[0].message.content;
|
|
1379
1379
|
}
|
|
1380
|
-
return customLiveSummary.replace("-dmc", `${
|
|
1380
|
+
return customLiveSummary.replace("-dmc", `${danmakuSenderCount}`).replace("-mdn", masterInfo.medalName).replace("-dca", `${danmakuCount}`).replace("-un1", top5DanmakuSender[0][0]).replace("-dc1", `${top5DanmakuSender[0][1]}`).replace("-un2", top5DanmakuSender[1][0]).replace("-dc2", `${top5DanmakuSender[1][1]}`).replace("-un3", top5DanmakuSender[2][0]).replace("-dc3", `${top5DanmakuSender[2][1]}`).replace("-un4", top5DanmakuSender[3][0]).replace("-dc4", `${top5DanmakuSender[3][1]}`).replace("-un5", top5DanmakuSender[4][0]).replace("-dc5", `${top5DanmakuSender[4][1]}`).replaceAll("\\n", "\n");
|
|
1381
1381
|
})();
|
|
1382
1382
|
await this.broadcastToTargets(sub.uid, [img, summary], PushType.WordCloudAndLiveSummary);
|
|
1383
1383
|
Object.keys(danmakuWeightRecord).forEach((key) => delete danmakuWeightRecord[key]);
|
|
@@ -3456,13 +3456,7 @@ var GenerateImg = class extends koishi.Service {
|
|
|
3456
3456
|
}
|
|
3457
3457
|
unixTimestampToString(timestamp) {
|
|
3458
3458
|
const date = /* @__PURE__ */ new Date(timestamp * 1e3);
|
|
3459
|
-
|
|
3460
|
-
const month = `0${date.getMonth() + 1}`.slice(-2);
|
|
3461
|
-
const day = `0${date.getDate()}`.slice(-2);
|
|
3462
|
-
const hours = `0${date.getHours()}`.slice(-2);
|
|
3463
|
-
const minutes = `0${date.getMinutes()}`.slice(-2);
|
|
3464
|
-
const seconds = `0${date.getSeconds()}`.slice(-2);
|
|
3465
|
-
return `${year}年${month}月${day}日 ${hours}:${minutes}:${seconds}`;
|
|
3459
|
+
return `${date.getFullYear()}年${`0${date.getMonth() + 1}`.slice(-2)}月${`0${date.getDate()}`.slice(-2)}日 ${`0${date.getHours()}`.slice(-2)}:${`0${date.getMinutes()}`.slice(-2)}:${`0${date.getSeconds()}`.slice(-2)}`;
|
|
3466
3460
|
}
|
|
3467
3461
|
};
|
|
3468
3462
|
(function(_GenerateImg) {
|
|
@@ -3646,8 +3640,7 @@ var BiliAPI = class extends koishi.Service {
|
|
|
3646
3640
|
const value = params[key].toString().replace(chr_filter, "");
|
|
3647
3641
|
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
3648
3642
|
}).join("&");
|
|
3649
|
-
|
|
3650
|
-
return `${query}&w_rid=${wbi_sign}`;
|
|
3643
|
+
return `${query}&w_rid=${(0, md5.default)(query + mixin_key)}`;
|
|
3651
3644
|
}
|
|
3652
3645
|
async getWbi(params) {
|
|
3653
3646
|
const web_keys = this.wbiSign || await this.getWbiKeys();
|
|
@@ -4197,8 +4190,7 @@ var BiliAPI = class extends koishi.Service {
|
|
|
4197
4190
|
const data = new TextEncoder().encode(`refresh_${timestamp}`);
|
|
4198
4191
|
return new Uint8Array(await node_crypto.default.subtle.encrypt({ name: "RSA-OAEP" }, publicKey, data)).reduce((str, c) => str + c.toString(16).padStart(2, "0"), "");
|
|
4199
4192
|
}
|
|
4200
|
-
const
|
|
4201
|
-
const correspondPath = await getCorrespondPath(ts);
|
|
4193
|
+
const correspondPath = await getCorrespondPath(luxon.DateTime.now().toMillis());
|
|
4202
4194
|
const { data: refreshCsrfHtml } = await this.client.get(`https://www.bilibili.com/correspond/1/${correspondPath}`);
|
|
4203
4195
|
const { document } = new jsdom.JSDOM(refreshCsrfHtml).window;
|
|
4204
4196
|
const targetElement = document.getElementById("1-name");
|
package/lib/index.mjs
CHANGED
|
@@ -1342,7 +1342,7 @@ var ComRegister = class {
|
|
|
1342
1342
|
this.logger.info(res.choices[0].message.content);
|
|
1343
1343
|
return res.choices[0].message.content;
|
|
1344
1344
|
}
|
|
1345
|
-
return customLiveSummary.replace("-dmc", `${
|
|
1345
|
+
return customLiveSummary.replace("-dmc", `${danmakuSenderCount}`).replace("-mdn", masterInfo.medalName).replace("-dca", `${danmakuCount}`).replace("-un1", top5DanmakuSender[0][0]).replace("-dc1", `${top5DanmakuSender[0][1]}`).replace("-un2", top5DanmakuSender[1][0]).replace("-dc2", `${top5DanmakuSender[1][1]}`).replace("-un3", top5DanmakuSender[2][0]).replace("-dc3", `${top5DanmakuSender[2][1]}`).replace("-un4", top5DanmakuSender[3][0]).replace("-dc4", `${top5DanmakuSender[3][1]}`).replace("-un5", top5DanmakuSender[4][0]).replace("-dc5", `${top5DanmakuSender[4][1]}`).replaceAll("\\n", "\n");
|
|
1346
1346
|
})();
|
|
1347
1347
|
await this.broadcastToTargets(sub.uid, [img, summary], PushType.WordCloudAndLiveSummary);
|
|
1348
1348
|
Object.keys(danmakuWeightRecord).forEach((key) => delete danmakuWeightRecord[key]);
|
|
@@ -3421,13 +3421,7 @@ var GenerateImg = class extends Service {
|
|
|
3421
3421
|
}
|
|
3422
3422
|
unixTimestampToString(timestamp) {
|
|
3423
3423
|
const date = /* @__PURE__ */ new Date(timestamp * 1e3);
|
|
3424
|
-
|
|
3425
|
-
const month = `0${date.getMonth() + 1}`.slice(-2);
|
|
3426
|
-
const day = `0${date.getDate()}`.slice(-2);
|
|
3427
|
-
const hours = `0${date.getHours()}`.slice(-2);
|
|
3428
|
-
const minutes = `0${date.getMinutes()}`.slice(-2);
|
|
3429
|
-
const seconds = `0${date.getSeconds()}`.slice(-2);
|
|
3430
|
-
return `${year}年${month}月${day}日 ${hours}:${minutes}:${seconds}`;
|
|
3424
|
+
return `${date.getFullYear()}年${`0${date.getMonth() + 1}`.slice(-2)}月${`0${date.getDate()}`.slice(-2)}日 ${`0${date.getHours()}`.slice(-2)}:${`0${date.getMinutes()}`.slice(-2)}:${`0${date.getSeconds()}`.slice(-2)}`;
|
|
3431
3425
|
}
|
|
3432
3426
|
};
|
|
3433
3427
|
(function(_GenerateImg) {
|
|
@@ -3611,8 +3605,7 @@ var BiliAPI = class extends Service {
|
|
|
3611
3605
|
const value = params[key].toString().replace(chr_filter, "");
|
|
3612
3606
|
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
3613
3607
|
}).join("&");
|
|
3614
|
-
|
|
3615
|
-
return `${query}&w_rid=${wbi_sign}`;
|
|
3608
|
+
return `${query}&w_rid=${md5(query + mixin_key)}`;
|
|
3616
3609
|
}
|
|
3617
3610
|
async getWbi(params) {
|
|
3618
3611
|
const web_keys = this.wbiSign || await this.getWbiKeys();
|
|
@@ -4162,8 +4155,7 @@ var BiliAPI = class extends Service {
|
|
|
4162
4155
|
const data = new TextEncoder().encode(`refresh_${timestamp}`);
|
|
4163
4156
|
return new Uint8Array(await crypto.subtle.encrypt({ name: "RSA-OAEP" }, publicKey, data)).reduce((str, c) => str + c.toString(16).padStart(2, "0"), "");
|
|
4164
4157
|
}
|
|
4165
|
-
const
|
|
4166
|
-
const correspondPath = await getCorrespondPath(ts);
|
|
4158
|
+
const correspondPath = await getCorrespondPath(DateTime.now().toMillis());
|
|
4167
4159
|
const { data: refreshCsrfHtml } = await this.client.get(`https://www.bilibili.com/correspond/1/${correspondPath}`);
|
|
4168
4160
|
const { document } = new JSDOM(refreshCsrfHtml).window;
|
|
4169
4161
|
const targetElement = document.getElementById("1-name");
|