yz-yuki-plugin 2.0.6-1 → 2.0.6-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/.puppeteerrc.cjs CHANGED
@@ -1,4 +1,44 @@
1
+ const os = require('os');
2
+ const { existsSync } = require('fs');
3
+ const { execSync } = require('child_process');
4
+ const arch = os.arch();
5
+
6
+ let skipDownload = false;
7
+ let executablePath;
8
+
9
+ if (['linux', 'android'].includes(process.platform))
10
+ for (const item of ['chromium', 'chromium-browser', 'chrome', 'google-chrome'])
11
+ try {
12
+ const chromiumPath = execSync(`command -v ${item}`).toString().trim();
13
+ if (chromiumPath && existsSync(chromiumPath)) {
14
+ executablePath = chromiumPath;
15
+ break;
16
+ }
17
+ } catch (err) {}
18
+
19
+ /**
20
+ * @type {string} 浏览器 "可执行文件路径" 列表,可根据需要自行修改或添加
21
+ */
22
+ if (!executablePath)
23
+ for (const item of [
24
+ // Windows
25
+ 'C:/Program Files/Google/Chrome/Application/chrome.exe',
26
+ 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe',
27
+ // macOS
28
+ '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
29
+ '/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge'
30
+ ])
31
+ if (existsSync(item)) {
32
+ executablePath = item;
33
+ break;
34
+ }
35
+
36
+ if (executablePath || arch == 'arm64' || arch == 'aarch64') {
37
+ (typeof logger != 'undefined' ? logger : console).info(`[Chromium] ${executablePath}`);
38
+ skipDownload = true;
39
+ }
40
+
1
41
  /**
2
42
  * @type {import("puppeteer").Configuration}
3
43
  */
4
- module.exports = require('jsxp/.puppeteerrc');
44
+ module.exports = { skipDownload, executablePath };
package/README.md CHANGED
@@ -8,6 +8,29 @@
8
8
 
9
9
  [![访问量](https://profile-counter.glitch.me/yuki-plugin/count.svg)](https://github.com/snowtafir/yuki-plugin)
10
10
 
11
+
12
+ # 🚩运行环境:
13
+ 1. 系统:
14
+ * windows 10/11+,
15
+ * Linux推荐:Ubuntu 24.04.1 LTS+, CentOS Stream 8 +, Debian 12+, Fedora 35+
16
+
17
+ 2. node v22+ 下载地址:https://nodejs.org/zh-cn/download/
18
+
19
+ 3. 推荐使用chrome或chromium浏览器,其他浏览器可能存在兼容性问题。
20
+ * chrome 浏览器 v131+ win_x64下载地址:https://www.google.cn/chrome/
21
+ * chromium 浏览器 v128+ Linux/win手动下载安装:https://download-chromium.appspot.com
22
+
23
+ > linux命令行安装chromiun浏览器:
24
+ ```sh
25
+ sudo apt-get install chromium-browser # Ubuntu/Debian
26
+ sudo dnf install chromium # Fedora
27
+ sudo yum install chromium # CentOS Stream 8
28
+
29
+ #查看版本
30
+ chromium-browser --version
31
+ ```
32
+ > 注意,如果windows下手动安装chromium浏览器,或安装了其他修改版chrome浏览器,出现找不到浏览器,需要手动将`可执行文件路径`添加到 [./.puppeteerrc.cjs](./.puppeteerrc.cjs) 的路径列表中。
33
+
11
34
  # 🌰一、安装插件
12
35
 
13
36
  ## 选择安装方式
package/lib/apps/weibo.js CHANGED
@@ -58,7 +58,7 @@ message.use(async (e) => {
58
58
  }
59
59
  const userInfo = data.userInfo || {};
60
60
  let name = uid;
61
- if (userInfo && userInfo.length !== 0) {
61
+ if (userInfo.length !== 0) {
62
62
  name = userInfo.screen_name || uid;
63
63
  }
64
64
  // 添加新的推送数据
@@ -216,8 +216,9 @@ class BiliTask {
216
216
  if (dynamicMsg === undefined || dynamicMsg === 'continue') {
217
217
  return 'return'; // 如果动态消息构建失败,则直接返回
218
218
  }
219
- if (biliConfigData.banWords.length > 0) {
220
- const banWords = new RegExp(biliConfigData.banWords.join('|'), 'g'); // 构建屏蔽关键字正则表达式
219
+ const getBanWords = biliConfigData?.banWords;
220
+ if (getBanWords && Array.isArray(getBanWords) && getBanWords.length > 0) {
221
+ const banWords = new RegExp(getBanWords.join('|'), 'g'); // 构建屏蔽关键字正则表达式
221
222
  if (banWords.test(dynamicMsg.msg.join(''))) {
222
223
  return 'return'; // 如果动态消息包含屏蔽关键字,则直接返回
223
224
  }
@@ -183,8 +183,9 @@ class WeiboTask {
183
183
  if (dynamicMsg === undefined || dynamicMsg === 'continue') {
184
184
  return 'return'; // 如果动态消息构建失败或内部资源获取失败,则直接返回
185
185
  }
186
- if (weiboConfigData.banWords.length > 0) {
187
- const banWords = new RegExp(weiboConfigData.banWords.join('|'), 'g'); // 构建屏蔽关键字正则表达式
186
+ const getBanWords = weiboConfigData?.banWords;
187
+ if (getBanWords && Array.isArray(getBanWords) && getBanWords.length > 0) {
188
+ const banWords = new RegExp(getBanWords.join('|'), 'g'); // 构建屏蔽关键字正则表达式
188
189
  if (banWords.test(dynamicMsg.msg.join(''))) {
189
190
  return 'return'; // 如果动态消息包含屏蔽关键字,则直接返回
190
191
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yz-yuki-plugin",
3
- "version": "2.0.6-1",
3
+ "version": "2.0.6-3",
4
4
  "description": "优纪插件,yunzaijs 关于 微博推送、B站推送 等功能的拓展插件",
5
5
  "author": "snowtafir",
6
6
  "type": "module",
@@ -31,12 +31,12 @@
31
31
  "debug": "^4.3.6",
32
32
  "jsdom": "^25.0.1",
33
33
  "json5": "^2.2.3",
34
- "jsxp": "^1.0.4",
34
+ "jsxp": "^1.0.8",
35
35
  "lodash": "^4.17.21",
36
36
  "md5": "^2.3.0",
37
37
  "moment": "^2.30.1",
38
38
  "node-fetch": "^3.3.2",
39
- "puppeteer": "^23.10.1",
39
+ "puppeteer": "^23.11.1",
40
40
  "qrcode": "^1.5.4",
41
41
  "react": "^18.3.1",
42
42
  "react-dom": "^18.3.1",
@@ -62,21 +62,21 @@
62
62
  "husky": "^9.1.6",
63
63
  "jsdom": "^24.1.1",
64
64
  "json5": "^2.2.3",
65
- "jsxp": "^1.0.4",
65
+ "jsxp": "^1.0.8",
66
66
  "lodash": "^4.17.21",
67
- "lvyjs": "^0.2.6",
67
+ "lvyjs": "^0.2.14",
68
68
  "md5": "^2.3.0",
69
69
  "node-fetch": "^3.3.2",
70
70
  "postcss": "^8.4.47",
71
71
  "prettier": "^3.4.2",
72
- "puppeteer": "^23.10.1",
72
+ "puppeteer": "^23.11.1",
73
73
  "qrcode": "^1.5.4",
74
74
  "react": "^18.3.1",
75
75
  "react-dom": "^18.3.1",
76
76
  "redis": "^4.7.0",
77
77
  "tailwindcss": "^3.4.14",
78
78
  "ts-node": "^10.9.2",
79
- "tsx": "^4.19.0",
79
+ "tsx": "^4.19.2",
80
80
  "typescript": "^5.5.4",
81
81
  "yaml": "^2.6.1",
82
82
  "yunzaijs": "^1.0.0-rc.5"