yz-yuki-plugin 1.0.2 → 1.0.3-rc.1

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +20 -26
  3. package/defaultConfig/help/help.yaml +3 -3
  4. package/lib/apps/bilibili.js +45 -18
  5. package/lib/components/dynamic/Account.js +1 -1
  6. package/lib/components/dynamic/Content.js +1 -1
  7. package/lib/components/dynamic/Footer.js +1 -1
  8. package/lib/components/dynamic/ForwardContent.js +1 -1
  9. package/lib/components/dynamic/LogoText.js +1 -1
  10. package/lib/components/dynamic/MainPage.js +1 -1
  11. package/lib/components/help/Help.js +1 -1
  12. package/lib/components/loginQrcode/Page.js +1 -1
  13. package/lib/components/version/Version.js +1 -1
  14. package/lib/models/bilibili/bilibili.api.js +1 -0
  15. package/lib/models/bilibili/bilibili.get.web.data.js +6 -3
  16. package/lib/models/bilibili/bilibili.models.js +2 -2
  17. package/lib/models/bilibili/bilibili.query.js +7 -7
  18. package/lib/models/bilibili/bilibili.task.js +54 -33
  19. package/lib/models/weibo/weibo.task.js +54 -33
  20. package/lib/types/models/bilibili/bilibili.api.d.ts +1 -0
  21. package/lib/types/models/bilibili/bilibili.task.d.ts +4 -3
  22. package/lib/types/models/weibo/weibo.task.d.ts +4 -3
  23. package/lib/utils/puppeteer.render.js +1 -1
  24. package/package.json +23 -23
  25. package/public/output.css +1 -1
  26. package/resources/css/dynamic/Content.css +0 -11
  27. package/resources/css/dynamic/Footer.css +0 -8
  28. package/resources/css/dynamic/MainPage.css +3 -3
  29. package/resources/css/help/help.css +5 -5
  30. package/resources/css/loginQrcode/Page.css +8 -0
  31. package/resources/css/version/version.css +6 -6
  32. package/resources/fonts/OPSans.woff2 +0 -0
  33. package/resources/img/readme/mini-help.jpg +0 -0
  34. package/resources/fonts/iconfont.16acc2.ttf +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # 1.0.3
2
+ * 修复群组与好友动态推送混淆问题
3
+ * 更新获取B站up信息api
4
+ * 优化动态字体样式
5
+ * 优化文字动态内容排版
6
+ * 修复转发动态内容缺失
7
+
1
8
  # 1.0.2
2
9
  * 新增支持获取完整文章动态内容
3
10
  * 修复宫格样式
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # YUKI-PLUGIN
4
4
 
