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 #17] avoid -352 by use new header. And add series features #18

Merged
merged 6 commits into from
May 27, 2024

Conversation

robo-dani
Copy link
Contributor

  • fix chore(deps): bump idna from 3.6 to 3.7 #17, use a new header, and wrap request with a retry function.

    使用新的header我就几乎没遇到-352了, 再加上retry应该不会再出现了(至少在archlinux应该不会了..)

  • add series feature, now can download series using series command.

    使用的是旧的接口, 出错的时候不带错误信息, code也为0.
    只知道uid, 和sid错误的时候archives 为None

@robo-dani robo-dani changed the title [Fix #17] avoid -352 by use new header. And add series features [WIP] [Fix #17] avoid -352 by use new header. And add series features Apr 30, 2024
@robo-dani
Copy link
Contributor Author

我找到了一个 700多视频的合集, 大概20次请求(对应视频索引在600之火)后会触发-352. 我打算把get_viedo改成yield的形式, 和下载视频穿插起来, 能避免一下发送大量请求

@jingfelix
Copy link
Owner

retry 也许可以用 requestsRetry 来实现,参考 这个回答

添加 retry 和 headers 的 referer 可以直接把修改加进 util.py,这样可以简单地共用?

@robo-dani
Copy link
Contributor Author

retry 也许可以用 requestsRetry 来实现,参考 这个回答
不能用requests的Retry 因为b站的api返回值都是200, 区别是response中的code 数据, 所以我写了一个Retry的装饰器来实现.

添加 retry 和 headers 的 referer 可以直接把修改加进 util.py,这样可以简单地共用?

试了下 series系列的headers 是可以用默认的, 这样子只有season模式需要特殊的headers了

@robo-dani robo-dani changed the title [WIP] [Fix #17] avoid -352 by use new header. And add series features [Fix #17] avoid -352 by use new header. And add series features May 20, 2024
@jingfelix
Copy link
Owner

@robo-dani 能否开一下 Allow Edit?README 里的几个描述我一起改一下

@robo-dani
Copy link
Contributor Author

@robo-dani 能否开一下 Allow Edit?README 里的几个描述我一起改一下

啊, 默认就开了啊.
image

src/bilifm/command.py Show resolved Hide resolved
@jingfelix
Copy link
Owner

Changelog:

  • 修改了 README 里的 typo 和格式
  • 修改了 series command 的注释,优化帮助信息的打印格式

@jingfelix jingfelix merged commit 8877a6d into jingfelix:main May 27, 2024
1 check passed
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