Skip to content

Commit

Permalink
fix: getBiliUserInfoByUid
Browse files Browse the repository at this point in the history
  • Loading branch information
snowtafir committed Oct 26, 2024
1 parent 63f6ea2 commit 8f83f4d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions models/bilibili/bilibili.main.get.web.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,17 @@ export class BiliGetWebData {
let { cookie } = await readSyncCookie();
cookie = await cookieWithBiliTicket(cookie);
const dmImg = await getDmImg();
const w_webid = await getWebId(uid);

const data = {
mid: uid,
token: '',
platform: 'web',
web_location: 1550101,
...dmImg
...dmImg,
w_webid: w_webid
};
let signCookie = (await readSavedCookieItems(cookie, ['SESSDATA'], false)) || (await readSavedCookieOtherItems(cookie, ['SESSDATA']));
const w_webid = await getWebId(uid);
const { w_rid, time_stamp } = await getWbiSign(data, BiliApi.BILIBILI_HEADERS, signCookie);
const params = {
...data,
Expand Down
4 changes: 2 additions & 2 deletions models/bilibili/bilibili.risk.dm.img.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export async function getDmImg() {
const dm_cover_img_str = 'QU5HTEUgKEludGVsLCBJbnRlbChSKSBIRCBHcmFwaGljcyBEaXJlY3QzRDExIHZzXzVfMCBwc181XzApLCBvciBzaW1pbGFyR29vZ2xlIEluYy4gKEludGVsKQ';
const dm_img_inter = { ds: [], wh: [0, 0, 0], of: [0, 0, 0] };
return {
dm_img_list: dm_img_list,
dm_img_list: String(dm_img_list).replace(/\s+/g, ''),
dm_img_str: dm_img_str,
dm_cover_img_str: dm_cover_img_str,
dm_img_inter: dm_img_inter
dm_img_inter: String(dm_img_inter).replace(/\s+/g, '')
};
}
4 changes: 2 additions & 2 deletions models/bilibili/bilibili.risk.w_webid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export async function getWebId(uid?: number) {
const w_webid_key = 'Yz:yuki:bili:w_webid';
const w_webid = await Redis.get(w_webid_key);
if (w_webid) {
return w_webid;
return String(w_webid);
} else {
const url = `https://space.bilibili.com/${uid ? uid : 401742377}/dynamic`;
let { cookie } = await readSyncCookie();
Expand All @@ -31,7 +31,7 @@ export async function getWebId(uid?: number) {
const access_id = decoded__RENDER_DATA__JsonString.match(accessIdRegex);
if (access_id && access_id[1]) {
await Redis.set(w_webid_key, access_id[1], { EX: 43197 * 1000 });
return access_id[1];
return String(access_id[1]);
} else {
console.error('Failed to get access_id from __RENDER_DATA__');
return null;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yuki-plugin",
"version": "2.0.5-10",
"version": "2.0.5-11",
"author": "snowtafir",
"description": "优纪插件,yunzai-V4 关于 微博推送、B站推送 等功能的拓展插件",
"main": "./index",
Expand Down

0 comments on commit 8f83f4d

Please sign in to comment.