Skip to content
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

fix_-663_error_again #86

Merged
merged 18 commits into from
Dec 16, 2022
Merged

fix_-663_error_again #86

merged 18 commits into from
Dec 16, 2022

Conversation

cxw620
Copy link
Collaborator

@cxw620 cxw620 commented Dec 13, 2022

No description provided.

@cxw620 cxw620 reopened this Dec 13, 2022
@cxw620
Copy link
Collaborator Author

cxw620 commented Dec 13, 2022

可能ip也会黑了... 麻烦, 今天累计6000条-663了.

我给api.bilibili.com, app.bilibili.com用CDN反代一下缓解缓解看看效果...

@pchpub
Copy link
Owner

pchpub commented Dec 13, 2022

基本确定了sh001已经和sh004一样了

可能ip也会黑了... 麻烦, 今天累计6000条-663了.

我给api.bilibili.com, app.bilibili.com用CDN反代一下缓解缓解看看效果...

https://app.bilibili.com/x/v2/account/mine 这个还能用,刚试过,如果以后这个api也寄了就离跑路不远了

@cxw620
Copy link
Collaborator Author

cxw620 commented Dec 13, 2022

基本确定了sh001已经和sh004一样了,我猜有几种可能 1:请求前得先请求其他一个api来验证身份 2:access_key 关联了

可能ip也会黑了... 麻烦, 今天累计6000条-663了.
我给api.bilibili.com, app.bilibili.com用CDN反代一下缓解缓解看看效果...

https://app.bilibili.com/x/v2/account/mine 这个还能用,刚试过,如果以后这个api也寄了就离跑路不远了

