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

🐛修复BiliPlus解析失败问题(使用重定向) #157

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

lanyeeee
Copy link

@lanyeeee lanyeeee commented Jul 16, 2024

功能描述

目前BiliPlus漫画页面的html里不再直接包含图片地址,取而代之的是一些query参数,通过这些参数发起的请求会被重定向到真正的图片地址

例如:
某图片的query参数为:
?act=get_image_url&epid=595701&request_time=1721133361&file=bb35c716a7781be297f57f1e39b21dfc0375e773.jpg&append=
因为requests自带重定向功能,带cookie向以下url发送请求
https://www.biliplus.com/manga/?act=get_image_url&epid=595701&request_time=1721133361&file=bb35c716a7781be297f57f1e39b21dfc0375e773.jpg&append=
即可得到图片

这个PR将上述的url直接给到DownloadManager,不带token
DownloadManager通过是否有token判断url是否来自BiliPlus
从而分别处理两种下载方式

优劣

优: 使用重定向相当于图片地址解析与下载同时进行,能将下载进度迅速反映在用户界面上
劣: 改动的文件较多,且破坏了DownloadManager.pyEpisode.py的抽象

在我的网络环境中,无论是否使用重定向,下载的总耗时都差不多
解决这个issue #154

@lanyeeee
Copy link
Author

lanyeeee commented Jul 18, 2024

没注意要给commit签名,现在好了 @Zeal-L

@Zeal-L Zeal-L merged commit bae7f5f into Zeal-L:develop Aug 5, 2024
3 checks passed
@Zeal-L Zeal-L self-requested a review August 5, 2024 13:39
@Zeal-L Zeal-L self-assigned this Aug 5, 2024
@Zeal-L Zeal-L added the bug Something isn't working label Aug 5, 2024
@Zeal-L Zeal-L linked an issue Aug 5, 2024 that may be closed by this pull request
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

Successfully merging this pull request may close these issues.

[Bug] BiliPlus解析失效
2 participants