yz-yuki-plugin 2.0.4-9 → 2.0.5-0

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 (51) hide show
  1. package/.puppeteerrc.cjs +1 -1
  2. package/CHANGELOG.md +3 -0
  3. package/README.md +19 -3
  4. package/defaultConfig/bilibili/config.yaml +2 -2
  5. package/defaultConfig/help/help.yaml +51 -51
  6. package/defaultConfig/weibo/config.yaml +2 -2
  7. package/lib/apps/bilibili.js +88 -84
  8. package/lib/apps/help.js +3 -3
  9. package/lib/apps/version.js +4 -4
  10. package/lib/apps/weibo.js +47 -47
  11. package/lib/components/dynamic/Account.js +3 -3
  12. package/lib/components/dynamic/Content.js +2 -2
  13. package/lib/components/dynamic/Footer.js +3 -3
  14. package/lib/components/dynamic/LogoText.js +2 -2
  15. package/lib/components/dynamic/MainPage.js +2 -2
  16. package/lib/components/loginQrcode/Page.js +1 -1
  17. package/lib/index.js +7 -9
  18. package/lib/models/bilibili/bilibili.api.d.ts +4 -4
  19. package/lib/models/bilibili/bilibili.api.js +13 -13
  20. package/lib/models/bilibili/bilibili.get.web.data.js +32 -18
  21. package/lib/models/bilibili/bilibili.models.d.ts +9 -9
  22. package/lib/models/bilibili/bilibili.models.js +248 -192
  23. package/lib/models/bilibili/bilibili.query.d.ts +5 -5
  24. package/lib/models/bilibili/bilibili.query.js +135 -114
  25. package/lib/models/bilibili/bilibili.task.d.ts +1 -1
  26. package/lib/models/bilibili/bilibili.task.js +41 -36
  27. package/lib/models/bilibili/bilibili.ticket.js +3 -3
  28. package/lib/models/bilibili/bilibili.wbi.js +10 -12
  29. package/lib/models/help/help.js +2 -2
  30. package/lib/models/weibo/weibo.api.js +2 -2
  31. package/lib/models/weibo/weibo.get.web.data.js +6 -7
  32. package/lib/models/weibo/weibo.query.d.ts +4 -4
  33. package/lib/models/weibo/weibo.query.js +66 -69
  34. package/lib/models/weibo/weibo.task.d.ts +1 -1
  35. package/lib/models/weibo/weibo.task.js +43 -38
  36. package/lib/utils/config.d.ts +2 -2
  37. package/lib/utils/config.js +8 -8
  38. package/lib/utils/paths.js +1 -1
  39. package/lib/utils/puppeteer.render.js +20 -22
  40. package/package.json +8 -4
  41. package/resources/css/dynamic/Account.css +1 -1
  42. package/resources/css/dynamic/Content.box.grid.4.css +2 -2
  43. package/resources/css/dynamic/Content.box.grid.9.css +2 -2
  44. package/resources/css/dynamic/Content.css +1 -1
  45. package/resources/css/dynamic/Footer.css +1 -1
  46. package/resources/css/dynamic/ForwardContent.css +1 -1
  47. package/resources/css/dynamic/LogoText.css +2 -2
  48. package/resources/css/dynamic/MainPage.css +4 -5
  49. package/resources/css/help/help.css +18 -11
  50. package/resources/css/loginQrcode/Page.css +7 -11
  51. package/resources/css/version/version.css +8 -6
@@ -13,17 +13,17 @@ import { BiliApi } from './bilibili.api.js';
13
13
  import { getBiliTicket } from './bilibili.ticket.js';
14
14
 
15
15
  /**
16
- * *******************************************************************
17
- * Login 相关
18
- * *******************************************************************
19
- */
16
+ * *******************************************************************
17
+ * Login 相关
18
+ * *******************************************************************
19
+ */
20
20
  /**申请登陆二维码(web端) */
