feat(drivers): add aliyun_pds driver#1936
Open
xrgzs wants to merge 7 commits intoOpenListTeam:mainfrom
Open
Conversation
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
Member
|
我记得阿里云盘企业版自带一个在线解压,要不要也实现一下 |
KirCute
requested changes
Jan 8, 2026
Comment on lines
+177
to
+181
| file := &stream.FileStream{ | ||
| Obj: streamer, | ||
| Reader: streamer, | ||
| Mimetype: streamer.GetMimetype(), | ||
| } |
Member
Author
There was a problem hiding this comment.
这部分代码是从 aliyundrive 复制过来的,如果有问题,麻烦改一下,感谢!
Comment on lines
+199
to
+202
| var localFile *os.File | ||
| if fileStream, ok := file.Reader.(*stream.FileStream); ok { | ||
| localFile, _ = fileStream.Reader.(*os.File) | ||
| } |
Member
There was a problem hiding this comment.
根据stream.CacheFullAndWriter的写法,缓存到临时文件里的FileStream的Reader是*buffer.PeekFile类型。根据local.Put的写法,本机存储返回的Link是RangeReader类型。所以如果我想的没错的话,这个转换恐怕总是失败。
Comment on lines
+238
to
+262
| delete(reqBody, "pre_hash") | ||
| h := sha1.New() | ||
| if localFile != nil { | ||
| if err = utils.CopyWithCtx(ctx, h, localFile, 0, nil); err != nil { | ||
| return err | ||
| } | ||
| if _, err = localFile.Seek(0, io.SeekStart); err != nil { | ||
| return err | ||
| } | ||
| } else { | ||
| tempFile, err := os.CreateTemp(conf.Conf.TempDir, "file-*") | ||
| if err != nil { | ||
| return err | ||
| } | ||
| defer func() { | ||
| _ = tempFile.Close() | ||
| _ = os.Remove(tempFile.Name()) | ||
| }() | ||
| if err = utils.CopyWithCtx(ctx, io.MultiWriter(tempFile, h), file, 0, nil); err != nil { | ||
| return err | ||
| } | ||
| localFile = tempFile | ||
| } | ||
| reqBody["content_hash"] = hex.EncodeToString(h.Sum(nil)) | ||
| reqBody["content_hash_name"] = "sha1" |
Member
There was a problem hiding this comment.
应当
- 首先判断文件是否已经具有 SHA1 值
- 使用
stream.CacheFullAndHash计算 SHA1
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
jyxjjj
approved these changes
Jan 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description / 描述
增加阿里云盘企业版
Motivation and Context / 背景
https://github.com/orgs/OpenListTeam/discussions/170
How Has This Been Tested? / 测试
修改自老阿里云盘驱动,个人测试使用1个月,没太大问题。
获取Refresh Token有点麻烦,我这边浏览器F12无法直接获取,暂不提供方法。
Checklist / 检查清单
我已阅读 CONTRIBUTING 文档。
go fmtor prettier.我已使用
go fmt或 prettier 格式化提交的代码。我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
我已相应更新了相关仓库(若适用)。