阿里云盘下载优先使用cdn直链
Please make sure of the following things
- [X] I have read the documentation.
- [X] I'm sure there are no duplicate issues or discussions.
- [X] I'm sure this feature is not implemented.
- [X] 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
这个链接下载至少10MB/s(我这边路由器原因,瓶颈了)
当然,这个接口有时返回的cdn_url为空(可能是冷门资源,没下载过),但一定会返回一个普通的直链url,业务上可以先尝试获取cdn_url,不行就用普通直链,兼容一下即可
关于cdn直链为空的情况,我这边测试了一下,只要使用普通直链下载一次,再次请求即可拿到cdn_url
Additional context / 附件
No response
支持,希望能尽快pr合并
pr已提,https://github.com/alist-org/alist/pull/6645
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.