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

用户(Info)接口,443权限不足 #914

Open
lurongkun opened this issue Dec 23, 2023 · 5 comments
Open

用户(Info)接口,443权限不足 #914

lurongkun opened this issue Dec 23, 2023 · 5 comments
Labels
用户/Member 接口:用户信息&用户相关 问题/Question 暂时无法确定的性质

Comments

@lurongkun
Copy link

用的是示例的wbi签名生成的签名和时间戳,爬取用户空间显示权限不足,错误码403

Uploading 屏幕截图 2023-12-23 173710.png…

# 发送GET请求并获取响应
HEADERS = {'Referer': 'https://www.bilibili.com/', 'Connection': 'close', 'User-Agent': 'Mozilla/5.0'}
params = {'mid': mid, 'wts': signed_params['wts'], 'w_rid': signed_params['w_rid']}  
response = requests.get(url, params, headers=HEADERS)

sex = ""
# 处理JSON数据
if response.status_code == 200:
    json_data = response.json()  # 将响应数据解析为JSON格式
    if json_data['code'] == -404:
        return '保密'
    sex = json_data['data']['sex']
@xiaoyv404 xiaoyv404 added 问题/Question 暂时无法确定的性质 用户/Member 接口:用户信息&用户相关 labels Dec 23, 2023
@cxw620
Copy link
Contributor

cxw620 commented Dec 24, 2023

-403 和 wbi 应该没关系, 被风控罢了

@Joenothing-lst
Copy link

-403 和 wbi 应该没关系, 被风控罢了

应该就是wbi算法有更新
image

@cxw620
Copy link
Contributor

cxw620 commented Dec 25, 2023

自己 F12 控制台 debug 一下看看 img_key 和 sub_key 对不对,部分接口的 img_key, sub_key 是硬编码到 js 文件里面的,也可能是有新的方法拿这俩 key 了. 算法本身没问题. 这个问题我应该在别的issue 提过,改天我PR吧。

晚上我再看看你实例里面的 w_rid 有没有算对。

P.S. 我的评价是,不如把 example 都删了,看着 introduction 自己写不出来代码这纯粹是编程能力问题,具体实现细节去 discussion 交流讨论分享,毕竟 issue 是拿来反馈问题不是拿来小白求助的,discussion 问问,确认是问题再转 issue()

可以弄个 issue template

@xiaoyv404
Copy link
Collaborator

确实是需要考虑弄一个了

@cxw620
Copy link
Contributor

cxw620 commented Dec 25, 2023

确实是需要考虑弄一个了

顺带引导一下求助贴以及单纯分享代码示例发到 discussions 吧, 啥示例都往文档里塞感觉没必要, 甚至 Rust, Kotlin 等这种有在线 playground 的扔个 playground 链接就行...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
用户/Member 接口:用户信息&用户相关 问题/Question 暂时无法确定的性质
Projects
None yet
Development

No branches or pull requests

4 participants