yz-yuki-plugin 2.0.5-1 → 2.0.5-2
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/lib/apps/bilibili.js
CHANGED
|
@@ -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');
|
|
@@ -60,8 +60,8 @@ async function applyLoginQRCode(e) {
|
|
|
60
60
|
return qrcodeKey;
|
|
61
61
|
}
|
|
62
62
|
else {
|
|
63
|
-
e.reply(`获取B站登录二维码失败: ${res.data
|
|
64
|
-
throw new Error(`获取B站登录二维码失败: ${res.data
|
|
63
|
+
e.reply(`获取B站登录二维码失败: ${res.data?.message}`);
|
|
64
|
+
throw new Error(`获取B站登录二维码失败: ${res.data?.message}`);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
/**处理扫码结果 */
|
|
@@ -149,12 +149,16 @@ async function exitBiliLogin(e) {
|
|
|
149
149
|
e.reply('当前无可用的B站登录CK可退出登录');
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
|
-
const postData =
|
|
152
|
+
const postData = String(biliCSRF)
|
|
153
|
+
.trim()
|
|
154
|
+
.replace(/^bili_jct=/g, '')
|
|
155
|
+
.replace(/;*$/g, '');
|
|
153
156
|
try {
|
|
154
|
-
const resp = await axios.post(url, postData
|
|
157
|
+
const resp = await axios.post(url, { biliCSRF: postData }, {
|
|
155
158
|
headers: {
|
|
156
159
|
'Host': 'passport.bilibili.com',
|
|
157
|
-
'
|
|
160
|
+
'User-Agent': BiliApi.BILIBILI_HEADERS['User-Agent'],
|
|
161
|
+
'Cookie': `${DedeUserID};${biliCSRF};${SESSDATA}`,
|
|
158
162
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
159
163
|
}
|
|
160
164
|
});
|
|
@@ -163,29 +167,27 @@ async function exitBiliLogin(e) {
|
|
|
163
167
|
e.reply('当前缓存的B站登录CK早已失效!');
|
|
164
168
|
return;
|
|
165
169
|
}
|
|
166
|
-
const
|
|
167
|
-
logger.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
else {
|
|
183
|
-
e.reply('服务器响应异常,退出登录请求出错');
|
|
170
|
+
const res = resp.data;
|
|
171
|
+
logger?.debug(`exitBiliLogin: ${JSON.stringify(res)}`);
|
|
172
|
+
const { code } = res;
|
|
173
|
+
switch (code) {
|
|
174
|
+
case 0:
|
|
175
|
+
e.reply('当前缓存的B站登录CK已在B站服务器退出登录~');
|
|
176
|
+
break;
|
|
177
|
+
case 2202:
|
|
178
|
+
e.reply('csrf 请求非法,退出登录请求出错');
|
|
179
|
+
break;
|
|
180
|
+
case -101:
|
|
181
|
+
e.reply('当前缓存的扫码B站ck未登录!');
|
|
182
|
+
break;
|
|
183
|
+
default:
|
|
184
|
+
e.reply('未知情况!无妨');
|
|
185
|
+
return;
|
|
184
186
|
}
|
|
185
187
|
}
|
|
186
188
|
catch (error) {
|
|
189
|
+
e.reply('退出登录请求出错');
|
|
187
190
|
console.error('Error during Bili login exit:', error);
|
|
188
|
-
e.reply('退出登录请求出错,请稍后再试');
|
|
189
191
|
}
|
|
190
192
|
}
|
|
191
193
|
/**
|
|
@@ -397,18 +399,18 @@ async function getPayload(cookie) {
|
|
|
397
399
|
'7003': 1, // indexedDb, !!window.indexedDB, html5 api
|
|
398
400
|
'807e': 1, // cookieEnabled, navigator.cookieEnabled
|
|
399
401
|
'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',
|
|
402
|
+
'641c': 0, // webdriver, navigator.webdriver, like Selenium
|
|
403
|
+
'07a4': 'zh-CN', // language
|
|
404
|
+
'1c57': 'not available', // deviceMemory in GB, navigator.deviceMemory
|
|
405
|
+
'0bd0': 16, // hardwareConcurrency, navigator.hardwareConcurrency
|
|
406
|
+
'748e': [1920, 1200], // window.screen.width window.screen.height
|
|
407
|
+
'd61f': [1920, 1152], // window.screen.availWidth window.screen.availHeight
|
|
408
|
+
'fc9d': -480, // timezoneOffset, (new Date).getTimezoneOffset()
|
|
409
|
+
'6aa9': 'Asia/Shanghai', //Intl.DateTimeFormat().resolvedOptions().timeZone, // timezone, (new window.Intl.DateTimeFormat).resolvedOptions().timeZone
|
|
410
|
+
'75b8': 1, // sessionStorage, window.sessionStorage, html5 api
|
|
411
|
+
'3b21': 1, // localStorage, window.localStorage, html5 api
|
|
412
|
+
'8a1c': 0, // openDatabase, window.openDatabase, html5 api
|
|
413
|
+
'd52f': 'not available', // cpuClass, navigator.cpuClass
|
|
412
414
|
'adca': BiliApi.BILIBILI_HEADERS['User-Agent'].includes('Windows') ? 'Win32' : 'Linux', // platform, navigator.platform
|
|
413
415
|
'80c9': [
|
|
414
416
|
[
|
|
@@ -451,9 +453,9 @@ async function getPayload(cookie) {
|
|
|
451
453
|
['text/pdf', 'pdf']
|
|
452
454
|
]
|
|
453
455
|
]
|
|
454
|
-
],
|
|
455
|
-
'13ab': 'f3YAAAAASUVORK5CYII=',
|
|
456
|
-
'bfe9': 'kABYpRAGAVYzWJooB9Bf4P+UortSvxRY0AAAAASUVORK5CYII=',
|
|
456
|
+
], // plugins
|
|
457
|
+
'13ab': 'f3YAAAAASUVORK5CYII=', // canvas fingerprint
|
|
458
|
+
'bfe9': 'kABYpRAGAVYzWJooB9Bf4P+UortSvxRY0AAAAASUVORK5CYII=', // webgl_str
|
|
457
459
|
'a3c1': [
|
|
458
460
|
'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
461
|
'webgl aliased line width range:[1, 1]',
|
|
@@ -519,8 +521,8 @@ async function getPayload(cookie) {
|
|
|
519
521
|
'webgl fragment shader low int precision:0',
|
|
520
522
|
'webgl fragment shader low int precision rangeMin:31',
|
|
521
523
|
'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',
|
|
524
|
+
], // webgl_params, cab be set to [] if webgl is not supported
|
|
525
|
+
'6bc5': 'Google Inc. (Intel)~ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0), or similar', // webglVendorAndRenderer
|
|
524
526
|
'ed31': 0,
|
|
525
527
|
'72bd': 0,
|
|
526
528
|
'097b': 0,
|