5
- - 一个适用于 [Yunzai-V4 系列机器人框架](https://github.com/yunzai-org/yunzaijs/) 的B站动态和微博动态订阅推送的插件
5
+ - 一个适用于 `Yunzai 系列机器人框架` 的B站动态和微博动态订阅推送的插件
6
6
 
7
7
  - 支持 群聊/私聊 订阅B站动态和微博动态,支持定时推送,支持手动触发推送,支持简单查询B站/微博用户信息。
8
8
 
@@ -10,12 +10,12 @@
10
10
 
11
11
  ## 🌰安装插件
12
12
 
13
- #### 1. 克隆仓库
14
- 按照网络情况或个人喜好,选择克隆仓库到本地。
13
+ #### 1. 安装方式选择
14
+ 按照网络情况或个人喜好,选择安装方式。
15
15
 
16
- ```yunzai-v4:```
16
+ ##### ```Yunzai-Next:```
17
17
 
18
- 1. V4 npm包 方式 安装:
18
+ 1. yunzai-next npm包 方式 安装插件:
19
19
  >```
20
20
  > yarn add yz-yuki-plugin -W
21
21
  >```
@@ -31,21 +31,15 @@ export default defineConfig({
31
31
  2. 旧的方式安装:
32
32
  >gitee仓库:
33
33
  >```
34
- >git clone https://gitee.com/snowtafir/yuki-plugin.git ./plugins/yuki-plugin
34
+ >git clone --branch main https://gitee.com/snowtafir/yuki-plugin.git ./plugins/yuki-plugin
35
35
  >```
36
36
 
37
37
  >github仓库:
38
38
  >```
39
- >git clone https://github.com/snowtafir/yuki-plugin.git ./plugins/yuki-plugin
39
+ >git clone --branch main https://github.com/snowtafir/yuki-plugin.git ./plugins/yuki-plugin
40
40
  >```
41
- > [!NOTE]
42
- > 如果你的网络环境较差,无法连接到 Github,可以使用 [GitHub Proxy](https://mirror.ghproxy.com/) 提供的文件代理加速下载服务
43
- >
44
- > ```
45
- > git clone https://mirror.ghproxy.com/https://github.com/snowtafir/yuki-plugin.git ./plugins/yuki-plugin
46
- > ```
47
-
48
- ```yunzai-v3:```
41
+
42
+ ##### ```Yunzai-V3:```
49
43
  >gitee仓库:
50
44
  >```
51
45
  >git clone --branch main3 https://gitee.com/snowtafir/yuki-plugin.git ./plugins/yuki-plugin
@@ -57,12 +51,12 @@ export default defineConfig({
57
51
  >```
58
52
 
59
53
  #### 2. 安装依赖
60
- * yunzai-v4:
54
+ * Yunzai-Next:
61
55
  ```
62
56
  yarn install
63
57
  ```
64
58
 
65
- * yunzai-v3:
59
+ * Yunzai-V3:
66
60
  ```
67
61
  pnpm install --filter=yuki-plugin
68
62
  ```
@@ -129,8 +123,8 @@ https://m.weibo.cn/u/7643376782 # 7643376782 为崩坏星穹铁道博主uid
129
123
  | --------- | ----------- | ------------ |
130
124
  ||||
131
125
  | **B站功能** | ------------------------- | ---------- |
132
- | 添加B站推送 | 检测up的B站动态进行推送,权限:Master。可选分类:直播、视频、图文、文章,不加分类则默认全部 | `#订阅B站推送uid` `#订阅B站图文推送uid` |
133
- | 取消B站推送 | 删除对应up的B站对应类型的动态推送,权限:Master,可选分类:直播、视频、图文、文章,不加分类则默认全部 | `#取消B站推送uid` `#取消B站图文推送uid` |
126
+ | 添加B站推送 | 检测up的B站动态进行推送,权限:Master。可选分类:直播、视频、图文、文章,不加分类则默认全部 | `#订阅B站推送uid` `#订阅B站推送 图文 uid` |
127
+ | 取消B站推送 | 删除对应up的B站对应类型的动态推送,权限:Master,可选分类:直播、视频、图文、文章,不加分类则默认全部 | `#取消B站推送uid` `#取消B站推送 图文 uid` |
134
128
  | 查看B站订阅列表 | 查看本Bot所有的B站订阅列表,权限:Bot的Master | `#B站全部订阅列表` |
135
129
  | 查看本群/私聊B站订阅列表 | 查看 本群/私聊 添加的B站订阅列表 | `#B站订阅列表` |
136
130
  | 手动推送B站订阅 | 手动触发定时推送任务,权限:Bot的Master | `#执行B站任务` |
@@ -145,8 +139,8 @@ https://m.weibo.cn/u/7643376782 # 7643376782 为崩坏星穹铁道博主uid
145
139
  | 刷新B站临时ck | 重新获取并刷新redis缓存的未绑定自己的B站ck而自动获取的 临时B站cookie | `#刷新B站临时ck` |
146
140
  ||||
147
141
  | **微博功能** | ------------------------- | ---------- |
148
- | 添加微博推送 | 检测博主的微博动态进行推送,权限:Master,可选分类:视频、图文、文章,不加分类则默认全部 | `#订阅微博推送uid` `#订阅微博图文推送uid` |
149
- | 取消微博推送 | 删除对应博主的微博对应类型的动态推送,权限:Master,可选分类:视频、图文、文章,不加分类则默认全部 | `#取消微博推送uid` `#取消B站图文推送uid` |
142
+ | 添加微博推送 | 检测博主的微博动态进行推送,权限:Master,可选分类:视频、图文、文章,不加分类则默认全部 | `#订阅微博推送uid` `#订阅微博推送 图文 uid` |
143
+ | 取消微博推送 | 删除对应博主的微博对应类型的动态推送,权限:Master,可选分类:视频、图文、文章,不加分类则默认全部 | `#取消微博推送uid` `#取消B站推送 图文 uid` |
150
144
  | 查看微博订阅列表 | 查看本Bot所有的B站订阅列表,权限:Bot的Master | `#微博全部订阅列表` |
151
145
  | 查看本群/私聊微博订阅列表 | 查看 本群/私聊 添加的微博订阅列表 | `#微博订阅列表` |
152
146
  | 手动推送微博订阅 | 手动触发定时推送任务,权限:Bot的Master | `#执行微博任务` |
@@ -155,8 +149,8 @@ https://m.weibo.cn/u/7643376782 # 7643376782 为崩坏星穹铁道博主uid
155
149
  ||||
156
150
  | **其他指令** | | |
157
151
  | 查看版本信息 | 查看版本信息 | `#优纪版本` |
158
- | 更新yuki插件 | 系统指令更新yuki插件,v4需安装yz-system | `#更新yuki-plugin` |
159
- | 强制更新yuki插件 | 强制更新yuki插件,v4需安装yz-system| `#强制更新yuki-plugin` |
152
+ | 更新yuki插件 | 系统指令更新yuki插件,yunzai-next需安装yz-system | `#更新yuki-plugin` |
153
+ | 强制更新yuki插件 | 强制更新yuki插件,yunzai-next需安装yz-system| `#强制更新yuki-plugin` |
160
154
 
161
155
  </details>
162
156
 
@@ -185,9 +179,9 @@ https://m.weibo.cn/u/7643376782 # 7643376782 为崩坏星穹铁道博主uid
185
179
 
186
180
  | Nickname | Contribution |
187
181
  | :-----------------------------------------------------------------: | ----------------------- |
188
- |Yunzai-V4||
189
- | [yunzai-org文档](https://yunzai-org.github.io/docs/) | Yunzai Next 文档 |
190
- | [Yunzai-V4 仓库](https://github.com/yunzai-org/yunzaijs/) | Yunzai Next |
182
+ |Yunzai-Next||
183
+ | [Yunzai-org文档](https://yunzai-org.github.io/docs/) | Yunzai Next 文档 |
184
+ | [Yunzai-Next 仓库](https://github.com/yunzai-org/yunzaijs/) | Yunzai Next |
191
185
  |Yunzai-V3||
192
186
  | [功能/插件库](https://gitee.com/yhArcadia/Yunzai-Bot-plugins-index) | Yunzai-Bot 相关内容索引 |
193
187
  | [TRSS-Yunzai](https://gitee.com/TimeRainStarSky/Yunzai) | 时雨🌌星空的 TRSS-Yunzai |
@@ -60,7 +60,7 @@
60
60
  desc: "#取消微博推送(视频|文章|图文|转发)UID"
61
61
  - icon: restaurant_smoothie
62
62
  title: "#微博全部订阅列表"
63
- desc: "查看本Bot所有的B站订阅列表"
63
+ desc: "查看本Bot所有的微博订阅列表"
64
64
  - icon: archaic_stone
65
65
  title: "#微博订阅列表"
66
66
  desc: "查看 本群/私聊 添加的微博订阅列表"
@@ -80,7 +80,7 @@
80
80
  desc: 查看版本信息
81
81
  - icon: 钓鱼
82
82
  title: "#更新yuki-plugin"
83
- desc: "系统指令更新yuki插件,v4需安装yz-system"
83
+ desc: "系统指令更新yuki插件,yz-next需安装yz-system"
84
84
  - icon: pluie_lotus
85
85
  title: "#强制更新yuki-plugin"
86
- desc: "强制更新yuki插件,v4需安装yz-system"
86
+ desc: "强制更新yuki插件,yz-next需安装yz-system"
@@ -56,14 +56,26 @@ message.use(async (e) => {
56
56
  e.reply("出了点网络问题,等会再试试吧~");
57
57
  return false;
58
58
  }
59
- const resData = res.data || {};
60
- if (resData.code !== 0) {
61
- e.reply(`订阅校验失败~\nup主uid:${uid} 可能是无效的,或遭遇了风控,请稍后再试~`);
62
- logger.mark(`yuki-plugin addDynamicSub Failed:${JSON.stringify(resData)}`);
59
+ const { code, data } = res.data || {};
60
+ if (code === -352) {
61
+ e.reply(`遭遇风控,订阅校验失败~\n请检查Cookie配置后再试~`);
62
+ logger.mark(`yuki-plugin addDynamicSub Failed:${JSON.stringify(res.data)}`);
63
63
  return true;
64
64
  }
65
- const { items } = resData.data || {};
66
- let name = items.length > 0 ? (items[0].modules.module_author?.name || uid) : uid;
65
+ const { has_more, items } = data || {};
66
+ if ((code === 0) && (has_more === false)) {
67
+ e.reply(`订阅校验失败~\nup主uid:${uid} 无效,请核对uid后再试~`);
68
+ return;
69
+ }
70
+ let name;
71
+ if (Array.isArray(items)) {
72
+ if (items.length > 0) {
73
+ name = items[0].modules?.module_author?.name || uid;
74
+ }
75
+ }
76
+ else {
77
+ name = uid;
78
+ }
67
79
  subData[chatType][chatId].push({
68
80
  bot_id: e.self_id,
69
81
  uid,
@@ -358,12 +370,16 @@ message.use(async (e) => {
358
370
  return;
359
371
  }
360
372
  const { code, data } = res.data || {};
361
- if (code === -799) {
362
- e.reply("遭遇风控:请求过于频繁,请稍后再试。");
373
+ if (code === -400) {
374
+ e.reply("获取请求错误~");
375
+ return;
376
+ }
377
+ else if (code === -403) {
378
+ e.reply("可能是Cookie过期或api参数错误,\n访问权限不足,获取失败。");
363
379
  return;
364
380
  }
365
381
  else if (code === -404) {
366
- e.reply("输入的uid无效。");
382
+ e.reply("用户不存在,输入的uid无效。");
367
383
  return;
368
384
  }
369
385
  const message = [
@@ -372,7 +388,8 @@ message.use(async (e) => {
372
388
  `\n等级:${data?.level}`,
373
389
  ];
374
390
  if (data.live_room) {
375
- message.push(`\n***********\n---直播信息---`, `\n直播标题:${data?.live_room?.title}`, `\n直播房间:${data?.live_room?.roomid}`, `\n直播状态:${data?.live_room?.liveStatus ? "直播中" : "未开播"}`, `\n直播链接:${data?.live_room?.url}`, `\n观看人数:${data?.live_room?.watched_show?.num}人`);
391
+ message.push(`***********\n---直播信息---`, `\n直播标题:${data?.live_room?.title}`, `\n直播房间:${data?.live_room?.roomid}`, `\n直播状态:${data?.live_room?.liveStatus ? "直播中" : "未开播"}`, `\n观看人数:${data?.live_room?.watched_show?.num}人`);
392
+ e.reply(`直播链接:${data?.live_room?.url}`);
376
393
  }
377
394
  e.reply(message);
378
395
  }, [/^(#|\/)(yuki|优纪)?(b站|B站|bili|bilibili|哔哩|哔哩哔哩)(up|UP)主.*$/]);
@@ -384,17 +401,27 @@ message.use(async (e) => {
384
401
  return;
385
402
  }
386
403
  const { code, data } = await res.data || {};
387
- if (code !== 0 || !data.result) {
388
- e.reply("哦豁~没有搜索到该用户捏,请换个关键词试试吧~");
404
+ if (code === -400) {
405
+ e.reply("搜索请求错误~");
406
+ return;
407
+ }
408
+ else if (code === -412) {
409
+ e.reply("未配置可用Cookie,请求被拦截,请配置Cookie后再试吧~");
410
+ return;
411
+ }
412
+ if (!data.result) {
413
+ e.reply("哦豁~没有搜索到该关键词相关的up主信息,请换个关键词试试吧~");
414
+ return;
415
+ }
416
+ if (!Array.isArray(data.result) || !data.result.every(item => typeof item === 'object' && 'uname' in item && 'mid' in item && 'fans' in item)) {
417
+ e.reply("哦豁~数据格式有误,请检查后重试!");
389
418
  return;
390
419
  }
391
420
  const messages = [];
392
- data.result.map((item, index) => {
393
- if (index < 5) {
394
- messages.push(`${item.uname}\nUID:${item.mid}\n粉丝数:${item.fans}${index < 4 ? "\n" : ""}`);
395
- }
396
- return item;
397
- });
421
+ for (let index = 0; index < Math.min((data.result).length, 5); index++) {
422
+ const item = data.result[index];
423
+ messages.push(`${item.uname}\nUID:${item.mid}\n粉丝数:${item.fans}${index < 4 ? "\n" : ""}`);
424
+ }
398
425
  e.reply(messages.join("\n"));
399
426
  }, [/^(#|\/)(yuki|优纪)?搜索(b站|B站|bili|bilibili|哔哩|哔哩哔哩)(up|UP)主.*$/]);
400
427
  const YukiBli = message.ok;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import LogoText from './LogoText.js';
3
- import { createRequire } from 'module';
3
+ import { createRequire } from 'react-puppeteer';
4
4
 
5
5
  const require = createRequire(import.meta.url);
6
6
  const bilibililogo = require('./../../../resources/img/icon/dynamic/bilibili.svg');
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { createRequire } from 'module';
2
+ import { createRequire } from 'react-puppeteer';
3
3
 
4
4
  const require = createRequire(import.meta.url);
5
5
  const Content = ({ data }) => {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ConfigController, BOT_NAME } from 'yunzai';
3
3
  import Config from '../../utils/config.js';
4
- import { createRequire } from 'module';
4
+ import { createRequire } from 'react-puppeteer';
5
5
 
6
6
  const botVersion = ConfigController.package?.version;
7
7
  const require = createRequire(import.meta.url);
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import Account from './Account.js';
3
3
  import Content from './Content.js';
4
- import { createRequire } from 'module';
4
+ import { createRequire } from 'react-puppeteer';
5
5
 
6
6
  const require = createRequire(import.meta.url);
7
7
  const ForwardContent = ({ data }) => (React.createElement(React.Fragment, null,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { createRequire } from 'module';
2
+ import { createRequire } from 'react-puppeteer';
3
3
 
4
4
  const require = createRequire(import.meta.url);
5
5
  const LogoText = ({ data }) => (React.createElement(React.Fragment, null,
@@ -3,7 +3,7 @@ import Account from './Account.js';
3
3
  import Content from './Content.js';
4
4
  import ForwardContent from './ForwardContent.js';
5
5
  import Footer from './Footer.js';
6
- import { createRequire } from 'module';
6
+ import { createRequire } from 'react-puppeteer';
7
7
 
8
8
  const require = createRequire(import.meta.url);
9
9
  function App({ data }) {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { BOT_NAME, ConfigController } from 'yunzai';
3
3
  import Config from '../../utils/config.js';
4
- import { createRequire } from 'module';
4
+ import { createRequire } from 'react-puppeteer';
5
5
 
6
6
  const botVersion = ConfigController.package?.version;
7
7
  const require = createRequire(import.meta.url);
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { createRequire } from 'module';
2
+ import { createRequire } from 'react-puppeteer';
3
3
 
4
4
  const require = createRequire(import.meta.url);
5
5
  function App({ data }) {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { BOT_NAME, ConfigController } from 'yunzai';
3
3
  import Config from '../../utils/config.js';
4
- import { createRequire } from 'module';
4
+ import { createRequire } from 'react-puppeteer';
5
5
 
6
6
  const botVersion = ConfigController.package?.version;
7
7
  const require = createRequire(import.meta.url);
@@ -5,6 +5,7 @@ class BiliApi {
5
5
  biliSpaceUserInfo: `https://api.bilibili.com/x/space/acc/info`,
6
6
  biliSpaceUserInfoWbi: `https://api.bilibili.com/x/space/wbi/acc/info`,
7
7
  biliSearchUp: `https://api.bilibili.com/x/web-interface/search/type`,
8
+ biliSearchUpWbi: `https://api.bilibili.com/x/web-interface/wbi/search/type`,
8
9
  biliLiveStatus: 'https://api.live.bilibili.com/room/v1/Room/get_status_info_by_uids',
9
10
  biliCard: "https://api.bilibili.com/x/web-interface/card",
10
11
  biliStat: "https://api.bilibili.com/x/relation/stat",
@@ -56,17 +56,20 @@ class BiliGetWebData {
56
56
  return res;
57
57
  }
58
58
  async searchBiliUserInfoByKeyword(keyword) {
59
- const url = BiliApi.BILIBIL_API.biliSearchUp;
59
+ const url = BiliApi.BILIBIL_API.biliSearchUpWbi;
60
60
  let { cookie } = await readSyncCookie();
61
61
  const data = {
62
62
  keyword: keyword,
63
63
  page: 1,
64
64
  search_type: 'bili_user',
65
65
  order: 'totalrank',
66
- pagesize: 5
67
66
  };
67
+ let signCookie = await readSavedCookieItems(cookie, ["SESSDATA"], false) || await readSavedCookieOtherItems(cookie, ["SESSDATA"]);
68
+ const { w_rid, time_stamp } = await getWbiSign(data, BiliApi.BILIBILI_HEADERS, signCookie);
68
69
  const params = {
69
- ...data
70
+ ...data,
71
+ w_rid: w_rid,
72
+ wts: time_stamp
70
73
  };
71
74
  const res = await axios.get(url, {
72
75
  params,
@@ -62,7 +62,7 @@ async function pollLoginQRCode(e, qrcodeKey) {
62
62
  }
63
63
  else if (data.data.code === 86101) {
64
64
  await new Promise((resolve) => setTimeout(resolve, 2000));
65
- (logger ?? Bot.logger)?.mark(`yuki-yuki插件:扫码B站登录:未扫码,轮询中...`);
65
+ (logger ?? Bot.logger)?.mark(`优纪插件:扫码B站登录:未扫码,轮询中...`);
66
66
  return pollLoginQRCode(e, qrcodeKey);
67
67
  }
68
68
  else if (data.data.code === 86090) {
@@ -91,7 +91,7 @@ async function checkBiliLogin(e) {
91
91
  redirect: "follow",
92
92
  });
93
93
  const resData = await res.json();
94
- Bot.logger?.mark(`B站动态请求code:${JSON.stringify(resData)}`);
94
+ Bot.logger?.debug(`B站验证登录状态:${JSON.stringify(resData)}`);
95
95
  if (resData.code === 0) {
96
96
  let uname = resData.data?.uname;
97
97
  let mid = resData.data?.mid;
@@ -111,7 +111,7 @@ class BiliQuery {
111
111
  formatData.data.pubTs = moment(author.pub_ts * 1000).format("YYYY年MM月DD日 HH:mm:ss");
112
112
  formatData.data.url = `${BiliDrawDynamicLinkUrl}${data.id_str}`;
113
113
  formatData.data.pics = [data?.cover];
114
- formatData.data.orig = this.formatDynamicData(data.orig);
114
+ formatData.data.orig = await this.formatDynamicData(data.orig);
115
115
  formatData.data.category = "转发动态";
116
116
  break;
117
117
  case "DYNAMIC_TYPE_LIVE_RCMD":
@@ -233,13 +233,13 @@ class BiliQuery {
233
233
  desc = data?.modules?.module_dynamic?.major?.opus || {};
234
234
  pics = desc?.pics;
235
235
  pics = pics.map((item) => { return item?.url; }) || [];
236
- content = this.parseRichTextNodes(desc?.summary?.text) || "";
236
+ content = desc?.summary?.text || "";
237
237
  }
238
238
  else {
239
239
  desc = data?.modules?.module_dynamic?.desc || {};
240
240
  pics = data?.modules?.module_dynamic?.major?.draw?.items;
241
241
  pics = [];
242
- content = this.parseRichTextNodes(desc?.text);
242
+ content = desc?.text;
243
243
  }
244
244
  if (!desc && !author)
245
245
  return;
@@ -261,13 +261,13 @@ class BiliQuery {
261
261
  pics = pics.map((item) => {
262
262
  return item.url;
263
263
  });
264
- content = this.parseRichTextNodes(desc?.summary?.text) || "";
264
+ content = desc?.summary?.text || "";
265
265
  }
266
266
  else {
267
267
  desc = data?.modules?.module_dynamic?.desc;
268
268
  pics = data?.modules?.module_dynamic?.major?.draw?.items;
269
269
  pics = pics.map((item) => { return item?.src; });
270
- content = this.parseRichTextNodes(desc?.text);
270
+ content = desc?.text;
271
271
  }
272
272
  if (!desc && !pics && !author)
273
273
  return;
@@ -296,7 +296,7 @@ class BiliQuery {
296
296
  pics = desc?.pics;
297
297
  pics = pics.map((item) => { return item.url; }) || [];
298
298
  dynamicTitle = desc?.title;
299
- content = this.parseRichTextNodes(desc?.summary?.rich_text_nodes || desc?.summary?.text) || "";
299
+ content = desc?.summary?.text || "";
300
300
  }
301
301
  else {
302
302
  desc = data?.modules?.module_dynamic?.major?.article || {};
@@ -325,7 +325,7 @@ class BiliQuery {
325
325
  case "DYNAMIC_TYPE_FORWARD":
326
326
  author = data?.modules?.module_author;
327
327
  desc = data?.modules?.module_dynamic?.desc || {};
328
- content = this.parseRichTextNodes(desc?.text);
328
+ content = desc?.text;
329
329
  if (!desc && !author)
330
330
  return;
331
331
  if (!data.orig)
@@ -8,11 +8,13 @@ import { BiliQuery } from './bilibili.query.js';
8
8
 
9
9
  class BiliTask {
10
10
  taskName;
11
- key;
11
+ groupKey;
12
+ privateKey;
12
13
  e;
13
14
  constructor(e) {
14
15
  this.taskName = "biliTask";
15
- this.key = "Yz:yuki:bili:upPush:";
16
+ this.groupKey = "Yz:yuki:bili:upPush:group:";
17
+ this.privateKey = "Yz:yuki:bili:upPush:private:";
16
18
  }
17
19
  async hendleEventDynamicData(uid, count = 0) {
18
20
  const resp = await new BiliGetWebData().getBiliDynamicListDataByUid(uid);
@@ -50,6 +52,10 @@ class BiliTask {
50
52
  }
51
53
  async processBiliData(biliPushData, uidMap, dynamicList, lastLiveStatus) {
52
54
  for (let chatType in biliPushData) {
55
+ if (!uidMap.has(chatType)) {
56
+ uidMap.set(chatType, new Map());
57
+ }
58
+ const chatTypeMap = uidMap.get(chatType);
53
59
  for (let chatId in biliPushData[chatType]) {
54
60
  const subUpsOfChat = biliPushData[chatType][chatId] || [];
55
61
  for (let subInfoOfup of subUpsOfChat) {
@@ -75,41 +81,48 @@ class BiliTask {
75
81
  logger.error(`获取 ${subInfoOfup.uid} 动态失败,resp 为空`);
76
82
  return;
77
83
  }
78
- const chatIds = Array.from(new Set([...Object((uidMap.get(subInfoOfup.uid) && uidMap.get(subInfoOfup.uid).chatIds) || []), chatId]));
84
+ const chatIds = Array.from(new Set([...Object((chatTypeMap.get(subInfoOfup.uid) && chatTypeMap.get(subInfoOfup.uid).chatIds) || []), chatId]));
79
85
  const bot_id = subInfoOfup.bot_id || [];
80
86
  const { name, type } = subInfoOfup;
81
- uidMap.set(subInfoOfup.uid, { chatIds, bot_id, upName: name, type, chatType });
82
- await new Promise((resolve) => setTimeout(resolve, Math.floor(Math.random() * (4000 - 1000 + 1) + 1000)));
87
+ chatTypeMap.set(subInfoOfup.uid, { chatIds, bot_id, upName: name, type });
88
+ await new Promise((resolve) => setTimeout(resolve, Math.floor(Math.random() * (8000 - 2000 + 1) + 2000)));
83
89
  }
84
90
  }
85
91
  }
86
92
  }
87
93
  async pushDynamicMessages(uidMap, dynamicList, now, interval, biliConfigData) {
88
- for (let [key, value] of uidMap) {
89
- const tempDynamicList = dynamicList[key] || [];
90
- const willPushDynamicList = [];
91
- for (let dynamicItem of tempDynamicList) {
92
- let author = dynamicItem?.modules?.module_author || {};
93
- logger.info(`正在检测B站动态 [ ${author?.name} : ${author?.mid} ]`);
94
- if (!author?.pub_ts)
95
- continue;
96
- if (Number(now - author.pub_ts) > interval) {
97
- logger.info(`超过间隔,跳过 [ ${author?.name} : ${author?.mid} ] ${author?.pub_time} 的动态`);
98
- continue;
94
+ for (let [chatType, chatTypeMap] of uidMap) {
95
+ for (let [key, value] of chatTypeMap) {
96
+ const tempDynamicList = dynamicList[key] || [];
97
+ const willPushDynamicList = [];
98
+ const printedList = new Set();
99
+ for (let dynamicItem of tempDynamicList) {
100
+ let author = dynamicItem?.modules?.module_author || {};
101
+ if (!printedList.has(author?.mid)) {
102
+ logger.info(`正在检测B站动态 [ ${author?.name} : ${author?.mid} ]`);
103
+ printedList.add(author?.mid);
104
+ }
105
+ if (!author?.pub_ts)
106
+ continue;
107
+ if (Number(now - author.pub_ts) > interval) {
108
+ logger.debug(`超过间隔,跳过 [ ${author?.name} : ${author?.mid} ] ${author?.pub_time} 的动态`);
109
+ continue;
110
+ }
111
+ if (dynamicItem.type === "DYNAMIC_TYPE_FORWARD" && !biliConfigData.pushTransmit)
112
+ continue;
113
+ willPushDynamicList.push(dynamicItem);
99
114
  }
100
- if (dynamicItem.type === "DYNAMIC_TYPE_FORWARD" && !biliConfigData.pushTransmit)
101
- continue;
102
- willPushDynamicList.push(dynamicItem);
103
- }
104
- const pushMapInfo = value || {};
105
- const { chatIds, bot_id, upName, type, chatType } = pushMapInfo;
106
- for (let pushDynamicData of willPushDynamicList) {
107
- if (chatIds && chatIds.length) {
108
- for (let chatId of chatIds) {
109
- if (type && type.length && !type.includes(pushDynamicData.type))
110
- continue;
111
- await this.sendDynamic(chatId, bot_id, upName, pushDynamicData, biliConfigData, chatType);
112
- await new Promise((resolve) => setTimeout(resolve, Math.floor(Math.random() * (6500 - 2000 + 1) + 2000)));
115
+ printedList.clear();
116
+ const pushMapInfo = value || {};
117
+ const { chatIds, bot_id, upName, type } = pushMapInfo;
118
+ for (let pushDynamicData of willPushDynamicList) {
119
+ if (chatIds && chatIds.length) {
120
+ for (let chatId of chatIds) {
121
+ if (type && type.length && !type.includes(pushDynamicData.type))
122
+ continue;
123
+ await this.sendDynamic(chatId, bot_id, upName, pushDynamicData, biliConfigData, chatType);
124
+ await new Promise((resolve) => setTimeout(resolve, Math.floor(Math.random() * (6500 - 2000 + 1) + 2000)));
125
+ }
113
126
  }
114
127
  }
115
128
  }
@@ -117,7 +130,15 @@ class BiliTask {
117
130
  }
118
131
  async sendDynamic(chatId, bot_id, upName, pushDynamicData, biliConfigData, chatType) {
119
132
  const id_str = pushDynamicData.id_str;
120
- let sended = await Redis.get(`${this.key}${chatId}:${id_str}`);
133
+ let sended, markKey;
134
+ if (chatType === "group") {
135
+ markKey = this.groupKey;
136
+ sended = await Redis.get(`${markKey}${chatId}:${id_str}`);
137
+ }
138
+ else if (chatType === "private") {
139
+ markKey = this.privateKey;
140
+ sended = await Redis.get(`${markKey}${chatId}:${id_str}`);
141
+ }
121
142
  if (sended)
122
143
  return;
123
144
  if (!!biliConfigData.pushMsgMode) {
@@ -147,7 +168,7 @@ class BiliTask {
147
168
  let imgs = await this.renderDynamicCard(uid, renderData, ScreenshotOptionsData);
148
169
  if (!imgs)
149
170
  return;
150
- Redis.set(`${this.key}${chatId}:${id_str}`, "1", { EX: 3600 * 10 });
171
+ Redis.set(`${markKey}${chatId}:${id_str}`, "1", { EX: 3600 * 10 });
151
172
  (logger ?? Bot.logger)?.mark("优纪插件:B站动态执行推送");
152
173
  for (let i = 0; i < imgs.length; i++) {
153
174
  const image = imgs[i];
@@ -158,7 +179,7 @@ class BiliTask {
158
179
  }
159
180
  else {
160
181
  const dynamicMsg = await BiliQuery.formatTextDynamicData(upName, pushDynamicData, false, biliConfigData);
161
- Redis.set(`${this.key}${chatId}:${id_str}`, "1", { EX: 3600 * 10 });
182
+ Redis.set(`${markKey}${chatId}:${id_str}`, "1", { EX: 3600 * 10 });
162
183
  if (dynamicMsg == "continue") {
163
184
  return "return";
164
185
  }
@@ -242,7 +263,7 @@ class BiliTask {
242
263
  });
243
264
  }
244
265
  else if (chatType === "private") {
245
- await (Bot[bot_id] ?? Bot)?.pickUser(String(chatId)).sendMsg(message)
266
+ await (Bot[bot_id] ?? Bot)?.pickFriend(String(chatId)).sendMsg(message)
246
267
  .catch((error) => {
247
268
  (logger ?? Bot.logger)?.error(`用户[${chatId}]推送失败:${JSON.stringify(error)}`);
248
269
  });
@@ -7,11 +7,13 @@ import { WeiboQuery } from './weibo.query.js';
7
7
 
8
8
  class WeiboTask {
9
9
  taskName;
10
- key;
10
+ groupKey;
11
+ privateKey;
11
12
  e;
12
13
  constructor(e) {
13
14
  this.taskName = "weiboTask";
14
- this.key = "Yz:yuki:weibo:upPush:";
15
+ this.groupKey = "Yz:yuki:weibo:upPush:group:";
16
+ this.privateKey = "Yz:yuki:weibo:upPush:private:";
15
17
  }
16
18
  async runTask() {
17
19
  let weiboConfigData = await Config.getUserConfig("weibo", "config");
@@ -25,6 +27,10 @@ class WeiboTask {
25
27
  }
26
28
  async processWeiboData(weiboPushData, uidMap, dynamicList) {
27
29
  for (let chatType in weiboPushData) {
30
+ if (!uidMap.has(chatType)) {
31
+ uidMap.set(chatType, new Map());
32
+ }
33
+ const chatTypeMap = uidMap.get(chatType);
28
34
  for (let chatId in weiboPushData[chatType]) {
29
35
  const subUpsOfChat = weiboPushData[chatType][chatId] || [];
30
36
  for (let subInfoOfup of subUpsOfChat) {
@@ -33,42 +39,49 @@ class WeiboTask {
33
39
  const dynamicData = resp || [];
34
40
  dynamicList[subInfoOfup.uid] = dynamicData;
35
41
  }
36
- const chatIds = Array.from(new Set([...Object((uidMap.get(subInfoOfup.uid) && uidMap.get(subInfoOfup.uid).chatIds) || []), chatId]));
42
+ const chatIds = Array.from(new Set([...Object((chatTypeMap.get(subInfoOfup.uid) && chatTypeMap.get(subInfoOfup.uid).chatIds) || []), chatId]));
37
43
  const bot_id = subInfoOfup.bot_id || [];
38
44
  const { name, type } = subInfoOfup;
39
- uidMap.set(subInfoOfup.uid, { chatIds, bot_id, upName: name, type, chatType });
45
+ chatTypeMap.set(subInfoOfup.uid, { chatIds, bot_id, upName: name, type });
40
46
  await this.randomDelay(1000, 4000);
41
47
  }
42
48
  }
43
49
  }
44
50
  }
45
51
  async pushDynamicMessages(uidMap, dynamicList, now, interval, weiboConfigData) {
46
- for (let [key, value] of uidMap) {
47
- const tempDynamicList = dynamicList[key] || [];
48
- const willPushDynamicList = [];
49
- for (let dynamicItem of tempDynamicList) {
50
- let raw_post = dynamicItem || {};
51
- let user = raw_post?.mblog?.user || {};
52
- logger.info(`正在检测微博动态 [ ${user?.screen_name} : ${user?.id} ]`);
53
- if (!raw_post?.mblog?.created_at)
54
- continue;
55
- if (Number(now - (WeiboQuery.getDynamicCreatetDate(raw_post) / 1000)) > interval) {
56
- logger.info(`超过间隔,跳过 [ ${user?.screen_name} : ${user?.id} ] ${raw_post?.mblog?.created_at} 的动态`);
57
- continue;
52
+ for (let [chatType, chatTypeMap] of uidMap) {
53
+ for (let [key, value] of chatTypeMap) {
54
+ const tempDynamicList = dynamicList[key] || [];
55
+ const willPushDynamicList = [];
56
+ const printedList = new Set();
57
+ for (let dynamicItem of tempDynamicList) {
58
+ let raw_post = dynamicItem || {};
59
+ let user = raw_post?.mblog?.user || {};
60
+ if (!printedList.has(user?.id)) {
61
+ logger.info(`正在检测微博动态 [ ${user?.screen_name} : ${user?.id} ]`);
62
+ printedList.add(user?.id);
63
+ }
64
+ if (!raw_post?.mblog?.created_at)
65
+ continue;
66
+ if (Number(now - (WeiboQuery.getDynamicCreatetDate(raw_post) / 1000)) > interval) {
67
+ logger.debug(`超过间隔,跳过 [ ${user?.screen_name} : ${user?.id} ] ${raw_post?.mblog?.created_at} 的动态`);
68
+ continue;
69
+ }
70
+ if (dynamicItem.type === "DYNAMIC_TYPE_FORWARD" && !weiboConfigData.pushTransmit)
71
+ continue;
72
+ willPushDynamicList.push(dynamicItem);
58
73
  }
59
- if (dynamicItem.type === "DYNAMIC_TYPE_FORWARD" && !weiboConfigData.pushTransmit)
60
- continue;
61
- willPushDynamicList.push(dynamicItem);
62
- }
63
- const pushMapInfo = value || {};
64
- const { chatIds, bot_id, upName, type, chatType } = pushMapInfo;
65
- for (let pushDynamicData of willPushDynamicList) {
66
- if (chatIds && chatIds.length) {
67
- for (let chatId of chatIds) {
68
- if (type && type.length && !type.includes(pushDynamicData.type))
69
- continue;
70
- await this.sendDynamic(chatId, bot_id, upName, pushDynamicData, weiboConfigData, chatType);
71
- await this.randomDelay(2000, 10500);
74
+ printedList.clear();
75
+ const pushMapInfo = value || {};
76
+ const { chatIds, bot_id, upName, type } = pushMapInfo;
77
+ for (let pushDynamicData of willPushDynamicList) {
78
+ if (chatIds && chatIds.length) {
79
+ for (let chatId of chatIds) {
80
+ if (type && type.length && !type.includes(pushDynamicData.type))
81
+ continue;
82
+ await this.sendDynamic(chatId, bot_id, upName, pushDynamicData, weiboConfigData, chatType);
83
+ await this.randomDelay(2000, 10500);
84
+ }
72
85
  }
73
86
  }
74
87
  }
@@ -76,7 +89,15 @@ class WeiboTask {
76
89
  }
77
90
  async sendDynamic(chatId, bot_id, upName, pushDynamicData, weiboConfigData, chatType) {
78
91
  const id_str = WeiboQuery.getDynamicId(pushDynamicData);
79
- let sended = await Redis.get(`${this.key}${chatId}:${id_str}`);
92
+ let sended, markKey;
93
+ if (chatType === "group") {
94
+ markKey = this.groupKey;
95
+ sended = await Redis.get(`${markKey}${chatId}:${id_str}`);
96
+ }
97
+ else if (chatType === "private") {
98
+ markKey = this.privateKey;
99
+ sended = await Redis.get(`${markKey}${chatId}:${id_str}`);
100
+ }
80
101
  if (sended)
81
102
  return;
82
103
  if (!!weiboConfigData.pushMsgMode) {
@@ -106,7 +127,7 @@ class WeiboTask {
106
127
  let imgs = await this.renderDynamicCard(uid, renderData, ScreenshotOptionsData);
107
128
  if (!imgs)
108
129
  return;
109
- Redis.set(`${this.key}${chatId}:${id_str}`, "1", { EX: 3600 * 10 });
130
+ Redis.set(`${markKey}${chatId}:${id_str}`, "1", { EX: 3600 * 10 });
110
131
  (logger ?? Bot.logger)?.mark("优纪插件:B站动态执行推送");
111
132
  for (let i = 0; i < imgs.length; i++) {
112
133
  const image = imgs[i];
@@ -117,7 +138,7 @@ class WeiboTask {
117
138
  }
118
139
  else {
119
140
  const dynamicMsg = await WeiboQuery.formatTextDynamicData(upName, pushDynamicData, false, weiboConfigData);
120
- Redis.set(`${this.key}${chatId}:${id_str}`, "1", { EX: 3600 * 10 });
141
+ Redis.set(`${markKey}${chatId}:${id_str}`, "1", { EX: 3600 * 10 });
121
142
  if (dynamicMsg == "continue" || dynamicMsg == false) {
122
143
  return "return";
123
144
  }
@@ -201,7 +222,7 @@ class WeiboTask {
201
222
  });
202
223
  }
203
224
  else if (chatType === "private") {
204
- await (Bot[bot_id] ?? Bot)?.pickUser(String(chatId)).sendMsg(message)
225
+ await (Bot[bot_id] ?? Bot)?.pickFriend(String(chatId)).sendMsg(message)
205
226
  .catch((error) => {
206
227
  (logger ?? Bot.logger)?.error(`用户[${chatId}]推送失败:${JSON.stringify(error)}`);
207
228
  });
@@ -5,6 +5,7 @@ export declare class BiliApi {
5
5
  biliSpaceUserInfo: string;
6
6
  biliSpaceUserInfoWbi: string;
7
7
  biliSearchUp: string;
8
+ biliSearchUpWbi: string;
8
9
  biliLiveStatus: string;
9
10
  biliCard: string;
10
11
  biliStat: string;
@@ -3,13 +3,14 @@ import { MainProps } from "../../components/dynamic/MainPage";
3
3
  import { ScreenshotOptions } from './../../utils/puppeteer.render';
4
4
  export declare class BiliTask {
5
5
  taskName: string;
6
- key: string;
6
+ groupKey: string;
7
+ privateKey: string;
7
8
  e?: EventType;
8
9
  constructor(e?: EventType);
9
10
  hendleEventDynamicData(uid: string | number, count?: number): Promise<any>;
10
11
  runTask(): Promise<void>;
11
- processBiliData(biliPushData: any, uidMap: Map<any, any>, dynamicList: any, lastLiveStatus: any): Promise<void>;
12
- pushDynamicMessages(uidMap: Map<any, any>, dynamicList: any, now: number, interval: number, biliConfigData: any): Promise<void>;
12
+ processBiliData(biliPushData: any, uidMap: Map<any, Map<string, any>>, dynamicList: any, lastLiveStatus: any): Promise<void>;
13
+ pushDynamicMessages(uidMap: Map<any, Map<string, any>>, dynamicList: any, now: number, interval: number, biliConfigData: any): Promise<void>;
13
14
  sendDynamic(chatId: string | number, bot_id: string | number, upName: string, pushDynamicData: any, biliConfigData: any, chatType: string): Promise<string>;
14
15
  buildRenderData(extentData: any, urlQrcodeData: string, boxGrid: boolean): MainProps;
15
16
  renderDynamicCard(uid: string, renderData: MainProps, ScreenshotOptionsData: ScreenshotOptions): Promise<Buffer[] | null>;
@@ -3,12 +3,13 @@ import { MainProps } from "../../components/dynamic/MainPage";
3
3
  import { ScreenshotOptions } from '../../utils/puppeteer.render';
4
4
  export declare class WeiboTask {
5
5
  taskName: string;
6
- key: string;
6
+ groupKey: string;
7
+ privateKey: string;
7
8
  e?: EventType;
8
9
  constructor(e?: any);
9
10
  runTask(): Promise<void>;
10
- processWeiboData(weiboPushData: any, uidMap: Map<any, any>, dynamicList: any): Promise<void>;
11
- pushDynamicMessages(uidMap: Map<any, any>, dynamicList: any, now: number, interval: number, weiboConfigData: any): Promise<void>;
11
+ processWeiboData(weiboPushData: any, uidMap: Map<any, Map<string, any>>, dynamicList: any): Promise<void>;
12
+ pushDynamicMessages(uidMap: Map<any, Map<string, any>>, dynamicList: any, now: number, interval: number, weiboConfigData: any): Promise<void>;
12
13
  sendDynamic(chatId: string | number, bot_id: string | number, upName: string, pushDynamicData: any, weiboConfigData: any, chatType: string): Promise<string>;
13
14
  buildRenderData(extentData: any, urlQrcodeData: string, boxGrid: boolean): MainProps;
14
15
  renderDynamicCard(uid: string | number, renderData: MainProps, ScreenshotOptionsData: ScreenshotOptions): Promise<Buffer[] | null>;
@@ -22,7 +22,7 @@ class YukiPuppeteerRender extends Puppeteer {
22
22
  if (Options?.header) {
23
23
  await page.setExtraHTTPHeaders(Options.header);
24
24
  }
25
- await page.goto(`file://${htmlPath}`, { timeout: Options?.timeout ?? 120000, waitUntil: ["load", "networkidle2"] });
25
+ await page.goto(`file://${htmlPath}`, { timeout: Options?.timeout ?? 120000, waitUntil: ["load", "networkidle0"] });
26
26
  const body = await page.$(Options?.tab ?? 'body');
27
27
  if (!body)
28
28
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yz-yuki-plugin",
3
- "version": "1.0.2",
3
+ "version": "1.0.3-rc.1",
4
4
  "description": "优纪插件,yunzaijs 关于 微博推送、B站推送 等功能的拓展插件",
5
5
  "author": "snowtafir",
6
6
  "type": "module",
@@ -21,19 +21,19 @@
21
21
  "format": "prettier --write ."
22
22
  },
23
23
  "dependencies": {
24
- "axios": "^1.7.2",
24
+ "axios": "^1.7.3",
25
25
  "chokidar": "^3.6.0",
26
- "jsdom": "^24.1.0",
26
+ "jsdom": "^24.1.1",
27
27
  "json5": "^2.2.3",
28
28
  "md5": "^2.3.0",
29
29
  "moment": "^2.30.1",
30
30
  "node-fetch": "^3.3.2",
31
- "puppeteer": "^22.14.0",
32
- "qrcode": "^1.5.3",
31
+ "puppeteer": "^23.0.2",
32
+ "qrcode": "^1.5.4",
33
33
  "react": "^18.3.1",
34
34
  "react-dom": "^18.3.1",
35
- "react-puppeteer": "1.0.0-rc.7",
36
- "redis": "^4.6.13",
35
+ "react-puppeteer": "1.0.2",
36
+ "redis": "^4.7.0",
37
37
  "yaml": "^2.5.0",
38
38
  "yarn": "^1.19.1"
39
39
  },
@@ -44,41 +44,41 @@
44
44
  "@rollup/plugin-node-resolve": "^15.2.3",
45
45
  "@rollup/plugin-replace": "^5.0.7",
46
46
  "@rollup/plugin-terser": "^0.4.4",
47
- "@rollup/plugin-typescript": "^11.1.3",
47
+ "@rollup/plugin-typescript": "^11.1.6",
48
+ "@types/rollup-plugin-auto-external": "^2.0.5",
48
49
  "@types/jsdom": "^21.1.7",
49
50
  "@types/lodash": "^4.17.7",
50
51
  "@types/md5": "^2.3.5",
51
- "@types/node": "^20.8.5",
52
+ "@types/node": "^22.2.0",
52
53
  "@types/node-fetch": "^2.6.11",
53
54
  "@types/qrcode": "^1.5.5",
54
55
  "@types/react": "^18.3.3",
55
56
  "@types/react-dom": "^18.3.0",
56
- "@types/rollup-plugin-auto-external": "^2.0.5",
57
57
  "@types/yaml": "1.9.7",
58
- "axios": "^1.7.2",
58
+ "axios": "^1.7.3",
59
59
  "chokidar": "^3.6.0",
60
- "jsdom": "^24.1.0",
60
+ "jsdom": "^24.1.1",
61
61
  "json5": "^2.2.3",
62
62
  "md5": "^2.3.0",
63
63
  "node-fetch": "^3.3.2",
64
- "nodemon": "^3.0.1",
65
- "prettier": "^3.2.5",
66
- "puppeteer": "^22.14.0",
67
- "qrcode": "^1.5.3",
64
+ "nodemon": "^3.1.4",
65
+ "prettier": "^3.3.3",
66
+ "puppeteer": "^23.0.2",
67
+ "qrcode": "^1.5.4",
68
68
  "react": "^18.3.1",
69
69
  "react-dom": "^18.3.1",
70
- "react-puppeteer": "1.0.0-rc.7",
71
- "redis": "^4.6.13",
72
- "rollup": "^4.16.4",
70
+ "react-puppeteer": "1.0.2",
71
+ "redis": "^4.7.0",
72
+ "rollup": "^4.20.0",
73
73
  "rollup-plugin-auto-external": "^2.0.0",
74
74
  "rollup-plugin-copy": "^3.5.0",
75
75
  "rollup-plugin-dts": "^6.1.1",
76
76
  "rollup-plugin-ignore": "^1.0.10",
77
- "tailwindcss": "^3.4.3",
77
+ "tailwindcss": "^3.4.9",
78
78
  "ts-node": "^10.9.2",
79
- "typescript": "^5.4.5",
80
- "yunzai": "^1.0.1-rc.2",
81
- "yunzai-mys": "^1.0.0-rc.0"
79
+ "typescript": "^5.5.4",
80
+ "yunzai": "^1.0.1-rc.5",
81
+ "yunzai-mys": "^1.0.0-rc.1"
82
82
  },
83
83
  "files": [
84
84
  "public",
package/public/output.css CHANGED
@@ -1 +1 @@
1
- /*! tailwindcss v3.4.7 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:initial;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:initial}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,::backdrop,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.m-auto{margin:auto}.mb-3{margin-bottom:.75rem}.ml-7{margin-left:1.75rem}.mt-3{margin-top:.75rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-72{height:18rem}.max-h-96{max-height:24rem}.w-32{width:8rem}.w-72{width:18rem}.w-96{width:24rem}.p-1{padding:.25rem}.p-5{padding:1.25rem}.text-center{text-align:center}.text-lg{font-size:1.125rem;line-height:1.75rem}.italic{font-style:italic}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}
1
+ /*! tailwindcss v3.4.10 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.m-auto{margin:auto}.mb-3{margin-bottom:.75rem}.ml-7{margin-left:1.75rem}.mt-3{margin-top:.75rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-72{height:18rem}.max-h-96{max-height:24rem}.w-32{width:8rem}.w-72{width:18rem}.w-96{width:24rem}.p-1{padding:.25rem}.p-5{padding:1.25rem}.text-center{text-align:center}.text-lg{font-size:1.125rem;line-height:1.75rem}.italic{font-style:italic}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}
@@ -1,10 +1,3 @@
1
- @font-face {
2
- font-family: "iconfont";
3
- src: url("./../../fonts/iconfont.16acc2.ttf");
4
- font-weight: normal;
5
- font-style: normal;
6
- }
7
-
8
1
  .content-text-title {
9
2
  margin-top: 10px;
10
3
  }
@@ -17,10 +10,6 @@
17
10
  padding-right: 20px;
18
11
  }
19
12
 
20
- .content-text {
21
- font-family: "iconfont", Arial, sans-serif;
22
- }
23
-
24
13
  .content img {
25
14
  max-width: 100%;
26
15
  height: auto;
@@ -1,10 +1,3 @@
1
- @font-face {
2
- font-family: "iconfont";
3
- src: url("./../../fonts/iconfont.16acc2.ttf");
4
- font-weight: normal;
5
- font-style: normal;
6
- }
7
-
8
1
  .footer {
9
2
  display: flex;
10
3
  justify-content: space-between;
@@ -31,7 +24,6 @@
31
24
  flex-direction: column;
32
25
  align-items: flex-start;
33
26
  font-size: 20px;
34
- font-family: "iconfont", Arial, sans-serif;
35
27
  }
36
28
 
37
29
  .bili-logo-0 {
@@ -19,14 +19,14 @@ body::-webkit-scrollbar {
19
19
  }
20
20
 
21
21
  @font-face {
22
- font-family: "iconfont";
23
- src: url("./../../fonts/iconfont.16acc2.ttf");
22
+ font-family: "OPSans";
23
+ src: url("./../../fonts/OPSans.woff2");
24
24
  font-weight: normal;
25
25
  font-style: normal;
26
26
  }
27
27
 
28
28
  body {
29
- font-family: "iconfont", Arial, sans-serif;
29
+ font-family: "OPSans", Arial, sans-serif;
30
30
  background-color: #f9f9f9;
31
31
  margin: 0;
32
32
  padding: 0;
@@ -19,8 +19,8 @@ body::-webkit-scrollbar {
19
19
  }
20
20
 
21
21
  @font-face {
22
- font-family: "iconfont";
23
- src: url("./../../fonts/iconfont.16acc2.ttf");
22
+ font-family: "OPSans";
23
+ src: url("./../../fonts/OPSans.woff2");
24
24
  font-weight: normal;
25
25
  font-style: normal;
26
26
  }
@@ -33,7 +33,7 @@ body::-webkit-scrollbar {
33
33
  }
34
34
 
35
35
  body {
36
- font-family: "iconfont";
36
+ font-family: "OPSans";
37
37
  font-size: 16px;
38
38
  color: #1e1f20;
39
39
  transform: scale(1.5);
@@ -50,7 +50,7 @@ body {
50
50
  }
51
51
 
52
52
  .head_box {
53
- font-family: "iconfont";
53
+ font-family: "OPSans";
54
54
  border-radius: 10px;
55
55
  padding: 10px 20px;
56
56
  position: relative;
@@ -178,5 +178,5 @@ body {
178
178
  text-align: center;
179
179
  font-size: 14px;
180
180
  color: rgb(0, 0, 0);
181
- font-family: "iconfont";
181
+ font-family: "OPSans";
182
182
  }
@@ -1,5 +1,13 @@
1
+ @font-face {
2
+ font-family: "OPSans";
3
+ src: url("./../../fonts/OPSans.woff2");
4
+ font-weight: normal;
5
+ font-style: normal;
6
+ }
7
+
1
8
  body {
2
9
  width: 563px !important;
10
+ font-family: "OPSans", Arial, sans-serif;
3
11
  }
4
12
 
5
13
  .container {
@@ -19,8 +19,8 @@ body::-webkit-scrollbar {
19
19
  }
20
20
 
21
21
  @font-face {
22
- font-family: "iconfont";
23
- src: url("./../../fonts/iconfont.16acc2.ttf");
22
+ font-family: "OPSans";
23
+ src: url("./../../fonts/OPSans.woff2");
24
24
  font-weight: normal;
25
25
  font-style: normal;
26
26
  }
@@ -34,7 +34,7 @@ body::-webkit-scrollbar {
34
34
 
35
35
  body {
36
36
  font-size: 16px;
37
- font-family: "iconfont";
37
+ font-family: "OPSans", Arial, sans-serif;
38
38
  transform: scale(1.5);
39
39
  transform-origin: 0 0;
40
40
  color: white;
@@ -78,7 +78,7 @@ body {
78
78
  padding: 10px 15px;
79
79
  font-size: 12px;
80
80
  font-weight: normal;
81
- font-family: "iconfont";
81
+ font-family: "OPSans";
82
82
  background: transparent;
83
83
  color: rgba(0, 0, 0);
84
84
  }
@@ -112,5 +112,5 @@ body {
112
112
  text-align: center;
113
113
  font-size: 14px;
114
114
  color: rgb(15, 15, 15);
115
- font-family: 'iconfont';
116
- }
115
+ font-family: 'OPSans';
116
+ }
Binary file
Binary file
Binary file