Skip to content

Commit

Permalink
optimize: add dm_img params
Browse files Browse the repository at this point in the history
  • Loading branch information
snowtafir committed Oct 23, 2024
1 parent ae633da commit 4b2e0d5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yz-yuki-plugin",
"version": "2.0.5-6",
"version": "2.0.5-7",
"description": "优纪插件,yunzaijs 关于 微博推送、B站推送 等功能的拓展插件",
"author": "snowtafir",
"type": "module",
Expand Down
13 changes: 13 additions & 0 deletions src/models/bilibili/bilibili.dm.img.ts
Original file line number Diff line number Diff line change
@@ -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
};
}
4 changes: 3 additions & 1 deletion src/models/bilibili/bilibili.get.web.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import lodash from 'lodash';
import { BiliApi } from '@src/models/bilibili//bilibili.api';
import { cookieWithBiliTicket, readSavedCookieItems, readSavedCookieOtherItems, readSyncCookie } from '@src/models/bilibili/bilibili.models';
import { getWbiSign } from '@src/models/bilibili//bilibili.wbi';
import { getDmImg } from '@src/models/bilibili/bilibili.dm.img';

export class BiliGetWebData {
constructor(e?) {}
Expand All @@ -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': '',
Expand All @@ -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' }
};
Expand Down

0 comments on commit 4b2e0d5

Please sign in to comment.