Make BiliBili Great Again

useful tweaks for bilibili.com

< 脚本 Make BiliBili Great Again 的反馈

评价:好评 - 脚本运行良好

§
发布于:2025-10-03

bug:个人空间 投稿视频 空白
chrome F12 错误日志
index-178167ec.js:47 http-svc-risk-user-log: TypeError: Cannot read properties of undefined (reading 'toString')
at userscript.html?name=Bilibili-%25E9%2598%25B2%25E6%25AD%25A2%25E8%25A7%2586%25E9%25A2%2591%25E8%25A2%25AB%25E8%2587%25AA%25E5%258A%25A8%25E6%259A%2582%25E5%2581%259C%25E5%258F%258A%25E5%25BC%25B9%25E5%2587%25BA%25E7%2599%25BB%25E5%25BD%2595%25E7%25AA%2597%25E5%258F%25A3.user.js&id=f9b7253a-2dd6-4411-b833-e1e9b3d4b8ae:126:35
at Array.map ()
at getWbiQueryString (userscript.html?name=Bilibili-%25E9%2598%25B2%25E6%25AD%25A2%25E8%25A7%2586%25E9%25A2%2591%25E8%25A2%25AB%25E8%2587%25AA%25E5%258A%25A8%25E6%259A%2582%25E5%2581%259C%25E5%258F%258A%25E5%25BC%25B9%25E5%2587%25BA%25E7%2599%25BB%25E5%25BD%2595%25E7%25AA%2597%25E5%258F%25A3.user.js&id=f9b7253a-2dd6-4411-b833-e1e9b3d4b8ae:125:8)
at async window.fetch (userscript.html?name=Bilibili-%25E9%2598%25B2%25E6%25AD%25A2%25E8%25A7%2586%25E9%25A2%2591%25E8%25A2%25AB%25E8%2587%25AA%25E5%258A%25A8%25E6%259A%2582%25E5%2581%259C%25E5%258F%258A%25E5%25BC%25B9%25E5%2587%25BA%25E7%2599%25BB%25E5%25BD%2595%25E7%25AA%2597%25E5%258F%25A3.user.js&id=f9b7253a-2dd6-4411-b833-e1e9b3d4b8ae:46:29)
at async Cf.Rw [as handler] (index-178167ec.js:42:38075)
at async v (index-178167ec.js:42:44751)
at async mk.Sw (index-178167ec.js:42:35508)
at async mk.handler (index-178167ec.js:42:30292)
at async v (index-178167ec.js:42:44751)
at async gk.Tw (index-178167ec.js:42:36571)
Hw @ index-178167ec.js:47

不太对,好像是和这个脚本(https://gf.qytechs.cn/zh-CN/scripts/467474-bilibili-%E9%98%B2%E6%AD%A2%E8%A7%86%E9%A2%91%E8%A2%AB%E8%87%AA%E5%8A%A8%E6%9A%82%E5%81%9C%E5%8F%8A%E5%BC%B9%E5%87%BA%E7%99%BB%E5%BD%95%E7%AA%97%E5%8F%A3)有冲突,导致的。单独用你们两个脚本都能显示,一起用就不行,真奇怪。
可是另一个脚本是刚需,两边都发一下,看看有没有解决方案

§
发布于:2025-10-03

问了下ai 说是这样改,虽然报错更多了,但是可以显示了

async function getWbiQueryString(params, fingerprint) {
// ...(省略前面的代码)

// modify params(重点修改这里,确保fingerprint元素存在)
params.dm_img_list = fingerprint[0] ?? ''; // 若为undefined则设为空字符串
params.dm_img_str = fingerprint[1] ?? '';
params.dm_cover_img_str = fingerprint[2] ?? '';
params.dm_img_inter = fingerprint[3] ?? '';
params.wts = Math.round(Date.now() / 1000);
delete params.w_rid;

// generate basic query string(修改这里,处理可能为undefined的value)
const query = Object
.keys(params)
.sort()
.map(key => {
const value = params[key] !== undefined ? params[key].toString().replace(/[!'()*]/g, '') : '';
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`
})
.join('&');

// ...(省略后面的代码)
}

如果修改后仍有问题,可能是fingerprint本身未正确获取(比如window.__biliUserFp__不存在或queryUserLog返回空),可以在获取fingerprint的地方添加日志排查:
javascript

// 在获取fingerprint的地方添加
let fingerprint = window.__biliUserFp__?.queryUserLog({}) || [];
console.log('获取到的fingerprint:', fingerprint); // 查看控制台输出

先凑合用吧,看看是不是真的解决了

发布留言

登录(不可用)以发布留言。

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址