yz-yuki-plugin 2.0.8-9 → 2.0.9-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yz-yuki-plugin",
3
- "version": "2.0.8-9",
3
+ "version": "2.0.9-1",
4
4
  "description": "优纪插件,yunzaijs 关于 微博推送、B站推送 等功能的拓展插件",
5
5
  "author": "snowtafir",
6
6
  "type": "module",
@@ -26,6 +26,7 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "axios": "^1.7.9",
29
+ "axios-cookiejar-support": "^6.0.5",
29
30
  "chalk": "^5.3.0",
30
31
  "chokidar": "4.0.1",
31
32
  "cookie": "^1.0.2",
@@ -42,10 +43,12 @@
42
43
  "react": "^18.3.1",
43
44
  "react-dom": "^18.3.1",
44
45
  "redis": "^4.7.0",
46
+ "tough-cookie": "^6.0.0",
45
47
  "yaml": "^2.6.1",
46
48
  "yarn": "^1.19.1"
47
49
  },
48
50
  "devDependencies": {
51
+ "@types/node-forge": "^1.3.14",
49
52
  "@types/chalk": "2.2.0",
50
53
  "@types/chokidar": "2.1.7",
51
54
  "@types/jsdom": "^21.1.7",
@@ -66,7 +69,7 @@
66
69
  "json5": "^2.2.3",
67
70
  "jsxp": "^1.2.3",
68
71
  "lodash": "^4.17.21",
69
- "lvyjs": "^0.2.21",
72
+ "lvyjs": "^0.2.25",
70
73
  "md5": "^2.3.0",
71
74
  "node-fetch": "^3.3.2",
72
75
  "postcss": "^8.4.47",
@@ -28,7 +28,7 @@ body::-webkit-scrollbar {
28
28
  @import url('https://s1.hdslb.com/bfs/static/jinkela/long/font/regular.css');
29
29
 
30
30
  body {
31
- font-family: 'OPSans', 'HarmonyOS_Regular', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
31
+ font-family: 'OPSans', 'HarmonyOS_Regular', 'Noto Sans', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
32
32
  background-color: #f9f9f9;
33
33
  margin: 0;
34
34
  padding: 0;
@@ -1,493 +0,0 @@
1
- import BiliApi from './bilibili.main.api.js';
2
- import { gen_buvid_fp } from './bilibili.risk.buid.fp.js';
3
- import { getBiliTicket } from './bilibili.risk.ticket.js';
4
- import { renderPage } from '../../utils/image.js';
5
- import { _paths } from '../../utils/paths.js';
6
- import axios from 'axios';
7
- import fs__default from 'fs';
8
- import lodash from 'lodash';
9
- import fetch from 'node-fetch';
10
- import { promisify } from 'node:util';
11
- import path from 'path';
12
- import QRCode from 'qrcode';
13
- import YAML from 'yaml';
14
- import { Redis, Segment } from 'yunzaijs';
15
-
16
- /**
17
- * *******************************************************************
18
- * Login 相关
19
- * *******************************************************************
20
- */
21
- /**申请登陆二维码(web端) */
22
- async function applyLoginQRCode(e) {
23
- const url = 'https://passport.bilibili.com/x/passport-login/web/qrcode/generate?source=main-fe-header';
24
- const response = await fetch(url, {
25
- method: 'GET',
26
- headers: lodash.merge(BiliApi.BIlIBILI_LOGIN_HEADERS, { 'user-agent': BiliApi.BILIBILI_HEADERS['User-Agent'] }, { Host: 'passport.bilibili.com' }),
27
- redirect: 'follow'
28
- });
29
- if (!response.ok) {
30
- throw new Error(`获取B站登录二维码URL网络请求失败,状态码: ${response.status}`);
31
- }
32
- const res = (await response.json());
33
- if (res?.code === 0) {
34
- const qrcodeKey = res?.data?.qrcode_key;
35
- const qrcodeUrl = res?.data?.url;
36
- let loginUrlQrcodeData = await QRCode.toDataURL(`${qrcodeUrl}`);
37
- const LoginPropsData = {
38
- data: { name: 'B站', url: loginUrlQrcodeData }
39
- };
40
- const ScreenshotOptionsData = {
41
- saveHtmlfile: false,
42
- modelName: 'bili-login'
43
- };
44
- const qrCodeImage = await renderPage('bili-login', 'LoginQrcodePage', LoginPropsData, ScreenshotOptionsData);
45
- let qrCodeBufferArray = [];
46
- if (qrCodeImage !== false) {
47
- const { img } = qrCodeImage;
48
- qrCodeBufferArray = img;
49
- }
50
- let msg = [];
51
- if (qrCodeBufferArray.length === 0) {
52
- msg.push('渲染二维码图片失败,请查看终端输出的实时日志,\n复制哔哩登陆二维码URL,使用在线或本地二维码生成工具生成二维码并扫码。');
53
- }
54
- else {
55
- msg.push(Segment.image(qrCodeBufferArray[0]));
56
- }
57
- e.reply('请在3分钟内扫码以完成B站登陆绑定');
58
- e.reply(msg);
59
- logger.info(`优纪插件: 如果发送二维码图片消息失败可复制如下URL, 使用在线或本地二维码生成工具生成二维码并扫码`);
60
- logger.info(`优纪插件: 哔哩登陆二维码URL: ${qrcodeUrl}`);
61
- return qrcodeKey;
62
- }
63
- else {
64
- e.reply(`获取B站登录二维码失败: ${JSON.stringify(res.data)}`);
65
- throw new Error(`获取B站登录二维码失败: ${JSON.stringify(res.data)}`);
66
- }
67
- }
68
- /**处理扫码结果 */
69
- async function pollLoginQRCode(e, qrcodeKey) {
70
- const url = `https://passport.bilibili.com/x/passport-login/web/qrcode/poll?qrcode_key=${qrcodeKey}&source=main-fe-header`;
71
- const response = await fetch(url, {
72
- method: 'GET',
73
- headers: lodash.merge(BiliApi.BIlIBILI_LOGIN_HEADERS, { 'User-agent': BiliApi.BILIBILI_HEADERS['User-Agent'] }, { Host: 'passport.bilibili.com' }),
74
- redirect: 'follow'
75
- });
76
- if (!response.ok) {
77
- throw new Error(`处理B站登录token网络请求失败,状态码: ${response.status}`);
78
- }
79
- const data = (await response.json());
80
- if (data.code === 0) {
81
- if (data?.data?.code === 0) {
82
- // 登录成功,获取 cookie
83
- const LoginCookie = response.headers.get('set-cookie');
84
- let loginCk = '';
85
- try {
86
- const nomalCk = await getNewTempCk();
87
- loginCk = `${nomalCk}${LoginCookie}`;
88
- }
89
- catch (error) {
90
- loginCk = LoginCookie;
91
- logger.debug(`优纪插件: 获取B站登录ck缺失部分: ${error}`);
92
- }
93
- e.reply(`~B站登陆成功~`);
94
- return loginCk;
95
- }
96
- else if (data?.data?.code === 86101) {
97
- // 未扫码
98
- // 继续轮询
99
- await new Promise(resolve => setTimeout(resolve, 2000));
100
- global?.logger?.mark(`优纪插件:扫码B站登录:未扫码,轮询中...`);
101
- return pollLoginQRCode(e, qrcodeKey);
102
- }
103
- else if (data?.data?.code === 86090) {
104
- // 已扫码未确认
105
- // 继续轮询
106
- await new Promise(resolve => setTimeout(resolve, 2000));
107
- return pollLoginQRCode(e, qrcodeKey);
108
- }
109
- else if (data?.data?.code === 86038) {
110
- // 二维码已失效
111
- e.reply('B站登陆二维码已失效');
112
- return null;
113
- }
114
- else {
115
- e.reply('处理扫码结果出错');
116
- throw new Error(`处理扫码结果出错: ${data?.data?.message}`);
117
- }
118
- }
119
- else {
120
- e.reply('处理扫码结果出错');
121
- throw new Error(`处理扫码结果出错: ${data?.message}`);
122
- }
123
- }
124
- /**查看app扫码登陆获取的ck的有效状态*/
125
- async function checkBiliLogin(e) {
126
- const LoginCookie = await readLoginCookie();
127
- if (String(LoginCookie).trim().length < 10) {
128
- e.reply('啊咧?B站登录CK呢?哦,没 #扫码B站登录# 或失效了啊,那没事了。');
129
- return;
130
- }
131
- else {
132
- const res = await fetch('https://api.bilibili.com/x/web-interface/nav', {
133
- method: 'GET',
134
- headers: lodash.merge(BiliApi.BIlIBILI_LOGIN_HEADERS, { 'User-agent': BiliApi.BILIBILI_HEADERS['User-Agent'] }, { Cookie: `${LoginCookie}` }),
135
- redirect: 'follow'
136
- });
137
- const resData = await res.json();
138
- global?.logger?.debug(`B站验证登录状态:${JSON.stringify(resData)}`);
139
- if (resData.code === 0) {
140
- let uname = resData.data?.uname;
141
- let mid = resData.data?.mid;
142
- let money = resData.data?.money;
143
- let level_info = resData.data?.level_info;
144
- let current_level = level_info?.current_level;
145
- let current_exp = level_info?.current_exp;
146
- let next_exp = level_info?.next_exp;
147
- const LoginCookieTTL = await readLoginCookieTTL();
148
- const LoginCookieTTLStr = LoginCookieTTL === -1 ? '永久' : LoginCookieTTL === -2 ? '-' : `${new Date(Date.now() + LoginCookieTTL * 1000).toLocaleString()}`;
149
- e.reply(`~B站账号已登陆~\n有效期至:${LoginCookieTTLStr}。\n昵称:${uname}\nuid:${mid}\n硬币:${money}\n经验等级:${current_level}\n当前经验值exp:${current_exp}\n下一等级所需exp:${next_exp}`);
150
- }
151
- else if (resData.code === -101) {
152
- e.reply('B站登录CK已失效,请重新扫码登录');
153
- }
154
- else {
155
- // 处理其他情况
156
- e.reply('意外情况,未能成功获取登录ck的有效状态');
157
- return;
158
- }
159
- }
160
- }
161
- /**退出B站账号登录,将会删除redis缓存的LoginCK,并在服务器注销该登录 Token (SESSDATA)*/
162
- async function exitBiliLogin(e) {
163
- const url = 'https://passport.bilibili.com/login/exit/v2';
164
- const exitCk = await readLoginCookie();
165
- const [SESSDATA, biliCSRF, DedeUserID] = await Promise.all([
166
- readSavedCookieItems(exitCk, ['SESSDATA'], false),
167
- readSavedCookieItems(exitCk, ['bili_jct'], false),
168
- readSavedCookieItems(exitCk, ['DedeUserID'], false)
169
- ]);
170
- if (lodash.trim(SESSDATA).length === 0 || lodash.trim(biliCSRF).length === 0 || lodash.trim(DedeUserID).length === 0) {
171
- e.reply('当前无可用的B站登录CK可退出登录');
172
- return;
173
- }
174
- const postData = String(biliCSRF)
175
- .trim()
176
- .replace(/^bili_jct=/g, '')
177
- .replace(/;*$/g, '');
178
- try {
179
- const resp = await axios.post(url, { biliCSRF: postData }, {
180
- headers: {
181
- 'Host': 'passport.bilibili.com',
182
- 'User-Agent': BiliApi.BILIBILI_HEADERS['User-Agent'],
183
- 'Cookie': `${DedeUserID};${biliCSRF};${SESSDATA}`,
184
- 'Content-Type': 'application/x-www-form-urlencoded'
185
- }
186
- });
187
- const contentType = resp.headers['Content-Type'];
188
- if (typeof contentType === 'string' && contentType.includes('text/html')) {
189
- e.reply('当前缓存的B站登录CK早已失效!');
190
- return;
191
- }
192
- const res = resp.data;
193
- logger?.debug(`exitBiliLogin: ${JSON.stringify(res)}`);
194
- const { code } = res;
195
- switch (code) {
196
- case 0:
197
- e.reply('当前缓存的B站登录CK已在B站服务器退出登录~');
198
- break;
199
- case 2202:
200
- e.reply('csrf 请求非法,退出登录请求出错');
201
- break;
202
- case -101:
203
- e.reply('当前缓存的扫码B站ck未登录!');
204
- break;
205
- default:
206
- e.reply('未知情况!无妨');
207
- return;
208
- }
209
- }
210
- catch (error) {
211
- e.reply('退出登录请求出错');
212
- console.error('Error during Bili login exit:', error);
213
- }
214
- }
215
- /**
216
- * *******************************************************************
217
- * cookie相关
218
- * *******************************************************************
219
- */
220
- /**保存扫码登录的loginCK*/
221
- async function saveLoginCookie(e, biliLoginCk) {
222
- if (biliLoginCk && biliLoginCk.length > 0) {
223
- const LoginCkKey = 'Yz:yuki:bili:loginCookie';
224
- Redis.set(LoginCkKey, biliLoginCk, { EX: 3600 * 24 * 360 });
225
- }
226
- else {
227
- e.reply('扫码超时');
228
- }
229
- }
230
- /** 读取扫码登陆后缓存的cookie */
231
- async function readLoginCookie() {
232
- const CK_KEY = 'Yz:yuki:bili:loginCookie';
233
- const tempCk = await Redis.get(CK_KEY);
234
- return tempCk ? tempCk : '';
235
- }
236
- /** 读取扫码登陆后缓存的cookie的有效时间 */
237
- async function readLoginCookieTTL() {
238
- const CK_KEY = 'Yz:yuki:bili:loginCookie';
239
- const tempCk = await Redis.get(CK_KEY);
240
- if (tempCk) {
241
- const LoginCookieTTL = await Redis.ttl(CK_KEY);
242
- return LoginCookieTTL;
243
- }
244
- else {
245
- return -2;
246
- }
247
- }
248
- /** 读取手动绑定的B站ck */
249
- async function readLocalBiliCk() {
250
- const dir = path.join(_paths.root, 'data/yuki-plugin/');
251
- if (!fs__default.existsSync(dir)) {
252
- fs__default.mkdirSync(dir, { recursive: true }); // 创建目录,包括父目录
253
- }
254
- const files = fs__default.readdirSync(dir).filter((file) => file.endsWith('biliCookie.yaml'));
255
- const readFile = promisify(fs__default.readFile);
256
- const promises = files.map((file) => readFile(path.join(dir, file), 'utf8'));
257
- const contents = await Promise.all(promises);
258
- const Bck = contents.map((content) => YAML.parse(content));
259
- return Bck[0];
260
- }
261
- /** 覆盖保存手动获取绑定的B站ck */
262
- async function saveLocalBiliCk(data) {
263
- const dirPath = path.join(_paths.root, 'data/yuki-plugin/');
264
- const filePath = path.join(dirPath, 'biliCookie.yaml');
265
- const cleanedData = String(data).replace(/\s/g, '').trim();
266
- if (lodash.isEmpty(cleanedData)) {
267
- fs__default.existsSync(filePath) && fs__default.unlinkSync(filePath);
268
- }
269
- else {
270
- if (!fs__default.existsSync(dirPath)) {
271
- fs__default.mkdirSync(dirPath, { recursive: true });
272
- }
273
- const yamlContent = YAML.stringify(cleanedData);
274
- fs__default.writeFileSync(filePath, yamlContent, 'utf8');
275
- }
276
- }
277
- /** 读取缓存的tempCK */
278
- async function readTempCk() {
279
- const CK_KEY = 'Yz:yuki:bili:tempCookie';
280
- const tempCk = await Redis.get(CK_KEY);
281
- if (!tempCk) {
282
- const newTempCk = await getNewTempCk();
283
- await saveTempCk(newTempCk);
284
- const result = await postGateway(newTempCk);
285
- const data = await result.data; // 解析校验结果
286
- if (data?.code !== 0) {
287
- logger?.error(`优纪插件:tempCK,Gateway校验失败:${JSON.stringify(data)}`);
288
- }
289
- else if (data?.code === 0) {
290
- logger?.mark(`优纪插件:tempCK,Gateway校验成功:${JSON.stringify(data)}`);
291
- }
292
- return newTempCk;
293
- }
294
- else {
295
- return tempCk;
296
- }
297
- }
298
- /**保存tempCK*/
299
- async function saveTempCk(newTempCk) {
300
- const CK_KEY = 'Yz:yuki:bili:tempCookie';
301
- await Redis.set(CK_KEY, newTempCk, { EX: 3600 * 24 * 180 });
302
- }
303
- /** 综合获取ck,返回优先级:localCK > loginCK > tempCK */
304
- async function readSyncCookie() {
305
- const localCk = await readLocalBiliCk();
306
- const tempCk = await readTempCk();
307
- const loginCk = await readLoginCookie();
308
- const validCk = (ck) => ck?.trim().length > 10;
309
- if (validCk(localCk)) {
310
- return { cookie: localCk, mark: 'localCk' };
311
- }
312
- else if (validCk(loginCk)) {
313
- return { cookie: loginCk + ';', mark: 'loginCk' };
314
- }
315
- else if (validCk(tempCk)) {
316
- return { cookie: tempCk, mark: 'tempCk' };
317
- }
318
- else {
319
- return { cookie: '', mark: 'ckIsEmpty' };
320
- }
321
- }
322
- /**
323
- * 综合读取、筛选 传入的或本地或redis存储的cookie的item
324
- * @param {string} mark 读取存储的CK类型,'localCK' 'tempCK' 'loginCK' 或传入值 'xxx'并进行筛选
325
- * @param {Array} items 选取获取CK的项 选全部值:items[0] = 'all' ,或选取其中的值 ['buvid3', 'buvid4', '_uuid', 'SESSDATA', 'DedeUserID', 'DedeUserID__ckMd5', 'bili_jct', 'b_nut', 'b_lsid']
326
- * @param {boolean} isInverted 控制正取和反取,true为反取,false为正取
327
- * @returns {string}
328
- **/
329
- async function readSavedCookieItems(mark, items, isInverted = false) {
330
- let ckString;
331
- switch (mark) {
332
- case 'localCK':
333
- ckString = await readLocalBiliCk();
334
- break;
335
- case 'tempCK':
336
- ckString = await readTempCk();
337
- break;
338
- case 'loginCK':
339
- ckString = await readLoginCookie();
340
- break;
341
- default:
342
- ckString = mark;
343
- }
344
- const Bck = lodash.trim(ckString);
345
- if (!Bck) {
346
- return '';
347
- }
348
- if (items[0] === 'all') {
349
- return Bck;
350
- }
351
- const cookiePairs = String(Bck)
352
- .trim()
353
- .match(/(\w+)=([^;|,]+)/g) //正则 /(\w+)=([^;]+);/g 匹配 a=b 的内容,并分组为 [^;|,]+ 来匹配值,其中 [^;|,] 表示除了分号和,以外的任意字符
354
- ?.map(match => match.split('='))
355
- .filter(([key, value]) => (isInverted ? !items.includes(key) : items.includes(key)) && value !== '')
356
- .map(([key, value]) => `${key}=${value}`)
357
- .join(';') || '';
358
- return cookiePairs;
359
- }
360
- // 取反读取ck、筛选 传入的或本地或redis存储的cookie的item
361
- async function readSavedCookieOtherItems(mark, items) {
362
- return await readSavedCookieItems(mark, items, true);
363
- }
364
- /** 生成 _uuid */
365
- async function genUUID() {
366
- const generatePart = (length) => Array.from({ length }, () => Math.floor(16 * Math.random()))
367
- .map(num => num.toString(16).toUpperCase())
368
- .join('');
369
- const padLeft = (str, length) => str.padStart(length, '0');
370
- const e = generatePart(8);
371
- const t = generatePart(4);
372
- const r = generatePart(4);
373
- const n = generatePart(4);
374
- const o = generatePart(12);
375
- const i = Date.now();
376
- const uuid = `_uuid=${e}-${t}-${r}-${n}-${o}${padLeft((i % 1e5).toString(), 5)}infoc;`;
377
- return uuid;
378
- }
379
- /**生成 b_lsid */
380
- async function gen_b_lsid() {
381
- function get_random_str(length) {
382
- return Array.from({ length }, () => Math.floor(Math.random() * 16)
383
- .toString(16)
384
- .toUpperCase()).join('');
385
- }
386
- const timestamp = Date.now();
387
- const randomPart = get_random_str(8);
388
- const timestampHex = timestamp.toString(16).toUpperCase();
389
- return `b_lsid=${randomPart}_${timestampHex};`;
390
- }
391
- /** 获取 buvid3 和 buvid4 */
392
- async function getBuvid3_4(uuid) {
393
- const url = 'https://api.bilibili.com/x/frontend/finger/spi/';
394
- const headers = lodash.merge({}, BiliApi.BILIBILI_HEADERS, {
395
- Cookie: `_uuid=${uuid}`,
396
- Host: 'api.bilibili.com',
397
- Origin: 'https://www.bilibili.com',
398
- Referer: 'https://www.bilibili.com/'
399
- });
400
- const response = await axios.get(url, { headers });
401
- const { code, data } = response.data;
402
- if (code === 0) {
403
- const { b_3: buvid3, b_4: buvid4 } = data;
404
- return `buvid3=${buvid3};buvid4=${buvid4};`;
405
- }
406
- else {
407
- return '';
408
- }
409
- }
410
- /**获取新的tempCK*/
411
- async function getNewTempCk() {
412
- const uuid = await genUUID();
413
- const b_nut = `b_nut=${Date.now() / 1000};`;
414
- const buvid3_buvid4 = await getBuvid3_4(uuid);
415
- const b_lsid = await gen_b_lsid();
416
- const buvid_fp = await get_buvid_fp(uuid);
417
- return `${uuid}${buvid3_buvid4}${b_lsid}${buvid_fp}${b_nut}`;
418
- }
419
- /**
420
- * *******************************************************************
421
- * 风控相关函数
422
- * *******************************************************************
423
- */
424
- /**
425
- * 请求参数POST接口(ExClimbWuzhi)过校验
426
- * @param cookie 请求所需的cookie
427
- * @returns 返回POST请求的结果
428
- */
429
- async function postGateway(cookie) {
430
- const _uuid = await readSavedCookieItems(cookie, ['_uuid'], false);
431
- const payloadJsonData = await BiliApi.BILIBILI_BROWSER_DATA(_uuid);
432
- const data = { payload: JSON.stringify(payloadJsonData) };
433
- const requestUrl = 'https://api.bilibili.com/x/internal/gaia-gateway/ExClimbWuzhi';
434
- const config = {
435
- headers: lodash.merge({}, BiliApi.BILIBILI_HEADERS, {
436
- 'Cookie': cookie,
437
- 'Content-type': 'application/json;charset=UTF-8'
438
- }, {
439
- Host: 'api.bilibili.com',
440
- Origin: 'https://www.bilibili.com',
441
- Referer: 'https://www.bilibili.com/'
442
- })
443
- };
444
- try {
445
- const res = await axios.post(requestUrl, data, config);
446
- return res;
447
- }
448
- catch (error) {
449
- logger.error('Error making POST request:', error);
450
- throw error;
451
- }
452
- }
453
- /**生成buvid_fp
454
- * @param {string} uuid
455
- */
456
- async function get_buvid_fp(cookie) {
457
- const uuid = await readSavedCookieItems(cookie, ['_uuid'], false);
458
- const fingerprintData = BiliApi.BILIBILI_FINGERPRINT_DATA(uuid);
459
- const buvidFp = gen_buvid_fp(fingerprintData);
460
- return `buvid_fp=${buvidFp};`;
461
- }
462
- /**
463
- * 获取有效bili_ticket并添加到cookie
464
- * @param {string} cookie
465
- * @returns {Promise<{ cookie: string; }>} 返回包含最新有效的bili_ticket的cookie
466
- */
467
- async function cookieWithBiliTicket(cookie) {
468
- const BiliJctKey = 'Yz:yuki:bili:bili_ticket';
469
- cookie = await readSavedCookieItems(cookie, ['bili_ticket'], true);
470
- const biliTicket = await Redis.get(BiliJctKey);
471
- if (!biliTicket) {
472
- try {
473
- const csrf = await readSavedCookieItems(cookie, ['bili_jct'], false);
474
- const { ticket, ttl } = await getBiliTicket(csrf);
475
- if (ticket && ttl) {
476
- await Redis.set(BiliJctKey, ticket, { EX: ttl });
477
- return cookie + `;bili_ticket=${ticket};`;
478
- }
479
- else {
480
- return cookie;
481
- }
482
- }
483
- catch (error) {
484
- logger?.error(`${error}`);
485
- return cookie;
486
- }
487
- }
488
- else {
489
- return cookie + `;bili_ticket=${biliTicket};`;
490
- }
491
- }
492
-
493
- export { applyLoginQRCode, checkBiliLogin, cookieWithBiliTicket, exitBiliLogin, genUUID, gen_b_lsid, getNewTempCk, get_buvid_fp, pollLoginQRCode, postGateway, readLoginCookie, readSavedCookieItems, readSavedCookieOtherItems, readSyncCookie, readTempCk, saveLocalBiliCk, saveLoginCookie, saveTempCk };