feat(115): add offline download tool (close #6888 in #6954)

This commit is contained in:
Shelton Zhu
2024-08-10 20:59:07 +08:00
committed by GitHub
parent 2d77db6bc2
commit 29165d8e60
7 changed files with 166 additions and 13 deletions

View File

@ -66,11 +66,18 @@ func AddURL(ctx context.Context, args *AddURLArgs) (tache.TaskWithInfo, error) {
uid := uuid.NewString()
tempDir := filepath.Join(conf.Conf.TempDir, args.Tool, uid)
deletePolicy := args.DeletePolicy
if args.Tool == "pikpak" {
switch args.Tool {
case "115 Cloud":
tempDir = args.DstDirPath
// 防止将下载好的文件删除
deletePolicy = DeleteNever
case "pikpak":
tempDir = args.DstDirPath
// 防止将下载好的文件删除
deletePolicy = DeleteNever
}
t := &DownloadTask{
Url: args.URL,
DstDirPath: args.DstDirPath,