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

视频下载失败:JSONObject["quality"] not found #177

Closed
DreamerDK opened this issue Dec 24, 2023 · 2 comments
Closed

视频下载失败:JSONObject["quality"] not found #177

DreamerDK opened this issue Dec 24, 2023 · 2 comments

Comments

@DreamerDK
Copy link

我已经确认

  • 使用的当前版本为最新版本
  • 使用最新的CI版本仍然存在该问题CI传送门
  • issue区没有类似的情况(有的话请直接去该问题讨论)

问题描述
下载某些视频时会失败,无法获取下载链接。

相关信息

  • 当前系统(windows/linux等):windows 11
  • java版本:java11、java17、自带jre的版本都试过
  • 相关链接或者BV号:BV1et411b73Z
  • 账号是否登录:已登录
  • 在网页端观看是否存在问题:没有问题
  • 是否存在自定义parsers:没有
  • 相关log
MJTab label的点击事件
你点击了次下载按钮...
查询记录BV1et411b73Z-80-p1
已经下载过 BV1et411b73Z-80-p1
你点击了次下载按钮...
查询记录BV1et411b73Z-80-p2
匹配BVParser: BV1et411b73Z
InputParser-selectParser/66 : BV1et411b73Z
匹配BVParser: BV1et411b73Z
正在查询MP4/FLV链接...
API-getWbiUrl/109 : https://i0.hdslb.com/bfs/wbi/7cd084941338484aae1ad9425b84077c.png
API-getWbiUrl/113 : https://i0.hdslb.com/bfs/wbi/4932caff0ff746eab6f01bf08b70ac45.png
API-getWbiUrl/115 : 7cd084941338484aae1ad9425b84077c4932caff0ff746eab6f01bf08b70ac45
AbstractBaseParser-getVideoLinkByFormat/312 : https://api.bilibili.com/x/player/wbi/playurl?cid=1233403794&bvid=BV1et411b73Z&qn=80&type=&otype=json&fnver=0&fnval=4048&fourk=1&w_rid=d79004381caa789f9f5dc99c1948dd09&wts=1703397554
{"code":0,"message":"0","ttl":1,"data":{"v_voucher":"voucher_7758a05f-7b6f-4fa2-87e5-bd9030145c49"}}

Exception in thread "pool-1-thread-1" 你点击了次下载按钮...
org.json.JSONException: JSONObject["quality"] not found.
查询记录BV1et411b73Z-80-p3
        at org.json.JSONObject.get(JSONObject.java:580)
        at org.json.JSONObject.getNumber(JSONObject.java:719)
        at org.json.JSONObject.getInt(JSONObject.java:742)
        at nicelee.bilibili.parsers.impl.AbstractBaseParser.getVideoLinkByFormat(AbstractBaseParser.java:328)
        at nicelee.bilibili.parsers.impl.AbstractBaseParser.getVideoLink(AbstractBaseParser.java:231)
        at nicelee.bilibili.parsers.InputParser.getVideoLink(InputParser.java:121)
        at nicelee.ui.thread.DownloadRunnable.download(DownloadRunnable.java:91)
        at nicelee.ui.thread.DownloadRunnable.run(DownloadRunnable.java:60)
匹配BVParser: BV1et411b73Z
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)
InputParser-selectParser/66 : BV1et411b73Z
匹配BVParser: BV1et411b73Z
正在查询MP4/FLV链接...
AbstractBaseParser-getVideoLinkByFormat/312 : https://api.bilibili.com/x/player/wbi/playurl?cid=1233403922&bvid=BV1et411b73Z&qn=80&type=&otype=json&fnver=0&fnval=4048&fourk=1&w_rid=6eb59eee9b09bfb4ce50c887707c47d1&wts=1703397554
{"code":0,"message":"0","ttl":1,"data":{"v_voucher":"voucher_a11d5a1d-5374-43f5-a77d-779c457bc0dc"}}

Exception in thread "pool-1-thread-2" org.json.JSONException: JSONObject["quality"] not found.
        at org.json.JSONObject.get(JSONObject.java:580)
你点击了次下载按钮...
        at org.json.JSONObject.getNumber(JSONObject.java:719)
查询记录BV1et411b73Z-80-p4
        at org.json.JSONObject.getInt(JSONObject.java:742)
        at nicelee.bilibili.parsers.impl.AbstractBaseParser.getVideoLinkByFormat(AbstractBaseParser.java:328)
        at nicelee.bilibili.parsers.impl.AbstractBaseParser.getVideoLink(AbstractBaseParser.java:231)
        at nicelee.bilibili.parsers.InputParser.getVideoLink(InputParser.java:121)
        at nicelee.ui.thread.DownloadRunnable.download(DownloadRunnable.java:91)
        at nicelee.ui.thread.DownloadRunnable.run(DownloadRunnable.java:60)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
匹配BVParser: BV1et411b73Z
        at java.base/java.lang.Thread.run(Thread.java:833)
请在发表issue前进行预览,将影响排版的内容放到这里
@nICEnnnnnnnLee
Copy link
Owner

这是被风控了导致返回的内容不符预期。

这里可以列举一些可能预防或者解决问题的方案,但并不一定有效。

  • 退出登录,并删除config文件夹下的fingerprint.config,在后续动作完毕后重启程序并重新登录
  • 打开配置页,搜索并修改bilibili.userAgent.pc为你常用浏览器的值
  • 将查询、下载等间隔适当放大,比如将下列配置项设为5000
    bilibili.download.period.between.download
    bilibili.download.period.between.query
    

@DreamerDK
Copy link
Author

以上方法使用后无效,但更换网络环境后无此问题,应该是那个使用的宽带被风控了。

nICEnnnnnnnLee added a commit that referenced this issue Feb 23, 2024
* 新增: 添加功能,可以周期性地进行“一键下载”,并通报结果。
* 优化: 现在按平台和架构编译了四个版本ffmpeg,缺省时符合条件的会提示进行下载:`win_amd64`、`linux_amd64`、`win_arm64`、`linux_arm64`
* 优化: 现在补充完善了浏览器指纹等方面的cookie,期望是预防风控 #177, #180
    + 因为尚不清楚相关机制,目前`通过API上传指纹`这一动作只在`刷新cookie`时才会进行。在遇到风控时,不妨先试一试菜单栏里的`刷新cookie`选项。
    + 现在最好不要随意修改配置的UA,如果必要,需要在隐私模式下抓取cookie并抓包相应API的payload。详见配置页。
* 修复: #182 考虑在`UP主所有视频`类型的链接解析时,keyword中含有空格的情况。
* 删除: 移除解析分页链接时`promptAll`模式相关代码。
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