From c18f38691503e705383f5e18a0117de18c3afd73 Mon Sep 17 00:00:00 2001 From: snowtafir Date: Wed, 23 Oct 2024 13:23:18 +0800 Subject: [PATCH] optimize: add dm_img params --- models/bilibili/bilibili.dm.img.ts | 13 +++++++++++++ models/bilibili/bilibili.get.web.data.ts | 4 +++- package.json | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 models/bilibili/bilibili.dm.img.ts diff --git a/models/bilibili/bilibili.dm.img.ts b/models/bilibili/bilibili.dm.img.ts new file mode 100644 index 0000000..3f48434 --- /dev/null +++ b/models/bilibili/bilibili.dm.img.ts @@ -0,0 +1,13 @@ +/**获取dm参数 */ +export async function getDmImg() { + const dm_img_list = []; + //Buffer.from("WebGL 1", 'utf-8').toString("base64") //webgl version的值 WebGL 1 的base64 编码 + const dm_img_str = 'V2ViR0wgMS'; + //webgl unmasked renderer的值拼接webgl unmasked vendor的值的base64编码 + const dm_cover_img_str = 'QU5HTEUgKEludGVsLCBJbnRlbChSKSBIRCBHcmFwaGljcyBEaXJlY3QzRDExIHZzXzVfMCBwc181XzApLCBvciBzaW1pbGFyR29vZ2xlIEluYy4gKEludGVsKQ'; + return { + dm_img_list: dm_img_list, + dm_img_str: dm_img_str, + dm_cover_img_str: dm_cover_img_str + }; +} diff --git a/models/bilibili/bilibili.get.web.data.ts b/models/bilibili/bilibili.get.web.data.ts index 25b862b..68a8543 100644 --- a/models/bilibili/bilibili.get.web.data.ts +++ b/models/bilibili/bilibili.get.web.data.ts @@ -3,6 +3,7 @@ import lodash from 'lodash'; import { BiliApi } from '@/models/bilibili/bilibili.api'; import { cookieWithBiliTicket, readSavedCookieItems, readSavedCookieOtherItems, readSyncCookie } from '@/models/bilibili/bilibili.models'; import { getWbiSign } from '@/models/bilibili/bilibili.wbi'; +import { getDmImg } from '@/models/bilibili/bilibili.dm.img'; export class BiliGetWebData { constructor(e?) {} @@ -12,6 +13,7 @@ export class BiliGetWebData { const url = BiliApi.BILIBIL_API.biliDynamicInfoList; let { cookie } = await readSyncCookie(); cookie = await cookieWithBiliTicket(cookie); + const dmImg = await getDmImg(); const data = { 'offset': '', @@ -20,7 +22,7 @@ export class BiliGetWebData { 'platform': 'web', 'features': 'itemOpusStyle,listOnlyfans,opusBigCover,onlyfansVote', 'web_location': '333.999', - //...getDmImg(), + ...dmImg, 'x-bili-device-req-json': { platform: 'web', device: 'pc' }, 'x-bili-web-req-json': { spm_id: '333.999' } }; diff --git a/package.json b/package.json index bef84c5..38a3ad7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yuki-plugin", - "version": "2.0.5-6", + "version": "2.0.5-7", "author": "snowtafir", "description": "优纪插件,yunzai-V4 关于 微博推送、B站推送 等功能的拓展插件", "main": "./index",