-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[新增/更新请求] 更新漫画的ImageToken
GetImageIndex
ComicDetail
接口
#1168
Comments
ImageToken
与GetImageIndex
接口的请求参数ImageToken
GetImageIndex
ComicDetail
接口的请求参数
ImageToken
GetImageIndex
ComicDetail
接口的请求参数ImageToken
GetImageIndex
ComicDetail
接口
ImageToken返回的 |
刚刚发现 {
"code": 99,
"msg": "业务异常,请稍后再试。"
} |
|
该 pr 有待进一步扩展内容? |
我想这应该是最后一个需要进一步逆向的参数了 |
抱歉瞎了,我以为这是 issue |
喜报:https://manga.bilibili.com/classify 页对应 api https://manga.bilibili.com/twirp/comic.v1.Comic/ClassPage 也出现了 |
// From https://s1.hdslb.com/bfs/manga-static/manga-pc/static/js/bili.929f6b576d.js
const a = async (e, t, a) => {
await async function() {
if (!r)
try {
const e = new Go
, t = new URL(n("4h2B"),n.b)
, i = await fetch(t)
, a = await i.arrayBuffer();
o = await WebAssembly.compile(a),
r = await WebAssembly.instantiate(o, e.importObject),
e.run(r)
} catch (e) {
throw console.error("Failed to initialize WASM:", e),
e
}
}();
const c = i();
if (void 0 === c.genReqSign)
throw new Error("WASM function not available");
const u = a || Date.now();
if (13 !== u.toString().length)
throw new Error("Timestamp must be a 13-digit number");
const s = c.genReqSign(e, t, u);
if (s.error)
throw new Error(s.error);
return s.sign
} 其中传入genReqSign的三个参数依次是
|
|
刚刚发现他们居然把这个函数注册到 除了时间戳不一样,其他两个参数都是我上一条comment的示例参数 结果: {
"error": null,
"sign": "QkYG69s3Ysh6sfXh4cKbDXR4YKwKQashhRLka9aQ41shs6Re"
} 顺便补充一下, |
刚刚逆了一下,这 wasm python 肯定得浏览器模拟才能导入了用了...有 gojs |
反正 wasm 就是胶水, 没必要逆, 直接拿来用就得了, KPI 产物估计是, 美名其曰前端防破解() 比 js 加混淆还好, js 混淆还得一顿找, 这种直接给 wasm 了 |
我的意思是 bilibili-api-python 那边就只能开摆了…GG |
位操作+md5 |
那没办法, 而且拿 Go 弄的, tmd 一个 wasm 没啥功能就逆天 2 MB, 逆向都看大半天(丢给 DeepSeek 看了) |
app端同样有这个参数, 不出所料的在 |
给各位提供一个nodejs调用样例 // https://github.com/golang/go/blob/master/lib/wasm/wasm_exec.js
import { Go } from './wasm_exec.js';
import fs from 'fs';
function getArrayBuffer(path) {
const buffer = fs.readFileSync(path);
return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
}
async function genReqSign(query, body) {
const go = new Go();
// https://s1.hdslb.com/bfs/manga-static/manga-pc/6732b1bf426cfc634293.wasm
const buffer = getArrayBuffer("./manga.wasm");
const result = await WebAssembly.compile(buffer);
const instance = await WebAssembly.instantiate(result, go.importObject);
go.run(instance);
if (void 0 === globalThis.genReqSign) {
throw new Error("WASM function not available");
}
const signature = globalThis.genReqSign(
query.toString(),
JSON.stringify(body),
Date.now()
);
return signature.sign;
}
genReqSign(
new URLSearchParams({
"device": "pc",
"platform": "web",
"nov": 25,
}),
{"style_id":-1,"area_id":-1,"is_finish":-1,"order":0,"special_tag":0,"page_num":1,"page_size":18,"is_free":-1}
); |
话说能不能逆向 bilibili 漫画 uwp 分析 |
还在更新么, 如果能看的话就可以 |
不知道。不知道。 希望都是。 |
我给deepseek直接卡死了=。= |
WASM 逆向的话还是得 debug 看内存, 静态分析只能看出来大致在干什么. 但是 Firefox 一下断点就卡死, 绷不住了... 这个 ultra_sign 确实很有难度啊() |
抓了几次包,发现前几天的那次更新除了加了 |
我昨天试出了几次没加密的情况, |
@btjawa Thank you very much for this great work! I would like to adapt and integrate it into RSSHub via DIYgod/RSSHub#18300. Are you okay with that? |
@yan12125 Sure! I'm totally fine with that. |
As suggested in SocialSisterYi/bilibili-API-collect#1168 (comment)
Cool, thanks! |
提交前请确认
API 来源
Web 端(含 h5)
API 类型
REST
API 地址
https://manga.bilibili.com/twirp/comic.v1.Comic/ImageToken 与 https://manga.bilibili.com/twirp/comic.v1.Comic/GetImageIndex 与
https://manga.bilibili.com/twirp/comic.v1.Comic/ComicDetail
详情描述
这三个接口的URL参数已变为
ImageToken接口的正文参数有以下变动:
urls
数组内的url变为相对路径m1
参数逆向发现
m1
参数可以由下方的算法生成(JS/TS)实际测试接口发现请求需要的
m1
参数为上方算法返回的key
而非m1
,算法中返回的(见下一条Comment)m1
目前不知道需要在哪里使用以及发现请求时的
m1
写死,urls
不同的情况下也可以正常获得数据ImageToken的返回数据也有所变动:
最终的完整url直接被放置在了一个新的
complete_url
键内,不再单独存放url与tokenThe text was updated successfully, but these errors were encountered: