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直链 #6645

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

qy527145
Copy link

新增功能:

  • 优先提取cdn直链,可提速下载阿里云盘文件

关联issue:#6644

Copy link

welcome bot commented Jun 22, 2024

Thanks for opening this pull request! Please check out our contributing guidelines.

@ershouqingge
Copy link

大佬有暂时可用的docker容器可用么

@qy527145
Copy link
Author

大佬有暂时可用的docker容器可用么

啥意思,没理解啊

@ershouqingge
Copy link

大佬有暂时可用的docker容器可用么

啥意思,没理解啊

pr一直没合并啊 docker没有新映像

@@ -106,17 +106,26 @@ func (d *AliDrive) Link(ctx context.Context, file model.Obj, args model.LinkArgs
"file_id": file.GetID(),
"expire_sec": 14400,
}
res, err, _ := d.request("https://api.alipan.com/v2/file/get_download_url", http.MethodPost, func(req *resty.Request) {
res, err, _ := d.request("https://bj29.api.aliyunpds.com/v2/file/get_download_url", http.MethodPost, func(req *resty.Request) {
Copy link
Member

@SeanHeuc SeanHeuc Jun 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replacing the official url with a third-party one is never a good practice. Alipan official could change this url anytime, and then many user will have trouble use this driver.
please put this url as an option if this can provide acceleration benefit.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这并不是一个第三方的url,相反,它是阿里云盘的上游服务pds(阿里云的一个云服务产品),阿里云盘在此基础上封装了一层(可能伴随着一些接口信息的阉割),一般来说,它比阿里云盘的接口更可靠。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as long as it's not an official url in the Aliyun-Open doc, it's stability is not guaranteed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

就像 @SeanHeuc 说的,请将其作为一个选项 而不是直接修改

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不太熟悉go语言,回头看看go的语法,有时间再改改

@vpei
Copy link

vpei commented Jul 5, 2024

大佬有暂时可用的docker容器可用么

https://alist.nn.ci/zh/guide/install/docker.html

@qy527145
Copy link
Author

qy527145 commented Jul 5, 2024

大佬有暂时可用的docker容器可用么

https://alist.nn.ci/zh/guide/install/docker.html

正在打包,马上发出来,我简单测试了一下,cdn直链单线程有大概4MB/s的速度:
image

@qy527145
Copy link
Author

qy527145 commented Jul 5, 2024

@pull-request-size pull-request-size bot added size/M and removed size/S labels Jul 5, 2024
@qy527145
Copy link
Author

qy527145 commented Jul 5, 2024

各个版本均已build
https://github.com/qy527145/alist/releases/tag/v3.35.1

@windmsn
Copy link

windmsn commented Jul 6, 2024

这是我更新后的速度。。是错觉还是怎么?
我这用的是open的那个驱动。。下载的域名是cn-beijing-data的。。你的是file-cdn的。。

你改的这个是阿里云盘open的驱动么?还是那个旧的带分享的那个?

image

@anwen-anyi
Copy link
Member

这个应该合并不了QAQ,违反阿里的TOS条款似乎 😹

@qy527145
Copy link
Author

qy527145 commented Jul 6, 2024

这是我更新后的速度。。是错觉还是怎么?

我这用的是open的那个驱动。。下载的域名是cn-beijing-data的。。你的是file-cdn的。。

你改的这个是阿里云盘open的驱动么?还是那个旧的带分享的那个?

image

不要用open;另外,如果是冷门资源,不会有cdn

@fredericky123
Copy link

这是我更新后的速度。。是错觉还是怎么?
我这用的是open的那个驱动。。下载的域名是cn-beijing-data的。。你的是file-cdn的。。
你改的这个是阿里云盘open的驱动么?还是那个旧的带分享的那个?
image

不要用open;另外,如果是冷门资源,不会有cdn

不用open是为何呢 我之前挂载的open 现在用这个程序替代之前的,也能起到加速效果,需要重新配置挂载么

Copy link
Member

@xhofe xhofe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

完成修改后将被合并。

@@ -2,9 +2,9 @@ name: build_docker

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请不要修改workflow文件

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我再单独加个分支用于pr吧,好像排除不了了

@@ -106,17 +106,26 @@ func (d *AliDrive) Link(ctx context.Context, file model.Obj, args model.LinkArgs
"file_id": file.GetID(),
"expire_sec": 14400,
}
res, err, _ := d.request("https://api.alipan.com/v2/file/get_download_url", http.MethodPost, func(req *resty.Request) {
res, err, _ := d.request("https://bj29.api.aliyunpds.com/v2/file/get_download_url", http.MethodPost, func(req *resty.Request) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

就像 @SeanHeuc 说的,请将其作为一个选项 而不是直接修改

@lzyhenniu
Copy link

lzyhenniu commented Jul 19, 2024

image
使用的alist是您打包的v3.35.1,选择阿里云盘驱动没有加速效果,302重定向后是cn-beijing-data.aliyundrive.net的链接
image

有些文件会出现bj29-hz.cn-hangzhou.data.alicloudccp.com的域名
image
@qy527145

@JustLookAtNow
Copy link

JustLookAtNow commented Jul 19, 2024

各个版本均已build https://github.com/qy527145/alist/releases/tag/v3.35.1

顺便问一下, https://github.com/everstu/Koolcenter_alist 路由器里面这个二进制为啥这么小,本来想用你的二进制直接替换下的,结果发现太大了,我路由器的jffs分区根本塞不进去

@qy527145
Copy link
Author

各个版本均已build https://github.com/qy527145/alist/releases/tag/v3.35.1

顺便问一下, https://github.com/everstu/Koolcenter_alist 路由器里面这个二进制为啥这么小,本来想用你的二进制直接替换下的,结果发现太大了,我路由器的jffs分区根本塞不进去

我是复用的官方的流水线,不太清楚他的怎么这么精简

@qy527145
Copy link
Author

image 使用的alist是您打包的v3.35.1,选择阿里云盘驱动没有加速效果,302重定向后是cn-beijing-data.aliyundrive.net的链接 image

有些文件会出现bj29-hz.cn-hangzhou.data.alicloudccp.com的域名 image @qy527145

这个域名代表没走cdn,域名带file-cdn才是cdn链接,即使之前的热门资源生成cdn,好像过一段时间之后会过期而获取不到,需要是热门资源(有人最近下载过)

@lzyhenniu
Copy link

lzyhenniu commented Jul 19, 2024

image 使用的alist是您打包的v3.35.1,选择阿里云盘驱动没有加速效果,302重定向后是cn-beijing-data.aliyundrive.net的链接 image
有些文件会出现bj29-hz.cn-hangzhou.data.alicloudccp.com的域名 image @qy527145

这个域名代表没走cdn,域名带file-cdn才是cdn链接,即使之前的热门资源生成cdn,好像过一段时间之后会过期而获取不到,需要是热门资源(有人最近下载过)

试了五部热门的电视剧资源都没有出现过file-cdn域名的链接,不知道怎么才算是热门资源

@qy527145
Copy link
Author

qy527145 commented Jul 20, 2024

试了五部热门的电视剧资源都没有出现过file-cdn域名的链接,不知道怎么才算是热门资源

如果是想测试的话,你可以先用携带带类似cn-beijing-data.aliyundrive.net域名的普通直链下载一次,
之后再次尝试获取直链就可能出现cdn直链了(不知道是不是他们改了)。

@fredericky123
Copy link

失效了吗?下载的文件里没有出现cdn,而是cn-beijing-data,且下载速度只有几百K

@xhofe xhofe force-pushed the main branch 3 times, most recently from cb927b4 to e5fe9ea Compare August 17, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants