yz-yuki-plugin 2.0.5-1 → 2.0.5-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 +1 -1
- package/README.md +15 -21
- package/defaultConfig/help/help.yaml +2 -2
- package/lib/apps/bilibili.js +2 -2
- package/lib/apps/help.js +1 -1
- package/lib/apps/version.js +1 -1
- package/lib/apps/weibo.js +1 -1
- package/lib/components/dynamic/Footer.js +1 -1
- package/lib/components/help/Help.js +1 -1
- package/lib/components/version/Version.js +1 -1
- package/lib/index.js +1 -1
- package/lib/main.js +11 -0
- package/lib/models/bilibili/bilibili.buid.fp.js +77 -0
- package/lib/models/bilibili/bilibili.models.js +55 -43
- package/lib/models/bilibili/bilibili.query.js +1 -1
- package/lib/models/bilibili/bilibili.task.js +1 -1
- package/lib/models/weibo/weibo.get.web.data.js +1 -1
- package/lib/models/weibo/weibo.query.js +1 -1
- package/lib/models/weibo/weibo.task.js +1 -1
- package/lib/utils/config.js +3 -3
- package/lib/utils/image.js +4 -4
- package/package.json +16 -33
- package/lib/apps/bilibili.d.ts +0 -6
- package/lib/apps/help.d.ts +0 -6
- package/lib/apps/index.d.ts +0 -4
- package/lib/apps/version.d.ts +0 -6
- package/lib/apps/weibo.d.ts +0 -6
- package/lib/components/dynamic/Account.d.ts +0 -13
- package/lib/components/dynamic/Content.d.ts +0 -12
- package/lib/components/dynamic/Footer.d.ts +0 -11
- package/lib/components/dynamic/ForwardContent.d.ts +0 -6
- package/lib/components/dynamic/LogoText.d.ts +0 -9
- package/lib/components/dynamic/MainPage.d.ts +0 -34
- package/lib/components/help/Help.d.ts +0 -12
- package/lib/components/index.d.ts +0 -5
- package/lib/components/loginQrcode/Page.d.ts +0 -7
- package/lib/components/version/Version.d.ts +0 -8
- package/lib/index.d.ts +0 -5
- package/lib/main.d.ts +0 -1
- package/lib/models/bilibili/bilibili.api.d.ts +0 -70
- package/lib/models/bilibili/bilibili.buid.fp.d.ts +0 -2
- package/lib/models/bilibili/bilibili.get.web.data.d.ts +0 -9
- package/lib/models/bilibili/bilibili.models.d.ts +0 -63
- package/lib/models/bilibili/bilibili.query.d.ts +0 -49
- package/lib/models/bilibili/bilibili.task.d.ts +0 -77
- package/lib/models/bilibili/bilibili.ticket.d.ts +0 -12
- package/lib/models/bilibili/bilibili.wbi.d.ts +0 -11
- package/lib/models/help/help.d.ts +0 -8
- package/lib/models/version/version.d.ts +0 -17
- package/lib/models/weibo/weibo.api.d.ts +0 -18
- package/lib/models/weibo/weibo.get.web.data.d.ts +0 -11
- package/lib/models/weibo/weibo.query.d.ts +0 -38
- package/lib/models/weibo/weibo.task.d.ts +0 -84
- package/lib/utils/config.d.ts +0 -73
- package/lib/utils/image.d.ts +0 -15
- package/lib/utils/paths.d.ts +0 -22
- package/lib/utils/puppeteer.render.d.ts +0 -40
- package/public/output.css +0 -1
- package/resources/img/readme/mini-help.jpg +0 -0
package/.puppeteerrc.cjs
CHANGED
package/README.md
CHANGED
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
# 🌰一、安装插件
|
|
12
12
|
|
|
13
13
|
## 选择安装方式
|
|
14
|
-
按照网络情况以及使用的bot框架是`
|
|
14
|
+
按照网络情况以及使用的bot框架是`Yunzaijs`还是`Yunzai-V3`,选择对应的安装方式。
|
|
15
15
|
|
|
16
|
-
### ***(一)
|
|
16
|
+
### ***(一)YunzaiJS***
|
|
17
17
|
> 选择其中一种方式安装插件:
|
|
18
18
|
|
|
19
|
-
1. npm包安装到`
|
|
19
|
+
1. npm包安装到`yunzaijs/node_modules`的方式,仅Yunzai-Next支持:
|
|
20
20
|
```
|
|
21
21
|
yarn add yz-yuki-plugin -W
|
|
22
22
|
```
|
|
@@ -25,26 +25,26 @@
|
|
|
25
25
|
|
|
26
26
|
* 方式1(推荐):
|
|
27
27
|
|
|
28
|
-
手动新建 `
|
|
28
|
+
手动新建 `yunzaijs/yunzai.config.json` 文件,输入如下内容,`applications`字段添加的 `"yz-yuki-plugin"`即为启用本插件:
|
|
29
29
|
|
|
30
30
|
```json
|
|
31
31
|
{
|
|
32
|
-
"applications": ["
|
|
33
|
-
"middlewares": ["
|
|
32
|
+
"applications": ["@yunzaijs/system", "yz-yuki-plugin"],
|
|
33
|
+
"middlewares": ["@yunzaijs/mys/message", "@yunzaijs/mys/runtime"]
|
|
34
34
|
}
|
|
35
35
|
```
|
|
36
36
|
* 方式2:
|
|
37
37
|
|
|
38
|
-
修改 `
|
|
38
|
+
修改 `yunzaijs/yunzai.config.js`:
|
|
39
39
|
```js
|
|
40
|
-
import { defineConfig } from '
|
|
40
|
+
import { defineConfig } from 'yunzaijs'
|
|
41
41
|
export default defineConfig({
|
|
42
|
-
applications: [
|
|
43
|
-
middlewares: [
|
|
42
|
+
applications: ["@yunzaijs/system", "yz-yuki-plugin"], //该行添加 'yz-yuki-plugin'
|
|
43
|
+
middlewares: ["@yunzaijs/mys/message", "@yunzaijs/mys/runtime"]
|
|
44
44
|
})
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
2. 安装到 `
|
|
47
|
+
2. 安装到 `yunzaijs/plugins` 的方式:
|
|
48
48
|
|
|
49
49
|
> 仅支持Yunzai-Next的分支,选择仓库:
|
|
50
50
|
|
|
@@ -179,14 +179,8 @@ https://m.weibo.cn/u/7643376782 # 7643376782 为崩坏星穹铁道博主uid
|
|
|
179
179
|
||||
|
|
180
180
|
| **其他指令** | | |
|
|
181
181
|
| 查看版本信息 | 查看版本信息 | `#优纪版本` |
|
|
182
|
-
| 更新yuki插件 | 系统指令更新yuki插件,
|
|
183
|
-
| 强制更新yuki插件 | 强制更新yuki插件,
|
|
184
|
-
|
|
185
|
-
</details>
|
|
186
|
-
|
|
187
|
-
<details><summary>样式预览,点击展开</summary>
|
|
188
|
-
|
|
189
|
-

|
|
182
|
+
| 更新yuki插件 | 系统指令更新yuki插件,yunzaiJS需安装`@yunzaijs/system` | `#更新yuki-plugin` |
|
|
183
|
+
| 强制更新yuki插件 | 强制更新yuki插件,yunzaiJS需安装`@yunzaijs/system`| `#强制更新yuki-plugin` |
|
|
190
184
|
|
|
191
185
|
</details>
|
|
192
186
|
|
|
@@ -229,8 +223,8 @@ yarn install
|
|
|
229
223
|
| Nickname | Contribution |
|
|
230
224
|
| :-----------------------------------------------------------------: | ----------------------- |
|
|
231
225
|
|Yunzai-Next||
|
|
232
|
-
| [
|
|
233
|
-
| [
|
|
226
|
+
| [YunzaiJS文档](https://yunzaijs.github.io/docs/) | YunzaiJS 文档 |
|
|
227
|
+
| [YunzaiJS 仓库](https://github.com/yunzaijs/core) | YunzaiJS |
|
|
234
228
|
|Yunzai-V3||
|
|
235
229
|
| [功能/插件库](https://gitee.com/yhArcadia/Yunzai-Bot-plugins-index) | Yunzai-Bot 相关内容索引 |
|
|
236
230
|
| [TRSS-Yunzai](https://gitee.com/TimeRainStarSky/Yunzai) | 时雨🌌星空的 TRSS-Yunzai |
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
desc: 查看版本信息
|
|
81
81
|
- icon: 钓鱼
|
|
82
82
|
title: '#更新yuki-plugin'
|
|
83
|
-
desc: '系统指令更新yuki插件,
|
|
83
|
+
desc: '系统指令更新yuki插件,yunzaiJS需安装`@yunzaijs/system`'
|
|
84
84
|
- icon: pluie_lotus
|
|
85
85
|
title: '#强制更新yuki-plugin'
|
|
86
|
-
desc: '强制更新yuki插件,
|
|
86
|
+
desc: '强制更新yuki插件,yunzaiJS需安装`@yunzaijs/system`'
|
package/lib/apps/bilibili.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import JSON from 'json5';
|
|
2
2
|
import lodash from 'lodash';
|
|
3
|
-
import { Messages, Bot, Redis } from '
|
|
3
|
+
import { Messages, Bot, Redis } from 'yunzaijs';
|
|
4
4
|
import { BiliQuery } from '../models/bilibili/bilibili.query.js';
|
|
5
5
|
import { BiliTask } from '../models/bilibili/bilibili.task.js';
|
|
6
6
|
import Config from '../utils/config.js';
|
|
@@ -205,7 +205,7 @@ message.use(async (e) => {
|
|
|
205
205
|
if (e.isMaster) {
|
|
206
206
|
await exitBiliLogin(e);
|
|
207
207
|
await Redis.set('Yz:yuki:bili:loginCookie', '', { EX: 3600 * 24 * 180 });
|
|
208
|
-
e.reply(
|
|
208
|
+
e.reply(`扫码登陆的B站cookie已删除~`);
|
|
209
209
|
}
|
|
210
210
|
else {
|
|
211
211
|
e.reply('未取得bot主人身份,无权限删除B站登录ck');
|
package/lib/apps/help.js
CHANGED
package/lib/apps/version.js
CHANGED
package/lib/apps/weibo.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ConfigController, BOT_NAME } from '
|
|
2
|
+
import { ConfigController, BOT_NAME } from 'yunzaijs';
|
|
3
3
|
import Config from '../../utils/config.js';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import { _paths, createRequire } from '../../utils/paths.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BOT_NAME, ConfigController } from '
|
|
2
|
+
import { BOT_NAME, ConfigController } from 'yunzaijs';
|
|
3
3
|
import Config from '../../utils/config.js';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import { _paths, createRequire } from '../../utils/paths.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BOT_NAME, ConfigController } from '
|
|
2
|
+
import { BOT_NAME, ConfigController } from 'yunzaijs';
|
|
3
3
|
import Config from '../../utils/config.js';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import { _paths, createRequire } from '../../utils/paths.js';
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import { applicationOptions, setBotTask, useEvent } from '
|
|
2
|
+
import { applicationOptions, setBotTask, useEvent } from 'yunzaijs';
|
|
3
3
|
import Config from './utils/config.js';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import { _paths } from './utils/paths.js';
|
package/lib/main.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
class Murmur3 {
|
|
2
|
+
static MOD = 1n << 64n;
|
|
3
|
+
static C1 = 0x87c37b91114253d5n;
|
|
4
|
+
static C2 = 0x4cf5ad432745937fn;
|
|
5
|
+
static C3 = 0x52dce729n;
|
|
6
|
+
static C4 = 0x38495ab5n;
|
|
7
|
+
static R1 = 27n;
|
|
8
|
+
static R2 = 31n;
|
|
9
|
+
static R3 = 33n;
|
|
10
|
+
static M = 5n;
|
|
11
|
+
static hash(source, seed) {
|
|
12
|
+
let h1 = BigInt(seed);
|
|
13
|
+
let h2 = BigInt(seed);
|
|
14
|
+
let processed = 0;
|
|
15
|
+
for (let i = 0; i < source.length; i += 16) {
|
|
16
|
+
const chunk = source.slice(i, i + 16);
|
|
17
|
+
processed += chunk.length;
|
|
18
|
+
if (chunk.length === 16) {
|
|
19
|
+
const k1 = BigInt(chunk.slice(0, 8).reduce((acc, val, idx) => acc | (BigInt(val) << BigInt(8 * idx)), 0n));
|
|
20
|
+
const k2 = BigInt(chunk.slice(8).reduce((acc, val, idx) => acc | (BigInt(val) << BigInt(8 * idx)), 0n));
|
|
21
|
+
h1 ^= (Murmur3.rotateLeft((k1 * Murmur3.C1) % Murmur3.MOD, Murmur3.R2) * Murmur3.C2) % Murmur3.MOD;
|
|
22
|
+
h1 = ((Murmur3.rotateLeft(h1, Murmur3.R1) + h2) * Murmur3.M + Murmur3.C3) % Murmur3.MOD;
|
|
23
|
+
h2 ^= (Murmur3.rotateLeft((k2 * Murmur3.C2) % Murmur3.MOD, Murmur3.R3) * Murmur3.C1) % Murmur3.MOD;
|
|
24
|
+
h2 = ((Murmur3.rotateLeft(h2, Murmur3.R2) + h1) * Murmur3.M + Murmur3.C4) % Murmur3.MOD;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
let k1 = 0n;
|
|
28
|
+
let k2 = 0n;
|
|
29
|
+
for (let j = 0; j < chunk.length; j++) {
|
|
30
|
+
const byteVal = BigInt(chunk[j]);
|
|
31
|
+
if (j < 8) {
|
|
32
|
+
k1 |= byteVal << BigInt(8 * j);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
k2 |= byteVal << BigInt(8 * (j - 8));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
k1 = (Murmur3.rotateLeft((k1 * Murmur3.C1) % Murmur3.MOD, Murmur3.R2) * Murmur3.C2) % Murmur3.MOD;
|
|
39
|
+
h1 ^= k1;
|
|
40
|
+
h2 ^= (Murmur3.rotateLeft((k2 * Murmur3.C2) % Murmur3.MOD, Murmur3.R3) * Murmur3.C1) % Murmur3.MOD;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
h1 ^= BigInt(processed);
|
|
44
|
+
h2 ^= BigInt(processed);
|
|
45
|
+
h1 = (h1 + h2) % Murmur3.MOD;
|
|
46
|
+
h2 = (h2 + h1) % Murmur3.MOD;
|
|
47
|
+
h1 = Murmur3.fmix64(h1);
|
|
48
|
+
h2 = Murmur3.fmix64(h2);
|
|
49
|
+
h1 = (h1 + h2) % Murmur3.MOD;
|
|
50
|
+
h2 = (h2 + h1) % Murmur3.MOD;
|
|
51
|
+
return (h2 << BigInt(64)) | h1;
|
|
52
|
+
}
|
|
53
|
+
static rotateLeft(x, k) {
|
|
54
|
+
const index = Number(k);
|
|
55
|
+
const binStr = x.toString(2).padStart(64, '0');
|
|
56
|
+
return BigInt(`0b${binStr.slice(index)}${binStr.slice(0, index)}`);
|
|
57
|
+
}
|
|
58
|
+
static fmix64(k) {
|
|
59
|
+
const C1 = 0xff51afd7ed558ccdn;
|
|
60
|
+
const C2 = 0xc4ceb9fe1a85ec53n;
|
|
61
|
+
const R = 33;
|
|
62
|
+
let tmp = k;
|
|
63
|
+
tmp ^= tmp >> BigInt(R);
|
|
64
|
+
tmp = (tmp * C1) % Murmur3.MOD;
|
|
65
|
+
tmp ^= tmp >> BigInt(R);
|
|
66
|
+
tmp = (tmp * C2) % Murmur3.MOD;
|
|
67
|
+
tmp ^= tmp >> BigInt(R);
|
|
68
|
+
return tmp;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function gen_buvid_fp(uuid, seed) {
|
|
72
|
+
const source = new TextEncoder().encode(uuid);
|
|
73
|
+
const m = Murmur3.hash(source, seed);
|
|
74
|
+
return `${(m & (Murmur3.MOD - 1n)).toString(16)}${(m >> 64n).toString(16)}`;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export { gen_buvid_fp };
|
|
@@ -6,10 +6,11 @@ import { promisify } from 'node:util';
|
|
|
6
6
|
import path from 'path';
|
|
7
7
|
import QRCode from 'qrcode';
|
|
8
8
|
import YAML from 'yaml';
|
|
9
|
-
import { Segment, Bot, Redis } from '
|
|
9
|
+
import { Segment, Bot, Redis } from 'yunzaijs';
|
|
10
10
|
import { renderPage } from '../../utils/image.js';
|
|
11
11
|
import { _paths } from '../../utils/paths.js';
|
|
12
12
|
import { BiliApi } from './bilibili.api.js';
|
|
13
|
+
import { gen_buvid_fp } from './bilibili.buid.fp.js';
|
|
13
14
|
import { getBiliTicket } from './bilibili.ticket.js';
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -60,8 +61,8 @@ async function applyLoginQRCode(e) {
|
|
|
60
61
|
return qrcodeKey;
|
|
61
62
|
}
|
|
62
63
|
else {
|
|
63
|
-
e.reply(`获取B站登录二维码失败: ${res.data
|
|
64
|
-
throw new Error(`获取B站登录二维码失败: ${res.data
|
|
64
|
+
e.reply(`获取B站登录二维码失败: ${res.data?.message}`);
|
|
65
|
+
throw new Error(`获取B站登录二维码失败: ${res.data?.message}`);
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
/**处理扫码结果 */
|
|
@@ -149,12 +150,16 @@ async function exitBiliLogin(e) {
|
|
|
149
150
|
e.reply('当前无可用的B站登录CK可退出登录');
|
|
150
151
|
return;
|
|
151
152
|
}
|
|
152
|
-
const postData =
|
|
153
|
+
const postData = String(biliCSRF)
|
|
154
|
+
.trim()
|
|
155
|
+
.replace(/^bili_jct=/g, '')
|
|
156
|
+
.replace(/;*$/g, '');
|
|
153
157
|
try {
|
|
154
|
-
const resp = await axios.post(url, postData
|
|
158
|
+
const resp = await axios.post(url, { biliCSRF: postData }, {
|
|
155
159
|
headers: {
|
|
156
160
|
'Host': 'passport.bilibili.com',
|
|
157
|
-
'
|
|
161
|
+
'User-Agent': BiliApi.BILIBILI_HEADERS['User-Agent'],
|
|
162
|
+
'Cookie': `${DedeUserID};${biliCSRF};${SESSDATA}`,
|
|
158
163
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
159
164
|
}
|
|
160
165
|
});
|
|
@@ -163,29 +168,27 @@ async function exitBiliLogin(e) {
|
|
|
163
168
|
e.reply('当前缓存的B站登录CK早已失效!');
|
|
164
169
|
return;
|
|
165
170
|
}
|
|
166
|
-
const
|
|
167
|
-
logger.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
else {
|
|
183
|
-
e.reply('服务器响应异常,退出登录请求出错');
|
|
171
|
+
const res = resp.data;
|
|
172
|
+
logger?.debug(`exitBiliLogin: ${JSON.stringify(res)}`);
|
|
173
|
+
const { code } = res;
|
|
174
|
+
switch (code) {
|
|
175
|
+
case 0:
|
|
176
|
+
e.reply('当前缓存的B站登录CK已在B站服务器退出登录~');
|
|
177
|
+
break;
|
|
178
|
+
case 2202:
|
|
179
|
+
e.reply('csrf 请求非法,退出登录请求出错');
|
|
180
|
+
break;
|
|
181
|
+
case -101:
|
|
182
|
+
e.reply('当前缓存的扫码B站ck未登录!');
|
|
183
|
+
break;
|
|
184
|
+
default:
|
|
185
|
+
e.reply('未知情况!无妨');
|
|
186
|
+
return;
|
|
184
187
|
}
|
|
185
188
|
}
|
|
186
189
|
catch (error) {
|
|
190
|
+
e.reply('退出登录请求出错');
|
|
187
191
|
console.error('Error during Bili login exit:', error);
|
|
188
|
-
e.reply('退出登录请求出错,请稍后再试');
|
|
189
192
|
}
|
|
190
193
|
}
|
|
191
194
|
/**
|
|
@@ -397,18 +400,18 @@ async function getPayload(cookie) {
|
|
|
397
400
|
'7003': 1, // indexedDb, !!window.indexedDB, html5 api
|
|
398
401
|
'807e': 1, // cookieEnabled, navigator.cookieEnabled
|
|
399
402
|
'b8ce': BiliApi.BILIBILI_HEADERS['User-Agent'], // ua "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0",
|
|
400
|
-
'641c': 0,
|
|
401
|
-
'07a4': 'zh-CN',
|
|
402
|
-
'1c57': 'not available',
|
|
403
|
-
'0bd0': 16,
|
|
404
|
-
'748e': [1920, 1200],
|
|
405
|
-
'd61f': [1920, 1152],
|
|
406
|
-
'fc9d': -480,
|
|
407
|
-
'6aa9': 'Asia/Shanghai',
|
|
408
|
-
'75b8': 1,
|
|
409
|
-
'3b21': 1,
|
|
410
|
-
'8a1c': 0,
|
|
411
|
-
'd52f': 'not available',
|
|
403
|
+
'641c': 0, // webdriver, navigator.webdriver, like Selenium
|
|
404
|
+
'07a4': 'zh-CN', // language
|
|
405
|
+
'1c57': 'not available', // deviceMemory in GB, navigator.deviceMemory
|
|
406
|
+
'0bd0': 16, // hardwareConcurrency, navigator.hardwareConcurrency
|
|
407
|
+
'748e': [1920, 1200], // window.screen.width window.screen.height
|
|
408
|
+
'd61f': [1920, 1152], // window.screen.availWidth window.screen.availHeight
|
|
409
|
+
'fc9d': -480, // timezoneOffset, (new Date).getTimezoneOffset()
|
|
410
|
+
'6aa9': 'Asia/Shanghai', //Intl.DateTimeFormat().resolvedOptions().timeZone, // timezone, (new window.Intl.DateTimeFormat).resolvedOptions().timeZone
|
|
411
|
+
'75b8': 1, // sessionStorage, window.sessionStorage, html5 api
|
|
412
|
+
'3b21': 1, // localStorage, window.localStorage, html5 api
|
|
413
|
+
'8a1c': 0, // openDatabase, window.openDatabase, html5 api
|
|
414
|
+
'd52f': 'not available', // cpuClass, navigator.cpuClass
|
|
412
415
|
'adca': BiliApi.BILIBILI_HEADERS['User-Agent'].includes('Windows') ? 'Win32' : 'Linux', // platform, navigator.platform
|
|
413
416
|
'80c9': [
|
|
414
417
|
[
|
|
@@ -451,9 +454,9 @@ async function getPayload(cookie) {
|
|
|
451
454
|
['text/pdf', 'pdf']
|
|
452
455
|
]
|
|
453
456
|
]
|
|
454
|
-
],
|
|
455
|
-
'13ab': 'f3YAAAAASUVORK5CYII=',
|
|
456
|
-
'bfe9': 'kABYpRAGAVYzWJooB9Bf4P+UortSvxRY0AAAAASUVORK5CYII=',
|
|
457
|
+
], // plugins
|
|
458
|
+
'13ab': 'f3YAAAAASUVORK5CYII=', // canvas fingerprint
|
|
459
|
+
'bfe9': 'kABYpRAGAVYzWJooB9Bf4P+UortSvxRY0AAAAASUVORK5CYII=', // webgl_str
|
|
457
460
|
'a3c1': [
|
|
458
461
|
'extensions:ANGLE_instanced_arrays;EXT_blend_minmax;EXT_color_buffer_half_float;EXT_float_blend;EXT_frag_depth;EXT_shader_texture_lod;EXT_sRGB;EXT_texture_compression_bptc;EXT_texture_compression_rgtc;EXT_texture_filter_anisotropic;OES_element_index_uint;OES_fbo_render_mipmap;OES_standard_derivatives;OES_texture_float;OES_texture_float_linear;OES_texture_half_float;OES_texture_half_float_linear;OES_vertex_array_object;WEBGL_color_buffer_float;WEBGL_compressed_texture_s3tc;WEBGL_compressed_texture_s3tc_srgb;WEBGL_debug_renderer_info;WEBGL_debug_shaders;WEBGL_depth_texture;WEBGL_draw_buffers;WEBGL_lose_context;WEBGL_provoking_vertex',
|
|
459
462
|
'webgl aliased line width range:[1, 1]',
|
|
@@ -519,8 +522,8 @@ async function getPayload(cookie) {
|
|
|
519
522
|
'webgl fragment shader low int precision:0',
|
|
520
523
|
'webgl fragment shader low int precision rangeMin:31',
|
|
521
524
|
'webgl fragment shader low int precision rangeMax:30'
|
|
522
|
-
],
|
|
523
|
-
'6bc5': 'Google Inc. (Intel)~ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0), or similar',
|
|
525
|
+
], // webgl_params, cab be set to [] if webgl is not supported
|
|
526
|
+
'6bc5': 'Google Inc. (Intel)~ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0), or similar', // webglVendorAndRenderer
|
|
524
527
|
'ed31': 0,
|
|
525
528
|
'72bd': 0,
|
|
526
529
|
'097b': 0,
|
|
@@ -604,6 +607,15 @@ async function postGateway(cookie) {
|
|
|
604
607
|
throw error;
|
|
605
608
|
}
|
|
606
609
|
}
|
|
610
|
+
/**生成buvid_fp
|
|
611
|
+
* @param {string} uuid
|
|
612
|
+
*/
|
|
613
|
+
async function get_buvid_fp(cookie) {
|
|
614
|
+
const uuid = await readSavedCookieItems(cookie, ['_uuid'], false);
|
|
615
|
+
const seedget = Math.floor(Math.random() * (60 - 1 + 1) + 1);
|
|
616
|
+
let buvidFp = gen_buvid_fp(uuid, seedget);
|
|
617
|
+
return `buvid_fp=${buvidFp};`;
|
|
618
|
+
}
|
|
607
619
|
/**
|
|
608
620
|
* 获取有效bili_ticket并添加到cookie
|
|
609
621
|
* @param {string} cookie
|
|
@@ -630,4 +642,4 @@ async function cookieWithBiliTicket(cookie) {
|
|
|
630
642
|
}
|
|
631
643
|
}
|
|
632
644
|
|
|
633
|
-
export { applyLoginQRCode, checkBiliLogin, cookieWithBiliTicket, exitBiliLogin, genUUID, gen_b_lsid, getNewTempCk, pollLoginQRCode, postGateway, readSavedCookieItems, readSavedCookieOtherItems, readSyncCookie, readTempCk, saveLocalBiliCk, saveLoginCookie, saveTempCk };
|
|
645
|
+
export { applyLoginQRCode, checkBiliLogin, cookieWithBiliTicket, exitBiliLogin, genUUID, gen_b_lsid, getNewTempCk, get_buvid_fp, pollLoginQRCode, postGateway, readSavedCookieItems, readSavedCookieOtherItems, readSyncCookie, readTempCk, saveLocalBiliCk, saveLoginCookie, saveTempCk };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import QRCode from 'qrcode';
|
|
2
|
-
import { Redis, Bot, Segment } from '
|
|
2
|
+
import { Redis, Bot, Segment } from 'yunzaijs';
|
|
3
3
|
import Config from '../../utils/config.js';
|
|
4
4
|
import { renderPage } from '../../utils/image.js';
|
|
5
5
|
import { BiliGetWebData } from './bilibili.get.web.data.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import QRCode from 'qrcode';
|
|
2
|
-
import { Redis, Bot, Segment } from '
|
|
2
|
+
import { Redis, Bot, Segment } from 'yunzaijs';
|
|
3
3
|
import Config from '../../utils/config.js';
|
|
4
4
|
import { renderPage } from '../../utils/image.js';
|
|
5
5
|
import { WeiboGetWebData } from './weibo.get.web.data.js';
|
package/lib/utils/config.js
CHANGED
|
@@ -61,7 +61,7 @@ class Config {
|
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* 通用获取配置文件数据方法
|
|
64
|
-
* @param typeDir 配置文件目录类型对应路径 defaultConfig: defaultConfig 或 config:
|
|
64
|
+
* @param typeDir 配置文件目录类型对应路径 defaultConfig: defaultConfig 或 config: yunzaijs/data/yuki-plugin/config
|
|
65
65
|
* @param appDir 配置app目录
|
|
66
66
|
* @param functionName 配置文件名称,不包含.yaml后缀
|
|
67
67
|
* @returns {object} 配置数据
|
|
@@ -77,7 +77,7 @@ class Config {
|
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* 获取配置文件路径
|
|
80
|
-
* @param typeDir 配置文件目录类型对应路径 defaultConfig: defaultConfig 或 config:
|
|
80
|
+
* @param typeDir 配置文件目录类型对应路径 defaultConfig: defaultConfig 或 config: yunzaijs/data/yuki-plugin/config
|
|
81
81
|
* @param appDir 配置app目录
|
|
82
82
|
* @param functionName 配置文件名称,不包含.yaml后缀
|
|
83
83
|
* @returns {string} 配置文件路径
|
|
@@ -93,7 +93,7 @@ class Config {
|
|
|
93
93
|
/**
|
|
94
94
|
* 监听配置文件的变化
|
|
95
95
|
* @param configFilePath 文件路径
|
|
96
|
-
* @param typeDir 配置文件目录类型对应路径 defaultConfig: defaultConfig 或 config:
|
|
96
|
+
* @param typeDir 配置文件目录类型对应路径 defaultConfig: defaultConfig 或 config: yunzaijs/data/yuki-plugin/config
|
|
97
97
|
* @param appDir 配置app目录
|
|
98
98
|
* @param functionName 配置文件名称,不包含.yaml后缀
|
|
99
99
|
*/
|
package/lib/utils/image.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Picture } from '
|
|
2
|
+
import { Picture } from 'jsxp';
|
|
3
3
|
import { YukiPuppeteerRender } from './puppeteer.render.js';
|
|
4
4
|
import * as index from '../components/index.js';
|
|
5
5
|
|
|
@@ -35,9 +35,9 @@ class Image extends Picture {
|
|
|
35
35
|
const Page = index[page];
|
|
36
36
|
// 调用 yukiPuppeteerRender 进行截图操作
|
|
37
37
|
return this.yukiPuppeteerRender.yukiScreenshot(this.Com.compile({
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
path: page,
|
|
39
|
+
name: `${uid}.html`,
|
|
40
|
+
component: React.createElement(Page, { ...props }),
|
|
41
41
|
...ComponentCreateOpsion
|
|
42
42
|
}), ScreenshotOptions);
|
|
43
43
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yz-yuki-plugin",
|
|
3
|
-
"version": "2.0.5-
|
|
3
|
+
"version": "2.0.5-3",
|
|
4
4
|
"description": "优纪插件,yunzaijs 关于 微博推送、B站推送 等功能的拓展插件",
|
|
5
5
|
"author": "snowtafir",
|
|
6
6
|
"type": "module",
|
|
@@ -11,13 +11,15 @@
|
|
|
11
11
|
"url": "https://github.com/snowtafir/yuki-plugin.git"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
|
-
"app": "
|
|
15
|
-
"
|
|
14
|
+
"app": "node lib/main.js",
|
|
15
|
+
"dev": "lvy dev --yunzai",
|
|
16
|
+
"build": "lvy build",
|
|
17
|
+
"view": "lvy dev --view",
|
|
18
|
+
"img-dev": "npx tsx watch --clear-screen=false jsxp.server.ts",
|
|
16
19
|
"render-test": "npx tsx ./render.test.ts",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"css-m": "tailwindcss -i ./src/input.css -o ./public/output.css -m",
|
|
20
|
+
"start": "pm2 startOrRestart pm2.config.cjs",
|
|
21
|
+
"stop": "pm2 stop pm2.config.cjs",
|
|
22
|
+
"delete": "pm2 delete pm2.config.cjs",
|
|
21
23
|
"format": "prettier --write .",
|
|
22
24
|
"check-format": "git diff --exit-code",
|
|
23
25
|
"prepare": "husky"
|
|
@@ -28,36 +30,23 @@
|
|
|
28
30
|
"chokidar": "^3.6.0",
|
|
29
31
|
"debug": "^4.3.6",
|
|
30
32
|
"jsdom": "^24.1.1",
|
|
33
|
+
"jsxp": "^1.0.4",
|
|
31
34
|
"json5": "^2.2.3",
|
|
32
35
|
"lodash": "^4.17.21",
|
|
33
36
|
"md5": "^2.3.0",
|
|
34
37
|
"moment": "^2.30.1",
|
|
35
38
|
"node-fetch": "^3.3.2",
|
|
36
|
-
"puppeteer": "^23.3
|
|
39
|
+
"puppeteer": "^23.5.3",
|
|
37
40
|
"qrcode": "^1.5.4",
|
|
38
41
|
"react": "^18.3.1",
|
|
39
42
|
"react-dom": "^18.3.1",
|
|
40
|
-
"react-puppeteer": "^1.0.7",
|
|
41
43
|
"redis": "^4.7.0",
|
|
42
44
|
"yaml": "^2.5.1",
|
|
43
45
|
"yarn": "^1.19.1"
|
|
44
46
|
},
|
|
45
47
|
"devDependencies": {
|
|
46
|
-
"@babel/core": "^7.25.2",
|
|
47
|
-
"@babel/preset-env": "^7.25.4",
|
|
48
|
-
"@babel/preset-react": "^7.24.7",
|
|
49
|
-
"@babel/preset-typescript": "^7.24.7",
|
|
50
48
|
"@types/chalk": "2.2.0",
|
|
51
|
-
"@rollup/plugin-babel": "^6.0.4",
|
|
52
49
|
"@types/lodash": "^4.17.7",
|
|
53
|
-
"@rollup/plugin-commonjs": "^26.0.1",
|
|
54
|
-
"@rollup/plugin-image": "^3.0.3",
|
|
55
|
-
"@rollup/plugin-json": "^6.1.0",
|
|
56
|
-
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
57
|
-
"@rollup/plugin-replace": "^5.0.7",
|
|
58
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
59
|
-
"@rollup/plugin-typescript": "^11.1.6",
|
|
60
|
-
"@types/rollup-plugin-auto-external": "^2.0.5",
|
|
61
50
|
"@types/jsdom": "^21.1.7",
|
|
62
51
|
"@types/md5": "^2.3.5",
|
|
63
52
|
"@types/node": "^22.2.0",
|
|
@@ -67,32 +56,26 @@
|
|
|
67
56
|
"@types/react-dom": "^18.3.0",
|
|
68
57
|
"@types/yaml": "1.9.7",
|
|
69
58
|
"axios": "^1.7.7",
|
|
70
|
-
"babel-plugin-module-resolver": "^5.0.2",
|
|
71
59
|
"chokidar": "^3.6.0",
|
|
72
60
|
"husky": "^9.1.6",
|
|
73
61
|
"jsdom": "^24.1.1",
|
|
62
|
+
"jsxp": "^1.0.4",
|
|
74
63
|
"json5": "^2.2.3",
|
|
75
64
|
"lodash": "^4.17.21",
|
|
65
|
+
"lvyjs": "^0.0.3",
|
|
76
66
|
"md5": "^2.3.0",
|
|
77
67
|
"node-fetch": "^3.3.2",
|
|
78
68
|
"prettier": "^3.3.3",
|
|
79
|
-
"puppeteer": "^23.3
|
|
69
|
+
"puppeteer": "^23.5.3",
|
|
80
70
|
"qrcode": "^1.5.4",
|
|
81
71
|
"react": "^18.3.1",
|
|
82
72
|
"react-dom": "^18.3.1",
|
|
83
|
-
"react-puppeteer": "^1.0.7",
|
|
84
73
|
"redis": "^4.7.0",
|
|
85
|
-
"rollup": "^4.20.0",
|
|
86
|
-
"rollup-plugin-auto-external": "^2.0.0",
|
|
87
|
-
"rollup-plugin-copy": "^3.5.0",
|
|
88
|
-
"rollup-plugin-dts": "^6.1.1",
|
|
89
|
-
"rollup-plugin-ignore": "^1.0.10",
|
|
90
74
|
"tailwindcss": "^3.4.9",
|
|
91
75
|
"ts-node": "^10.9.2",
|
|
92
76
|
"tsx": "^4.19.0",
|
|
93
77
|
"typescript": "^5.5.4",
|
|
94
|
-
"
|
|
95
|
-
"yunzai-mys": "^1.0.6"
|
|
78
|
+
"yunzaijs": "^1.0.0-rc.4"
|
|
96
79
|
},
|
|
97
80
|
"files": [
|
|
98
81
|
"public",
|
|
@@ -113,7 +96,7 @@
|
|
|
113
96
|
}
|
|
114
97
|
},
|
|
115
98
|
"keywords": [
|
|
116
|
-
"
|
|
99
|
+
"yunzaijs"
|
|
117
100
|
],
|
|
118
101
|
"publishConfig": {
|
|
119
102
|
"registry": "https://registry.npmjs.org"
|
package/lib/apps/bilibili.d.ts
DELETED