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

season 模式需要手动填入 user-agent 支援,或是自动按照 OS 替换 user-agent #16

Open
JokerCatz opened this issue Apr 9, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@JokerCatz
Copy link

这边大略实验了一下,如果使用了浏览器观看 B 站,很大程度使用此工具会得到 -352 error (相同 IP 的状况下)

而在使用 curl 实验后发现 B 站会暂存 user-agent 来进行二次验证,除非有进行初次的 cookie 或是相关资源交换

所以我目前用此 tools 的 season 模式 user-agent 都会是失效的,而我目前的 user-agent 会是类似

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36

目前猜想可能是OS 的问题,类似我用的是linux 而(X11; Linux) 而预设的会是macOS (Macintosh; Intel Mac OS X) 合理猜测,说不定能自动置换这段即可,或是类似准备多组给不同OS 用即可

目前测试 season 模式会有这状况就是

@jingfelix jingfelix added the bug Something isn't working label Apr 9, 2024
@jingfelix
Copy link
Owner

我晚上看一下,之前测试还没有在有桌面浏览器的设备上一起跑过……

@JokerCatz
Copy link
Author

main...JokerCatz:BiliFM:fix_user_agent

重新测试了一下,看来还要加一个 random cookie (应该可以是 random uuid)

@jingfelix
Copy link
Owner

我在 Mac 上测试了一下

  • 浏览器使用默认 UA 登录(和BiliFM一致):可以下载
  • BiliFM 使用默认 UA:可以下载
  • BiliFM 使用Windows UA:可以下载
  • BiliFM 使用Android UA:可以下载
  • BiliFM 不使用 UA:无法下载

@JokerCatz
Copy link
Author

嗯,我是台湾的 IP 然后使用 ubuntu,我自己上了 branch 后搞定了就是

@robo-dani
Copy link
Contributor

感觉和user agent 关系不大,
可能是和 "Referer" 有关
我目前 使用了下面的headers 就没则么遇到问题了

headers = {
    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
    "Referer": "https://www.bilibili.com",
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants