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

默认歌单的请求被B站禁止了 #38

Open
tieniu1 opened this issue Oct 19, 2023 · 1 comment
Open

默认歌单的请求被B站禁止了 #38

tieniu1 opened this issue Oct 19, 2023 · 1 comment

Comments

@tieniu1
Copy link

tieniu1 commented Oct 19, 2023

Snipaste_2023-10-19_10-27-02
@kenmingwang kenmingwang pinned this issue Oct 28, 2023
@lovegaoshi
Copy link
Contributor

lovegaoshi commented Dec 8, 2023

我默认歌单倒是没问题。重构的时候发现fetch params只要credentials设置了就会412
也有可能是没带UA

>>> import requests
>>> requests.get('https://api.bilibili.com/x/web-interface/nav')
<Response [412]>
>>> requests.get('https://api.bilibili.com/x/web-interface/nav',headers={"user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36"})
<Response [200]>

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

No branches or pull requests

2 participants