koishi-plugin-bilibili-notify 1.2.8 → 1.2.10

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/biliAPI.js CHANGED
@@ -152,16 +152,11 @@ class BiliAPI extends koishi_1.Service {
152
152
  disposeNotifier() { this.loginNotifier && this.loginNotifier.dispose(); }
153
153
  getRandomUserAgent() {
154
154
  const userAgents = [
155
- // Chrome
156
- 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36',
157
- // Firefox
158
- 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0',
159
- // Safari
160
- 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Safari/605.1.15',
161
- // Internet Explorer
162
- 'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; AS; rv:11.0) like Gecko',
163
- // Edge
164
- 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 Edg/98.0.1108.62',
155
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36',
156
+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36',
157
+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36',
158
+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0',
159
+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36'
165
160
  ];
166
161
  const index = Math.floor(Math.random() * userAgents.length);
167
162
  return userAgents[index];
@@ -791,7 +791,7 @@ class ComRegister {
791
791
  await this.sendPrivateMsg(bot, '账号未登录,请登录后重新订阅动态');
792
792
  break;
793
793
  }
794
- default: await this.sendPrivateMsg(bot, '获取动态信息错误,错误为:' + content.message); // 未知错误
794
+ default: await this.sendPrivateMsg(bot, '获取动态信息错误,错误码为:' + content.code + ',错误为:' + content.message); // 未知错误
795
795
  }
796
796
  // 取消订阅
797
797
  this.unsubSingle(ctx, uid, 1); /* 1为取消动态订阅 */
@@ -850,12 +850,14 @@ class ComRegister {
850
850
  const dUrl = this.config.dynamicUrl ? `${upName}发布了一条动态:https://t.bilibili.com/${dynamicId}` : '';
851
851
  // 如果pic存在,则直接返回pic
852
852
  if (pic) {
853
+ this.logger.info('推送动态中,使用render模式');
853
854
  // pic存在,使用的是render模式
854
855
  await this.sendMsg(ctx, guildId, bot, pic + (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: dUrl }));
855
856
  }
856
857
  else {
858
+ this.logger.info('推送动态中,使用page模式');
857
859
  // pic不存在,说明使用的是page模式
858
- await this.sendMsg(ctx, guildId, bot, (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [koishi_1.h.image(buffer, 'image/png'), " ", dUrl] }));
860
+ await this.sendMsg(ctx, guildId, bot, (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("img", { src: 'data:image/png;base64,' + buffer.toString('base64') }), " ", dUrl] }));
859
861
  }
860
862
  // 更新时间点为最新发布动态的发布时间
861
863
  switch (num) {
@@ -909,7 +911,7 @@ class ComRegister {
909
911
  return await this.sendMsg(ctx, guildId, bot, pic + msg);
910
912
  }
911
913
  // pic不存在,说明使用的是page模式
912
- await this.sendMsg(ctx, guildId, bot, (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [koishi_1.h.image(buffer, 'image/png'), " ", atAll && (0, jsx_runtime_1.jsx)("at", { type: "all" }), " ", liveStartMsg && liveStartMsg] }));
914
+ await this.sendMsg(ctx, guildId, bot, (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("img", { src: 'data:image/png;base64,' + buffer.toString('base64') }), " ", atAll && (0, jsx_runtime_1.jsx)("at", { type: "all" }), " ", liveStartMsg && liveStartMsg] }));
913
915
  };
914
916
  return async () => {
915
917
  try {
package/lib/database.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.apply = exports.name = void 0;
3
+ exports.name = void 0;
4
+ exports.apply = apply;
4
5
  exports.name = 'Database';
5
6
  function apply(ctx) {
6
7
  // 新增LoginBili表
@@ -22,4 +23,3 @@ function apply(ctx) {
22
23
  time: 'timestamp'
23
24
  }, { autoInc: true });
24
25
  }
25
- exports.apply = apply;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { Context, Schema, Service } from "koishi";
3
2
  declare module 'koishi' {
4
3
  interface Context {
package/lib/index.js CHANGED
@@ -26,7 +26,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.apply = exports.Config = exports.name = exports.inject = void 0;
29
+ exports.Config = exports.name = exports.inject = void 0;
30
+ exports.apply = apply;
30
31
  const koishi_1 = require("koishi");
31
32
  // import plugins
32
33
  // import Authority from './authority'
@@ -263,4 +264,3 @@ function apply(ctx, config) {
263
264
  }
264
265
  });
265
266
  }
266
- exports.apply = apply;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-bilibili-notify",
3
3
  "description": "Koishi bilibili notify plugin",
4
- "version": "1.2.8",
4
+ "version": "1.2.10",
5
5
  "contributors": [
6
6
  "Akokko <admin@akokko.com>"
7
7
  ],
@@ -24,11 +24,11 @@
24
24
  "bilibili"
25
25
  ],
26
26
  "peerDependencies": {
27
- "koishi": "^4.17.2"
27
+ "koishi": "^4.17.4"
28
28
  },
29
29
  "dependencies": {
30
- "axios": "^1.6.7",
31
- "axios-cookiejar-support": "^5.0.0",
30
+ "axios": "^1.6.8",
31
+ "axios-cookiejar-support": "^5.0.1",
32
32
  "jimp": "^0.22.12",
33
33
  "jsdom": "^24.0.0",
34
34
  "luxon": "^3.4.4",
@@ -41,7 +41,7 @@
41
41
  "@types/md5": "^2",
42
42
  "@types/qrcode": "^1",
43
43
  "@types/tough-cookie": "^4",
44
- "koishi-plugin-puppeteer": "^3.8.2"
44
+ "koishi-plugin-puppeteer": "^3.8.4"
45
45
  },
46
46
  "koishi": {
47
47
  "service": {
package/readme.md CHANGED
@@ -142,6 +142,8 @@
142
142
  - ver 1.2.6 现在可以随机生成UA,并更新了UA
143
143
  - ver 1.2.7 修复不论选择什么渲染模式都是render模式的bug,优化直播卡片推送逻辑
144
144
  - ver 1.2.8 修复例如像UP主籽岷使用webp格式的头像,下播通知无法发出的bug
145
+ - ver 1.2.9-alpha.0 bug测试版本,请跳过
146
+ - ver 1.2.10 修复插件启动一段时间后一直报错的问题,更新了UA列表,新增了更多日志输出
145
147
 
146
148
  ## 交流群
147
149