21
21
  async function applyLoginQRCode(e) {
22
22
  const url = 'https://passport.bilibili.com/x/passport-login/web/qrcode/generate?source=main-fe-header';
23
23
  const response = await fetch(url, {
24
- method: "GET",
25
- headers: lodash.merge(BiliApi.BIlIBILI_LOGIN_HEADERS, { 'user-agent': BiliApi.BILIBILI_HEADERS['User-Agent'] }, { 'Host': 'passport.bilibili.com', }),
26
- redirect: "follow",
24
+ method: 'GET',
25
+ headers: lodash.merge(BiliApi.BIlIBILI_LOGIN_HEADERS, { 'user-agent': BiliApi.BILIBILI_HEADERS['User-Agent'] }, { Host: 'passport.bilibili.com' }),
26
+ redirect: 'follow'
27
27
  });
28
28
  if (!response.ok) {
29
29
  throw new Error(`获取B站登录二维码URL网络请求失败,状态码: ${response.status}`);
@@ -38,9 +38,9 @@ async function applyLoginQRCode(e) {
38
38
  };
39
39
  const ScreenshotOptionsData = {
40
40
  saveHtmlfile: false,
41
- modelName: "bili-login"
41
+ modelName: 'bili-login'
42
42
  };
43
- const qrCodeImage = await renderPage("bili-login", "LoginQrcodePage", LoginPropsData, ScreenshotOptionsData);
43
+ const qrCodeImage = await renderPage('bili-login', 'LoginQrcodePage', LoginPropsData, ScreenshotOptionsData);
44
44
  let qrCodeBufferArray = [];
45
45
  if (qrCodeImage !== false) {
46
46
  const { img } = qrCodeImage;
@@ -68,9 +68,9 @@ async function applyLoginQRCode(e) {
68
68
  async function pollLoginQRCode(e, qrcodeKey) {
69
69
  const url = `https://passport.bilibili.com/x/passport-login/web/qrcode/poll?qrcode_key=${qrcodeKey}&source=main-fe-header`;
70
70
  const response = await fetch(url, {
71
- method: "GET",
72
- headers: lodash.merge(BiliApi.BIlIBILI_LOGIN_HEADERS, { 'User-agent': BiliApi.BILIBILI_HEADERS['User-Agent'] }, { 'Host': 'passport.bilibili.com', }),
73
- redirect: "follow",
71
+ method: 'GET',
72
+ headers: lodash.merge(BiliApi.BIlIBILI_LOGIN_HEADERS, { 'User-agent': BiliApi.BILIBILI_HEADERS['User-Agent'] }, { Host: 'passport.bilibili.com' }),
73
+ redirect: 'follow'
74
74
  });
75
75
  if (!response.ok) {
76
76
  throw new Error(`处理B站登录token网络请求失败,状态码: ${response.status}`);
@@ -86,14 +86,14 @@ async function pollLoginQRCode(e, qrcodeKey) {
86
86
  else if (data.data.code === 86101) {
87
87
  // 未扫码
88
88
  // 继续轮询
89
- await new Promise((resolve) => setTimeout(resolve, 2000));
89
+ await new Promise(resolve => setTimeout(resolve, 2000));
90
90
  (logger ?? Bot.logger)?.mark(`优纪插件:扫码B站登录:未扫码,轮询中...`);
91
91
  return pollLoginQRCode(e, qrcodeKey);
92
92
  }
93
93
  else if (data.data.code === 86090) {
94
94
  // 已扫码未确认
95
95
  // 继续轮询
96
- await new Promise((resolve) => setTimeout(resolve, 2000));
96
+ await new Promise(resolve => setTimeout(resolve, 2000));
97
97
  return pollLoginQRCode(e, qrcodeKey);
98
98
  }
99
99
  else if (data.data.code === 86038) {
@@ -114,10 +114,10 @@ async function pollLoginQRCode(e, qrcodeKey) {
114
114
  /**查看app扫码登陆获取的ck的有效状态*/
115
115
  async function checkBiliLogin(e) {
116
116
  const LoginCookie = await readLoginCookie();
117
- const res = await fetch("https://api.bilibili.com/x/web-interface/nav", {
118
- method: "GET",
119
- headers: lodash.merge(BiliApi.BIlIBILI_LOGIN_HEADERS, { 'User-agent': BiliApi.BILIBILI_HEADERS['User-Agent'] }, { "Cookie": `${LoginCookie}`, }),
120
- redirect: "follow",
117
+ const res = await fetch('https://api.bilibili.com/x/web-interface/nav', {
118
+ method: 'GET',
119
+ headers: lodash.merge(BiliApi.BIlIBILI_LOGIN_HEADERS, { 'User-agent': BiliApi.BILIBILI_HEADERS['User-Agent'] }, { Cookie: `${LoginCookie}` }),
120
+ redirect: 'follow'
121
121
  });
122
122
  const resData = await res.json();
123
123
  Bot.logger?.debug(`B站验证登录状态:${JSON.stringify(resData)}`);
@@ -146,21 +146,21 @@ async function exitBiliLogin(e) {
146
146
  readSavedCookieItems(exitCk, ['DedeUserID'], false)
147
147
  ]);
148
148
  if (lodash.trim(SESSDATA).length === 0 || lodash.trim(biliCSRF).length === 0 || lodash.trim(DedeUserID).length === 0) {
149
- e.reply("当前无可用的B站登录CK可退出登录");
149
+ e.reply('当前无可用的B站登录CK可退出登录');
150
150
  return;
151
151
  }
152
- const postData = new URLSearchParams({ "biliCSRF": biliCSRF });
152
+ const postData = new URLSearchParams({ biliCSRF: biliCSRF });
153
153
  try {
154
154
  const resp = await axios.post(url, postData.toString(), {
155
155
  headers: {
156
- "Host": 'passport.bilibili.com',
157
- "Cookie": `DedeUserID=${DedeUserID}; bili_jct=${biliCSRF}; SESSDATA=${SESSDATA}`,
158
- "Content-Type": 'application/x-www-form-urlencoded',
159
- },
156
+ 'Host': 'passport.bilibili.com',
157
+ 'Cookie': `DedeUserID=${DedeUserID}; bili_jct=${biliCSRF}; SESSDATA=${SESSDATA}`,
158
+ 'Content-Type': 'application/x-www-form-urlencoded'
159
+ }
160
160
  });
161
- const contentType = resp.headers["Content-Type"];
161
+ const contentType = resp.headers['Content-Type'];
162
162
  if (typeof contentType === 'string' && contentType.includes('text/html')) {
163
- e.reply("当前缓存的B站登录CK早已失效!");
163
+ e.reply('当前缓存的B站登录CK早已失效!');
164
164
  return;
165
165
  }
166
166
  const { code, status, data } = resp.data;
@@ -168,44 +168,44 @@ async function exitBiliLogin(e) {
168
168
  if (status) {
169
169
  switch (code) {
170
170
  case 0:
171
- e.reply("当前缓存的B站登录CK已在服务器注销~");
172
- await Redis.set("Yz:yuki:bili:loginCookie", "", { EX: 3600 * 24 * 180 });
171
+ e.reply('当前缓存的B站登录CK已在服务器注销~');
172
+ await Redis.set('Yz:yuki:bili:loginCookie', '', { EX: 3600 * 24 * 180 });
173
173
  e.reply(`登陆的B站ck并已删除~`);
174
174
  break;
175
175
  case 2202:
176
- e.reply("csrf 请求非法,退出登录请求出错");
176
+ e.reply('csrf 请求非法,退出登录请求出错');
177
177
  break;
178
178
  default:
179
- e.reply("当前缓存的B站登录CK早已失效!");
179
+ e.reply('当前缓存的B站登录CK早已失效!');
180
180
  }
181
181
  }
182
182
  else {
183
- e.reply("服务器响应异常,退出登录请求出错");
183
+ e.reply('服务器响应异常,退出登录请求出错');
184
184
  }
185
185
  }
186
186
  catch (error) {
187
187
  console.error('Error during Bili login exit:', error);
188
- e.reply("退出登录请求出错,请稍后再试");
188
+ e.reply('退出登录请求出错,请稍后再试');
189
189
  }
190
190
  }
191
191
  /**
192
- * *******************************************************************
193
- * cookie相关
194
- * *******************************************************************
195
- */
192
+ * *******************************************************************
193
+ * cookie相关
194
+ * *******************************************************************
195
+ */
196
196
  /**保存扫码登录的loginCK*/
197
197
  async function saveLoginCookie(e, biliLoginCk) {
198
198
  if (biliLoginCk && biliLoginCk.length > 0) {
199
- const LoginCkKey = "Yz:yuki:bili:loginCookie";
199
+ const LoginCkKey = 'Yz:yuki:bili:loginCookie';
200
200
  Redis.set(LoginCkKey, biliLoginCk, { EX: 3600 * 24 * 360 });
201
201
  }
202
202
  else {
203
- e.reply("扫码超时");
203
+ e.reply('扫码超时');
204
204
  }
205
205
  }
206
206
  /** 读取扫码登陆后缓存的cookie */
207
207
  async function readLoginCookie() {
208
- const CK_KEY = "Yz:yuki:bili:loginCookie";
208
+ const CK_KEY = 'Yz:yuki:bili:loginCookie';
209
209
  const tempCk = await Redis.get(CK_KEY);
210
210
  return tempCk ? tempCk : '';
211
211
  }
@@ -240,13 +240,13 @@ async function saveLocalBiliCk(data) {
240
240
  }
241
241
  /** 读取缓存的tempCK */
242
242
  async function readTempCk() {
243
- const CK_KEY = "Yz:yuki:bili:tempCookie";
243
+ const CK_KEY = 'Yz:yuki:bili:tempCookie';
244
244
  const tempCk = await Redis.get(CK_KEY);
245
245
  return tempCk ?? '';
246
246
  }
247
247
  /**保存tempCK*/
248
248
  async function saveTempCk(newTempCk) {
249
- const CK_KEY = "Yz:yuki:bili:tempCookie";
249
+ const CK_KEY = 'Yz:yuki:bili:tempCookie';
250
250
  await Redis.set(CK_KEY, newTempCk, { EX: 3600 * 24 * 180 });
251
251
  }
252
252
  /** 综合获取ck,返回优先级:localCK > loginCK > tempCK */
@@ -256,16 +256,16 @@ async function readSyncCookie() {
256
256
  const loginCk = await readLoginCookie();
257
257
  const validCk = (ck) => ck?.trim().length > 10;
258
258
  if (validCk(localCk)) {
259
- return { cookie: localCk, mark: "localCk" };
259
+ return { cookie: localCk, mark: 'localCk' };
260
260
  }
261
261
  else if (validCk(loginCk)) {
262
- return { cookie: loginCk + ";", mark: "loginCk" };
262
+ return { cookie: loginCk + ';', mark: 'loginCk' };
263
263
  }
264
264
  else if (validCk(tempCk)) {
265
- return { cookie: tempCk, mark: "tempCk" };
265
+ return { cookie: tempCk, mark: 'tempCk' };
266
266
  }
267
267
  else {
268
- return { cookie: '', mark: "ckIsEmpty" };
268
+ return { cookie: '', mark: 'ckIsEmpty' };
269
269
  }
270
270
  }
271
271
  /**
@@ -328,7 +328,9 @@ async function genUUID() {
328
328
  /**生成 b_lsid */
329
329
  async function gen_b_lsid() {
330
330
  function get_random_str(length) {
331
- return Array.from({ length }, () => Math.floor(Math.random() * 16).toString(16).toUpperCase()).join('');
331
+ return Array.from({ length }, () => Math.floor(Math.random() * 16)
332
+ .toString(16)
333
+ .toUpperCase()).join('');
332
334
  }
333
335
  const timestamp = Date.now();
334
336
  const randomPart = get_random_str(8);
@@ -339,10 +341,10 @@ async function gen_b_lsid() {
339
341
  async function getBuvid3_4(uuid) {
340
342
  const url = 'https://api.bilibili.com/x/frontend/finger/spi/';
341
343
  const headers = lodash.merge({}, BiliApi.BILIBILI_HEADERS, {
342
- 'Cookie': `_uuid=${uuid}`,
343
- 'Host': 'api.bilibili.com',
344
- 'Origin': 'https://www.bilibili.com',
345
- 'Referer': 'https://www.bilibili.com/',
344
+ Cookie: `_uuid=${uuid}`,
345
+ Host: 'api.bilibili.com',
346
+ Origin: 'https://www.bilibili.com',
347
+ Referer: 'https://www.bilibili.com/'
346
348
  });
347
349
  const response = await axios.get(url, { headers });
348
350
  const { code, data } = response.data;
@@ -372,152 +374,206 @@ async function getNewTempCk() {
372
374
  }
373
375
  }
374
376
  /**
375
- * *******************************************************************
376
- * 风控相关函数
377
- * *******************************************************************
378
- */
377
+ * *******************************************************************
378
+ * 风控相关函数
379
+ * *******************************************************************
380
+ */
379
381
  /**获取GatWay payload */
380
382
  async function getPayload(cookie) {
381
383
  const payloadOriginData = {
382
- "3064": 1, // ptype, mobile => 2, others => 1
383
- "5062": `${Date.now()}`, // timestamp
384
- "03bf": "https://www.bilibili.com/", // url accessed
385
- "39c8": "333.999.fp.risk",
386
- "34f1": "", // target_url, default empty now
387
- "d402": "", // screenx, default empty
388
- "654a": "", // screeny, default empty
389
- "6e7c": "878x1066", // browser_resolution, window.innerWidth || document.body && document.body.clientWidth + "x" + window.innerHeight || document.body && document.body.clientHeight
390
- "3c43": {
391
- "2673": 0, // hasLiedResolution, window.screen.width < window.screen.availWidth || window.screen.height < window.screen.availHeight
392
- "5766": 24, // colorDepth, window.screen.colorDepth
393
- "6527": 0, // addBehavior, !!window.HTMLElement.prototype.addBehavior, html5 api
394
- "7003": 1, // indexedDb, !!window.indexedDB, html5 api
395
- "807e": 1, // cookieEnabled, navigator.cookieEnabled
396
- "b8ce": BiliApi.BILIBILI_HEADERS['User-Agent'], // ua "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0",
397
- "641c": 0,
398
- "07a4": "zh-CN",
399
- "1c57": "not available",
400
- "0bd0": 16,
401
- "748e": [1920, 1200],
402
- "d61f": [1920, 1152],
403
- "fc9d": -480,
404
- "6aa9": "Asia/Shanghai",
405
- "75b8": 1,
406
- "3b21": 1,
407
- "8a1c": 0,
408
- "d52f": "not available",
409
- "adca": BiliApi.BILIBILI_HEADERS['User-Agent'].includes('Windows') ? 'Win32' : 'Linux', // platform, navigator.platform
410
- "80c9": [
411
- ["PDF Viewer", "Portable Document Format", [
412
- ["application/pdf", "pdf"],
413
- ["text/pdf", "pdf"]
414
- ]],
415
- ["Chrome PDF Viewer", "Portable Document Format", [
416
- ["application/pdf", "pdf"],
417
- ["text/pdf", "pdf"]
418
- ]],
419
- ["Chromium PDF Viewer", "Portable Document Format", [
420
- ["application/pdf", "pdf"],
421
- ["text/pdf", "pdf"]
422
- ]],
423
- ["Microsoft Edge PDF Viewer", "Portable Document Format", [
424
- ["application/pdf", "pdf"],
425
- ["text/pdf", "pdf"]
426
- ]],
427
- ["WebKit built-in PDF", "Portable Document Format", [
428
- ["application/pdf", "pdf"],
429
- ["text/pdf", "pdf"]
430
- ]]
384
+ '3064': 1, // ptype, mobile => 2, others => 1
385
+ '5062': `${Date.now()}`, // timestamp
386
+ '03bf': 'https://www.bilibili.com/', // url accessed
387
+ '39c8': '333.999.fp.risk',
388
+ '34f1': '', // target_url, default empty now
389
+ 'd402': '', // screenx, default empty
390
+ '654a': '', // screeny, default empty
391
+ '6e7c': '878x1066', // browser_resolution, window.innerWidth || document.body && document.body.clientWidth + "x" + window.innerHeight || document.body && document.body.clientHeight
392
+ '3c43': {
393
+ // 3c43 => msg
394
+ '2673': 0, // hasLiedResolution, window.screen.width < window.screen.availWidth || window.screen.height < window.screen.availHeight
395
+ '5766': 24, // colorDepth, window.screen.colorDepth
396
+ '6527': 0, // addBehavior, !!window.HTMLElement.prototype.addBehavior, html5 api
397
+ '7003': 1, // indexedDb, !!window.indexedDB, html5 api
398
+ '807e': 1, // cookieEnabled, navigator.cookieEnabled
399
+ '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',
412
+ 'adca': BiliApi.BILIBILI_HEADERS['User-Agent'].includes('Windows') ? 'Win32' : 'Linux', // platform, navigator.platform
413
+ '80c9': [
414
+ [
415
+ 'PDF Viewer',
416
+ 'Portable Document Format',
417
+ [
418
+ ['application/pdf', 'pdf'],
419
+ ['text/pdf', 'pdf']
420
+ ]
421
+ ],
422
+ [
423
+ 'Chrome PDF Viewer',
424
+ 'Portable Document Format',
425
+ [
426
+ ['application/pdf', 'pdf'],
427
+ ['text/pdf', 'pdf']
428
+ ]
429
+ ],
430
+ [
431
+ 'Chromium PDF Viewer',
432
+ 'Portable Document Format',
433
+ [
434
+ ['application/pdf', 'pdf'],
435
+ ['text/pdf', 'pdf']
436
+ ]
437
+ ],
438
+ [
439
+ 'Microsoft Edge PDF Viewer',
440
+ 'Portable Document Format',
441
+ [
442
+ ['application/pdf', 'pdf'],
443
+ ['text/pdf', 'pdf']
444
+ ]
445
+ ],
446
+ [
447
+ 'WebKit built-in PDF',
448
+ 'Portable Document Format',
449
+ [
450
+ ['application/pdf', 'pdf'],
451
+ ['text/pdf', 'pdf']
452
+ ]
453
+ ]
454
+ ],
455
+ '13ab': 'f3YAAAAASUVORK5CYII=',
456
+ 'bfe9': 'kABYpRAGAVYzWJooB9Bf4P+UortSvxRY0AAAAASUVORK5CYII=',
457
+ 'a3c1': [
458
+ '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
+ 'webgl aliased line width range:[1, 1]',
460
+ 'webgl aliased point size range:[1, 1024]',
461
+ 'webgl alpha bits:8',
462
+ 'webgl antialiasing:yes',
463
+ 'webgl blue bits:8',
464
+ 'webgl depth bits:24',
465
+ 'webgl green bits:8',
466
+ 'webgl max anisotropy:16',
467
+ 'webgl max combined texture image units:32',
468
+ 'webgl max cube map texture size:16384',
469
+ 'webgl max fragment uniform vectors:1024',
470
+ 'webgl max render buffer size:16384',
471
+ 'webgl max texture image units:16',
472
+ 'webgl max texture size:16384',
473
+ 'webgl max varying vectors:30',
474
+ 'webgl max vertex attribs:16',
475
+ 'webgl max vertex texture image units:16',
476
+ 'webgl max vertex uniform vectors:4096',
477
+ 'webgl max viewport dims:[32767, 32767]',
478
+ 'webgl red bits:8',
479
+ 'webgl renderer:ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0), or similar',
480
+ 'webgl shading language version:WebGL GLSL ES 1.0',
481
+ 'webgl stencil bits:0',
482
+ 'webgl vendor:Mozilla',
483
+ 'webgl version:WebGL 1.0',
484
+ 'webgl unmasked vendor:Google Inc. (Intel)',
485
+ 'webgl unmasked renderer:ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0), or similar',
486
+ 'webgl vertex shader high float precision:23',
487
+ 'webgl vertex shader high float precision rangeMin:127',
488
+ 'webgl vertex shader high float precision rangeMax:127',
489
+ 'webgl vertex shader medium float precision:23',
490
+ 'webgl vertex shader medium float precision rangeMin:127',
491
+ 'webgl vertex shader medium float precision rangeMax:127',
492
+ 'webgl vertex shader low float precision:23',
493
+ 'webgl vertex shader low float precision rangeMin:127',
494
+ 'webgl vertex shader low float precision rangeMax:127',
495
+ 'webgl fragment shader high float precision:23',
496
+ 'webgl fragment shader high float precision rangeMin:127',
497
+ 'webgl fragment shader high float precision rangeMax:127',
498
+ 'webgl fragment shader medium float precision:23',
499
+ 'webgl fragment shader medium float precision rangeMin:127',
500
+ 'webgl fragment shader medium float precision rangeMax:127',
501
+ 'webgl fragment shader low float precision:23',
502
+ 'webgl fragment shader low float precision rangeMin:127',
503
+ 'webgl fragment shader low float precision rangeMax:127',
504
+ 'webgl vertex shader high int precision:0',
505
+ 'webgl vertex shader high int precision rangeMin:31',
506
+ 'webgl vertex shader high int precision rangeMax:30',
507
+ 'webgl vertex shader medium int precision:0',
508
+ 'webgl vertex shader medium int precision rangeMin:31',
509
+ 'webgl vertex shader medium int precision rangeMax:30',
510
+ 'webgl vertex shader low int precision:0',
511
+ 'webgl vertex shader low int precision rangeMin:31',
512
+ 'webgl vertex shader low int precision rangeMax:30',
513
+ 'webgl fragment shader high int precision:0',
514
+ 'webgl fragment shader high int precision rangeMin:31',
515
+ 'webgl fragment shader high int precision rangeMax:30',
516
+ 'webgl fragment shader medium int precision:0',
517
+ 'webgl fragment shader medium int precision rangeMin:31',
518
+ 'webgl fragment shader medium int precision rangeMax:30',
519
+ 'webgl fragment shader low int precision:0',
520
+ 'webgl fragment shader low int precision rangeMin:31',
521
+ 'webgl fragment shader low int precision rangeMax:30'
431
522
  ],
432
- "13ab": "f3YAAAAASUVORK5CYII=",
433
- "bfe9": "kABYpRAGAVYzWJooB9Bf4P+UortSvxRY0AAAAASUVORK5CYII=",
434
- "a3c1": [
435
- "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",
436
- "webgl aliased line width range:[1, 1]",
437
- "webgl aliased point size range:[1, 1024]",
438
- "webgl alpha bits:8", "webgl antialiasing:yes",
439
- "webgl blue bits:8",
440
- "webgl depth bits:24",
441
- "webgl green bits:8",
442
- "webgl max anisotropy:16",
443
- "webgl max combined texture image units:32",
444
- "webgl max cube map texture size:16384",
445
- "webgl max fragment uniform vectors:1024",
446
- "webgl max render buffer size:16384",
447
- "webgl max texture image units:16",
448
- "webgl max texture size:16384",
449
- "webgl max varying vectors:30",
450
- "webgl max vertex attribs:16",
451
- "webgl max vertex texture image units:16",
452
- "webgl max vertex uniform vectors:4096",
453
- "webgl max viewport dims:[32767, 32767]",
454
- "webgl red bits:8",
455
- "webgl renderer:ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0), or similar",
456
- "webgl shading language version:WebGL GLSL ES 1.0",
457
- "webgl stencil bits:0",
458
- "webgl vendor:Mozilla",
459
- "webgl version:WebGL 1.0",
460
- "webgl unmasked vendor:Google Inc. (Intel)",
461
- "webgl unmasked renderer:ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0), or similar",
462
- "webgl vertex shader high float precision:23",
463
- "webgl vertex shader high float precision rangeMin:127",
464
- "webgl vertex shader high float precision rangeMax:127",
465
- "webgl vertex shader medium float precision:23",
466
- "webgl vertex shader medium float precision rangeMin:127",
467
- "webgl vertex shader medium float precision rangeMax:127",
468
- "webgl vertex shader low float precision:23",
469
- "webgl vertex shader low float precision rangeMin:127",
470
- "webgl vertex shader low float precision rangeMax:127",
471
- "webgl fragment shader high float precision:23",
472
- "webgl fragment shader high float precision rangeMin:127",
473
- "webgl fragment shader high float precision rangeMax:127",
474
- "webgl fragment shader medium float precision:23",
475
- "webgl fragment shader medium float precision rangeMin:127",
476
- "webgl fragment shader medium float precision rangeMax:127",
477
- "webgl fragment shader low float precision:23",
478
- "webgl fragment shader low float precision rangeMin:127",
479
- "webgl fragment shader low float precision rangeMax:127",
480
- "webgl vertex shader high int precision:0",
481
- "webgl vertex shader high int precision rangeMin:31",
482
- "webgl vertex shader high int precision rangeMax:30",
483
- "webgl vertex shader medium int precision:0",
484
- "webgl vertex shader medium int precision rangeMin:31",
485
- "webgl vertex shader medium int precision rangeMax:30",
486
- "webgl vertex shader low int precision:0",
487
- "webgl vertex shader low int precision rangeMin:31",
488
- "webgl vertex shader low int precision rangeMax:30",
489
- "webgl fragment shader high int precision:0",
490
- "webgl fragment shader high int precision rangeMin:31",
491
- "webgl fragment shader high int precision rangeMax:30",
492
- "webgl fragment shader medium int precision:0",
493
- "webgl fragment shader medium int precision rangeMin:31",
494
- "webgl fragment shader medium int precision rangeMax:30",
495
- "webgl fragment shader low int precision:0",
496
- "webgl fragment shader low int precision rangeMin:31",
497
- "webgl fragment shader low int precision rangeMax:30"
523
+ '6bc5': 'Google Inc. (Intel)~ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0), or similar',
524
+ 'ed31': 0,
525
+ '72bd': 0,
526
+ '097b': 0,
527
+ '52cd': [0, 0, 0],
528
+ 'a658': [
529
+ 'Arial',
530
+ 'Arial Black',
531
+ 'Calibri',
532
+ 'Cambria',
533
+ 'Cambria Math',
534
+ 'Comic Sans MS',
535
+ 'Consolas',
536
+ 'Courier',
537
+ 'Courier New',
538
+ 'Georgia',
539
+ 'Helvetica',
540
+ 'Impact',
541
+ 'Lucida Console',
542
+ 'Lucida Sans Unicode',
543
+ 'Microsoft Sans Serif',
544
+ 'MS Gothic',
545
+ 'MS PGothic',
546
+ 'MS Sans Serif',
547
+ 'MS Serif',
548
+ 'Palatino Linotype',
549
+ 'Segoe Print',
550
+ 'Segoe Script',
551
+ 'Segoe UI',
552
+ 'Segoe UI Light',
553
+ 'Segoe UI Symbol',
554
+ 'Tahoma',
555
+ 'Times',
556
+ 'Times New Roman',
557
+ 'Trebuchet MS',
558
+ 'Verdana',
559
+ 'Wingdings'
498
560
  ],
499
- "6bc5": "Google Inc. (Intel)~ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0), or similar",
500
- "ed31": 0,
501
- "72bd": 0,
502
- "097b": 0,
503
- "52cd": [0, 0, 0],
504
- "a658": ["Arial", "Arial Black", "Calibri", "Cambria", "Cambria Math", "Comic Sans MS", "Consolas", "Courier", "Courier New", "Georgia", "Helvetica", "Impact", "Lucida Console", "Lucida Sans Unicode", "Microsoft Sans Serif", "MS Gothic", "MS PGothic", "MS Sans Serif", "MS Serif", "Palatino Linotype", "Segoe Print", "Segoe Script", "Segoe UI", "Segoe UI Light", "Segoe UI Symbol", "Tahoma", "Times", "Times New Roman", "Trebuchet MS", "Verdana", "Wingdings"],
505
- "d02f": "35.749972093850374"
561
+ 'd02f': '35.749972093850374'
506
562
  },
507
- "54ef": {
508
- "in_new_ab ": true,
509
- "ab_version ": {
510
- "waterfall_article ": "SHOW "
563
+ '54ef': {
564
+ 'in_new_ab ': true,
565
+ 'ab_version ': {
566
+ 'waterfall_article ': 'SHOW '
511
567
  },
512
- "ab_split_num ": {
513
- "waterfall_article ": 0
568
+ 'ab_split_num ': {
569
+ 'waterfall_article ': 0
514
570
  }
515
571
  },
516
- "8b94": "",
517
- "df35": `${await readSavedCookieItems(cookie, ['_uuid'], false)}`, // _uuid, set from cookie, generated by client side(algorithm remains unknown)
518
- "07a4": "zh-CN",
519
- "5f45": null,
520
- "db46": 0
572
+ '8b94': '',
573
+ 'df35': `${await readSavedCookieItems(cookie, ['_uuid'], false)}`, // _uuid, set from cookie, generated by client side(algorithm remains unknown)
574
+ '07a4': 'zh-CN',
575
+ '5f45': null,
576
+ 'db46': 0
521
577
  };
522
578
  return JSON.stringify(payloadOriginData);
523
579
  }
@@ -532,11 +588,11 @@ async function postGateway(cookie) {
532
588
  const config = {
533
589
  headers: lodash.merge({}, BiliApi.BILIBILI_HEADERS, {
534
590
  'Cookie': cookie,
535
- 'Content-type': 'application/json;charset=UTF-8',
591
+ 'Content-type': 'application/json;charset=UTF-8'
536
592
  }, {
537
- 'Host': 'api.bilibili.com',
538
- 'Origin': 'https://www.bilibili.com',
539
- 'Referer': 'https://www.bilibili.com/',
593
+ Host: 'api.bilibili.com',
594
+ Origin: 'https://www.bilibili.com',
595
+ Referer: 'https://www.bilibili.com/'
540
596
  })
541
597
  };
542
598
  try {
@@ -554,7 +610,7 @@ async function postGateway(cookie) {
554
610
  * @returns {Promise<{ cookie: string; }>} 返回包含最新有效的bili_ticket的cookie
555
611
  */
556
612
  async function cookieWithBiliTicket(cookie) {
557
- const BiliJctKey = "Yz:yuki:bili:bili_ticket";
613
+ const BiliJctKey = 'Yz:yuki:bili:bili_ticket';
558
614
  cookie = await readSavedCookieItems(cookie, ['bili_ticket'], true);
559
615
  const biliTicket = await Redis.get(BiliJctKey);
560
616
  if (!biliTicket) {
@@ -17,9 +17,9 @@ export declare class BiliQuery {
17
17
  */
18
18
  static parseRichTextNodes: (nodes: any[] | string | any) => any;
19
19
  /**获取完整B站文章内容
20
- * @param postUrl - 文章链接: https://www.bilibili.com/read/cvxxxx 或者 https://www.bilibili.com/opus/xxxx
21
- * @returns {Json} 完整的B站文章内容json数据
22
- */
20
+ * @param postUrl - 文章链接: https://www.bilibili.com/read/cvxxxx 或者 https://www.bilibili.com/opus/xxxx
21
+ * @returns {Json} 完整的B站文章内容json数据
22
+ */
23
23
  static getFullArticleContent(postUrl: string): Promise<{
24
24
  readInfo: any;
25
25
  articleType: string;
@@ -27,8 +27,8 @@ export declare class BiliQuery {
27
27
  /**解析旧版完整文章内容 */
28
28
  static praseFullOldTypeArticleContent(content: string): string;
29
29
  /**解析新版完整文章内容
30
- * @param paragraphs - MODULE_TYPE_CONTENT 类型文章的段落数组
31
- */
30
+ * @param paragraphs - MODULE_TYPE_CONTENT 类型文章的段落数组
31
+ */
32
32
  static praseFullNewTypeArticleContent: (paragraphs: any[] | any) => {
33
33
  content: string;
34
34
  img: any[];