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

阿里云盘下载优先使用cdn直链 #6644

Closed
4 tasks done
qy527145 opened this issue Jun 22, 2024 · 3 comments
Closed
4 tasks done

阿里云盘下载优先使用cdn直链 #6644

qy527145 opened this issue Jun 22, 2024 · 3 comments
Labels
enhancement New feature or request stale No activity for more than 30 days

Comments

@qy527145
Copy link

Please make sure of the following things

  • I have read the documentation.
  • I'm sure there are no duplicate issues or discussions.
  • I'm sure this feature is not implemented.
  • I'm sure it's a reasonable and popular requirement.

Description of the feature / 需求描述

鉴于阿里云盘普通用户大幅限速,可以考虑使用阿里的pds服务获取cdn直链来提速

Suggested solution / 实现思路

api参考这里
具体思路如下:
修改下面这个api接口
https://github.com/alist-org/alist/blob/29fe49fb872561df7c73dc89b29ce3e2b359a631/drivers/aliyundrive/driver.go#L109
将请求api从"https://api.alipan.com/v2/file/get_download_url" 修改为:"https://bj29.api.aliyunpds.com/v2/file/get_download_url"
该接口会返回一个cdn_url
image
这个链接下载至少10MB/s(我这边路由器原因,瓶颈了)
当然,这个接口有时返回的cdn_url为空(可能是冷门资源,没下载过),但一定会返回一个普通的直链url,业务上可以先尝试获取cdn_url,不行就用普通直链,兼容一下即可

关于cdn直链为空的情况,我这边测试了一下,只要使用普通直链下载一次,再次请求即可拿到cdn_url

Additional context / 附件

No response

@qy527145 qy527145 added the enhancement New feature or request label Jun 22, 2024
@ypq123456789
Copy link

支持,希望能尽快pr合并

@qy527145
Copy link
Author

pr已提,#6645

Copy link

stale bot commented Aug 5, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale No activity for more than 30 days label Aug 5, 2024
@qy527145 qy527145 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale No activity for more than 30 days
Projects
None yet
Development

No branches or pull requests

2 participants