看app抓包怎么样吧... 模仿官方客户端肯定是最稳妥的. (我不会抓手机的https的包, 交给你了😀

我扒扒官方electron的包, 看看有没有什么有用的api, 至少得知道这人大会员有效期大概多长(年度大会员肯定是1年以上, 以此类推)

@pchpub
Copy link
Owner

pchpub commented Dec 13, 2022

基本确定了sh001已经和sh004一样了,我猜有几种可能 1:请求前得先请求其他一个api来验证身份 2:access_key 关联了

可能ip也会黑了... 麻烦, 今天累计6000条-663了.
我给api.bilibili.com, app.bilibili.com用CDN反代一下缓解缓解看看效果...

https://app.bilibili.com/x/v2/account/mine 这个还能用,刚试过,如果以后这个api也寄了就离跑路不远了

看app抓包怎么样吧... 模仿官方客户端肯定是最稳妥的. (我不会抓手机的https的包, 交给你了😀

我扒扒官方electron的包, 看看有没有什么有用的api, 至少得知道这人大会员有效期大概多长(年度大会员肯定是1年以上, 以此类推)

最简api:https://app.bilibili.com/x/v2/account/mine?access_key=ccd0991e90ab67631b5b6441428934c1&appkey=783bbb7264451d82&ts=1670929680&sign=ffeef3331c2e932af24f573956a68721

官方完整api:
GET /x/v2/account/mine?access_key=a65d4c0dcc3650a66f00a4d8c94966c1&appkey=1d8b6e7d45233436&bili_link_new=1&build=6800300&c_locale=zh_CN&channel=master&disable_rcmd=0&mobi_app=android&platform=android&s_locale=zh_CN&statistics=%7B%22appId%22%3A1%2C%22platform%22%3A3%2C%22version%22%3A%226.80.0%22%2C%22abtest%22%3A%22%22%7D&ts=1670929666&sign=ad52b2affb98f56180691bdc7bc16234 h2
Host: app.bilibili.com
buvid: XW14F58150D65798249BC8774F6F219335386
fp_local: bff39f1a81e4e0b9c13772f3fcdba8bd2022071113551409365873483d855c38
fp_remote: bff39f1a81e4e0b9c13772f3fcdba8bd2022071113551409365873483d855c38
session_id: 1c691151
env: prod
app-key: android64
user-agent: Mozilla/5.0 BiliDroid/6.80.0 (bbcallen@gmail.com) os/android model/M2012K11AC mobi_app/android build/6800300 channel/master innerVer/6800310 osVer/12 network/2
x-bili-trace-id: 455559ac88e5e843e9cdf2fea463985d:e9cdf2fea463986d:0:0
x-bili-aurora-eid: UlMFQVcABlAH
x-bili-mid: 114514
x-bili-aurora-zone: sh001
bili-bridge-engine: cronet
accept-encoding: gzip, deflate, br

返回数据有mid和vip due_time 很好

@cxw620
Copy link
Collaborator Author

cxw620 commented Dec 13, 2022

还有个api, 在第一次用access_key获得mid以后就用这个api刷新大会员信息就行了, 也有vip duetime字段

https://api.bilibili.com/x/space/wbi/acc/info?mid=72270557&token=&platform=web

{"code":0,"message":"0","ttl":1,"data":{"mid":72270557,"name":"芳斯塔芙","sex":"保密","face":"https://i2.hdslb.com/bfs/face/b6c4669d05df92eb45a410ba1ceb1bba34873f1e.jpg","face_nft":0,"face_nft_type":0,"sign":"芳斯塔芙\u0026鬼谷藏龙 为您带来fun stuff;商务QQ:1243739286;商务微信:Fun_Ghost","rank":10000,"level":6,"jointime":0,"moral":0,"silence":0,"coins":0,"fans_badge":true,"fans_medal":{"show":false,"wear":false,"medal":null},"official":{"role":1,"title":"bilibili 2020百大UP主、知名UP主","desc":"第三届“bilibili 新星计划”获奖者","type":0},"vip":{"type":2,"status":1,"due_date":1688140800000,"vip_pay_type":0,"theme_type":0,"label":{"path":"","text":"年度大会员","label_theme":"annual_vip","text_color":"#FFFFFF","bg_style":1,"bg_color":"#FB7299","border_color":"","use_img_label":true,"img_label_uri_hans":"","img_label_uri_hant":"","img_label_uri_hans_static":"https://i0.hdslb.com/bfs/vip/8d4f8bfc713826a5412a0a27eaaac4d6b9ede1d9.png","img_label_uri_hant_static":"https://i0.hdslb.com/bfs/activity-plat/static/20220614/e369244d0b14644f5e1a06431e22a4d5/VEW8fCC0hg.png"},"avatar_subscript":1,"nickname_color":"#FB7299","role":3,"avatar_subscript_url":"","tv_vip_status":0,"tv_vip_pay_type":0},"pendant":{"pid":0,"name":"","image":"","expire":0,"image_enhance":"","image_enhance_frame":""},"nameplate":{"nid":89,"name":"2020百大UP主","image":"https://i2.hdslb.com/bfs/face/dbc78ef8c88f15171f0d12587fb2731f999483a6.png","image_small":"https://i0.hdslb.com/bfs/face/0d7fc500803d66b8ac4f6c74c10f1adda5c58624.png","level":"稀有勋章","condition":"2020年在创作力、影响力、口碑力等维度综合数据出色的UP主"},"user_honour_info":{"mid":0,"colour":null,"tags":[]},"is_followed":false,"top_photo":"http://i1.hdslb.com/bfs/space/cb1c3ef50e22b6096fde67febe863494caefebad.png","theme":{},"sys_notice":{},"live_room":{"roomStatus":1,"liveStatus":0,"url":"https://live.bilibili.com/21310114?broadcast_type=0\u0026is_room_feed=1","title":"再来说说硅藻的演化","cover":"http://i0.hdslb.com/bfs/live/new_room_cover/f03d4b7acf32d7744dbeff566435c1e0a326547e.jpg","roomid":21310114,"roundStatus":0,"broadcast_type":0,"watched_show":{"switch":true,"num":28,"text_small":"28","text_large":"28人看过","icon":"https://i0.hdslb.com/bfs/live/a725a9e61242ef44d764ac911691a7ce07f36c1d.png","icon_location":"","icon_web":"https://i0.hdslb.com/bfs/live/8d9d0f33ef8bf6f308742752d13dd0df731df19c.png"}},"birthday":"02-21","school":{"name":""},"profession":{"name":"","department":"","title":"","is_show":0},"tags":null,"series":{"user_upgrade_status":3,"show_upgrade_window":false},"is_senior_member":0,"mcn_info":null,"gaia_res_type":0,"gaia_data":null,"is_risk":false,"elec":{"show_info":{"show":true,"state":2,"title":"为TA充电","icon":"","jump_url":"https://www.bilibili.com/h5/upower/index?mid=72270557\u0026navhide=1"}},"contract":null}}

还有https://api.bilibili.com/x/space/acc/info?mid=114514

@pchpub
Copy link
Owner

pchpub commented Dec 13, 2022

还有个api, 在第一次用access_key获得mid以后就用这个api刷新大会员信息就行了, 也有vip duetime字段

https://api.bilibili.com/x/space/wbi/acc/info?mid=72270557&token=&platform=web

{"code":0,"message":"0","ttl":1,"data":{"mid":72270557,"name":"芳斯塔芙","sex":"保密","face":"https://i2.hdslb.com/bfs/face/b6c4669d05df92eb45a410ba1ceb1bba34873f1e.jpg","face_nft":0,"face_nft_type":0,"sign":"芳斯塔芙\u0026鬼谷藏龙 为您带来fun stuff;商务QQ:1243739286;商务微信:Fun_Ghost","rank":10000,"level":6,"jointime":0,"moral":0,"silence":0,"coins":0,"fans_badge":true,"fans_medal":{"show":false,"wear":false,"medal":null},"official":{"role":1,"title":"bilibili 2020百大UP主、知名UP主","desc":"第三届“bilibili 新星计划”获奖者","type":0},"vip":{"type":2,"status":1,"due_date":1688140800000,"vip_pay_type":0,"theme_type":0,"label":{"path":"","text":"年度大会员","label_theme":"annual_vip","text_color":"#FFFFFF","bg_style":1,"bg_color":"#FB7299","border_color":"","use_img_label":true,"img_label_uri_hans":"","img_label_uri_hant":"","img_label_uri_hans_static":"https://i0.hdslb.com/bfs/vip/8d4f8bfc713826a5412a0a27eaaac4d6b9ede1d9.png","img_label_uri_hant_static":"https://i0.hdslb.com/bfs/activity-plat/static/20220614/e369244d0b14644f5e1a06431e22a4d5/VEW8fCC0hg.png"},"avatar_subscript":1,"nickname_color":"#FB7299","role":3,"avatar_subscript_url":"","tv_vip_status":0,"tv_vip_pay_type":0},"pendant":{"pid":0,"name":"","image":"","expire":0,"image_enhance":"","image_enhance_frame":""},"nameplate":{"nid":89,"name":"2020百大UP主","image":"https://i2.hdslb.com/bfs/face/dbc78ef8c88f15171f0d12587fb2731f999483a6.png","image_small":"https://i0.hdslb.com/bfs/face/0d7fc500803d66b8ac4f6c74c10f1adda5c58624.png","level":"稀有勋章","condition":"2020年在创作力、影响力、口碑力等维度综合数据出色的UP主"},"user_honour_info":{"mid":0,"colour":null,"tags":[]},"is_followed":false,"top_photo":"http://i1.hdslb.com/bfs/space/cb1c3ef50e22b6096fde67febe863494caefebad.png","theme":{},"sys_notice":{},"live_room":{"roomStatus":1,"liveStatus":0,"url":"https://live.bilibili.com/21310114?broadcast_type=0\u0026is_room_feed=1","title":"再来说说硅藻的演化","cover":"http://i0.hdslb.com/bfs/live/new_room_cover/f03d4b7acf32d7744dbeff566435c1e0a326547e.jpg","roomid":21310114,"roundStatus":0,"broadcast_type":0,"watched_show":{"switch":true,"num":28,"text_small":"28","text_large":"28人看过","icon":"https://i0.hdslb.com/bfs/live/a725a9e61242ef44d764ac911691a7ce07f36c1d.png","icon_location":"","icon_web":"https://i0.hdslb.com/bfs/live/8d9d0f33ef8bf6f308742752d13dd0df731df19c.png"}},"birthday":"02-21","school":{"name":""},"profession":{"name":"","department":"","title":"","is_show":0},"tags":null,"series":{"user_upgrade_status":3,"show_upgrade_window":false},"is_senior_member":0,"mcn_info":null,"gaia_res_type":0,"gaia_data":null,"is_risk":false,"elec":{"show_info":{"show":true,"state":2,"title":"为TA充电","icon":"","jump_url":"https://www.bilibili.com/h5/upower/index?mid=72270557\u0026navhide=1"}},"contract":null}}

那问题就好解决多了, 如果以后 app.bilibili.com/x/v2/account/mine 寄了也没多大事,mid有好多api可以获取

@cxw620
Copy link
Collaborator Author

cxw620 commented Dec 13, 2022

https://api.bilibili.com/x/space/wbi/acc/info?

这个api不用鉴权, 注意请求并发别太大就行.

而且, mid有个地方肯定有, 所有方法都失效了只要playurl没失效都没问题
image

@pchpub
Copy link
Owner

pchpub commented Dec 13, 2022

https://api.bilibili.com/x/space/wbi/acc/info?

这个api不用鉴权, 注意请求并发别太大就行.

而且, mid有个地方肯定有, 所有方法都失效了只要playurl没失效都没问题 image

感觉还是得捏个 fake-useragent 来请求 api.bilibili.com/x/space/wbi/acc/info

src/main.rs Show resolved Hide resolved
@cxw620
Copy link
Collaborator Author

cxw620 commented Dec 13, 2022

https://api.bilibili.com/x/space/wbi/acc/info?

这个api不用鉴权, 注意请求并发别太大就行.
而且, mid有个地方肯定有, 所有方法都失效了只要playurl没失效都没问题 image

感觉还是得捏个 fake-useragent 来请求 api.bilibili.com/x/space/wbi/acc/info

可, 我来捏吧, 顺带把刷新access_key的background_task我也给改成用https://api.bilibili.com/x/space/wbi/acc/info, 再加上个兜底的通过请求playurl返回的获取

@pchpub
Copy link
Owner

pchpub commented Dec 13, 2022

测了下,网页请求可以直接跳过 app.bilibili.com/x/v2/account/mine 了, 油猴大概只能通过playurl获取mid

@cxw620

This comment was marked as outdated.

@cxw620
Copy link
Collaborator Author

cxw620 commented Dec 13, 2022

大概改成这样, 没细测, 应该没问题, 我丢生产环境测测(笑

刚刚看了看, 2个小时1000个-663, 怕是黑ip了... 赶紧换上去试试

@cxw620

This comment was marked as outdated.

@cxw620

This comment was marked as resolved.

@cxw620

This comment was marked as resolved.

@cxw620
Copy link
Collaborator Author

cxw620 commented Dec 13, 2022

应该没问题了, 测试一天就merge吧. 目前暂时能用, 不保证以后可用, 未来方向只能是抓包、逆向工程APP,确保服务器的请求跟正常请求基本一致

Known issues: 非大会员网页端首次访问大会员专享视频, resign会不生效, 原因是拿不到uid. 不过无伤大雅.

@cxw620
Copy link
Collaborator Author

cxw620 commented Dec 14, 2022

似乎可以用ios的key, https://app.bilibili.com/x/v2/account/myinfo?access_key=*&appkey=27eb53fc9058f8c3&build=6800300&buvid=97AUOA3CQZ3T38JAKI7EN44CCSJAIFWU3WDH&c_locale=zh_CN&channel=master&disable_rcmd=0&local_id=97AUOA3CQZ3T38JAKI7EN44CCSJAIFWU3WDH&mobi_app=android&platform=android&s_locale=zh_CN&statistics=%7B%22appId%22%3A1%2C%22platform%22%3A3%2C%22version%22%3A%226.80.0%22%2C%22abtest%22%3A%22%22%7D&ts=1670991239&sign=0c7d853d9cbd7a302d24d631a0185d5c, 就是不知道能不能长久. 加上试试...

UA不知道是啥, 给个人抓个包... 常用设备不一样, 不太好

@pchpub
Copy link
Owner

pchpub commented Dec 14, 2022

似乎可以用ios的key, https://app.bilibili.com/x/v2/account/myinfo?access_key=*&appkey=27eb53fc9058f8c3&build=6800300&buvid=97AUOA3CQZ3T38JAKI7EN44CCSJAIFWU3WDH&c_locale=zh_CN&channel=master&disable_rcmd=0&local_id=97AUOA3CQZ3T38JAKI7EN44CCSJAIFWU3WDH&mobi_app=android&platform=android&s_locale=zh_CN&statistics=%7B%22appId%22%3A1%2C%22platform%22%3A3%2C%22version%22%3A%226.80.0%22%2C%22abtest%22%3A%22%22%7D&ts=1670991239&sign=0c7d853d9cbd7a302d24d631a0185d5c, 就是不知道能不能长久. 加上试试...

UA不知道是啥, 给个人抓个包... 常用设备不一样, 不太好

image

js0n说是accesskey和appkey也要对应

@cxw620
Copy link
Collaborator Author

cxw620 commented Dec 14, 2022

似乎可以用ios的key, https://app.bilibili.com/x/v2/account/myinfo?access_key=*&appkey=27eb53fc9058f8c3&build=6800300&buvid=97AUOA3CQZ3T38JAKI7EN44CCSJAIFWU3WDH&c_locale=zh_CN&channel=master&disable_rcmd=0&local_id=97AUOA3CQZ3T38JAKI7EN44CCSJAIFWU3WDH&mobi_app=android&platform=android&s_locale=zh_CN&statistics=%7B%22appId%22%3A1%2C%22platform%22%3A3%2C%22version%22%3A%226.80.0%22%2C%22abtest%22%3A%22%22%7D&ts=1670991239&sign=0c7d853d9cbd7a302d24d631a0185d5c, 就是不知道能不能长久. 加上试试...
UA不知道是啥, 给个人抓个包... 常用设备不一样, 不太好

image

js0n说是accesskey和appkey也要对应

可, 稍微改改

@pchpub
Copy link
Owner

pchpub commented Dec 14, 2022

说起来之前我web请求用的ios的key,然后Android用的Android的key,然后发现还有663,现在想了想应该是play端()

@cxw620

This comment was marked as resolved.

@cxw620
Copy link
Collaborator Author

cxw620 commented Dec 14, 2022

一个疑问: headers.append("x-bili-aurora-eid: UlMFQVcABlAH").unwrap(); 这个x-bili-aurora-eid是固定的吗? 还是APP运行时动态生成的/云控下发的

@pchpub
Copy link
Owner

pchpub commented Dec 14, 2022

一个疑问: headers.append("x-bili-aurora-eid: UlMFQVcABlAH").unwrap(); 这个x-bili-aurora-eid是固定的吗? 还是APP运行时动态生成的/云控下发的

image
输入是mid,输出是eid

@pchpub
Copy link
Owner

pchpub commented Dec 14, 2022

一个疑问: headers.append("x-bili-aurora-eid: UlMFQVcABlAH").unwrap(); 这个x-bili-aurora-eid是固定的吗? 还是APP运行时动态生成的/云控下发的

image 输入是mid,输出貌似就是eid

eid需要mid生成,但目的是为了获取mid,有点生草

@cxw620
Copy link
Collaborator Author

cxw620 commented Dec 14, 2022

http://api.bilibili.com/x/member/web/account?access_key={}这个可以直接拿mid...

@cxw620
Copy link
Collaborator Author

cxw620 commented Dec 15, 2022

js0n那边的意见也写好了, 就是手上没play版测试. 不过应该没问题.

eid这个先不管了

差不多就合并吧, 没问题了, 发版0.3.2

@pchpub pchpub merged commit 0e32baf into main Dec 16, 2022
@cxw620 cxw620 deleted the fix_663_61000_error branch December 16, 2022 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants