feat(thunder): add offline download tool (#7673)
* feat(thunder): add offline download tool * fix(thunder): improve error handling and parse file size in status response --------- Co-authored-by: Andy Hsu <i@nn.ci>
This commit is contained in:
@ -77,6 +77,10 @@ func AddURL(ctx context.Context, args *AddURLArgs) (task.TaskExtensionInfo, erro
|
||||
tempDir = args.DstDirPath
|
||||
// 防止将下载好的文件删除
|
||||
deletePolicy = DeleteNever
|
||||
case "thunder":
|
||||
tempDir = args.DstDirPath
|
||||
// 防止将下载好的文件删除
|
||||
deletePolicy = DeleteNever
|
||||
}
|
||||
|
||||
taskCreator, _ := ctx.Value("user").(*model.User) // taskCreator is nil when convert failed
|
||||
|
@ -83,6 +83,9 @@ outer:
|
||||
if t.tool.Name() == "pikpak" {
|
||||
return nil
|
||||
}
|
||||
if t.tool.Name() == "thunder" {
|
||||
return nil
|
||||
}
|
||||
if t.tool.Name() == "115 Cloud" {
|
||||
// hack for 115
|
||||
<-time.After(time.Second * 1)
|
||||
@ -161,6 +164,9 @@ func (t *DownloadTask) Complete() error {
|
||||
if t.tool.Name() == "pikpak" {
|
||||
return nil
|
||||
}
|
||||
if t.tool.Name() == "thunder" {
|
||||
return nil
|
||||
}
|
||||
if t.tool.Name() == "115 Cloud" {
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user