feat: add pikpak offline download function (#6648)
* add pikpak offline download function * 完善PikPak离线下载功能 * 删除多余的代码 * add task cache to avoid too many requests about API * 优化Status函数 * 完善所有功能,目前测试无BUG * 减少缓存时间,优化添加离线任务的参数
This commit is contained in:
@ -71,6 +71,9 @@ outer:
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if t.tool.Name() == "pikpak" {
|
||||
return nil
|
||||
}
|
||||
t.Status = "offline download completed, maybe transferring"
|
||||
// hack for qBittorrent
|
||||
if t.tool.Name() == "qBittorrent" {
|
||||
@ -123,6 +126,9 @@ func (t *DownloadTask) Complete() error {
|
||||
files []File
|
||||
err error
|
||||
)
|
||||
if t.tool.Name() == "pikpak" {
|
||||
return nil
|
||||
}
|
||||
if getFileser, ok := t.tool.(GetFileser); ok {
|
||||
files = getFileser.GetFiles(t)
|
||||
} else {
|
||||
@ -132,7 +138,7 @@ func (t *DownloadTask) Complete() error {
|
||||
}
|
||||
}
|
||||
// upload files
|
||||
for i, _ := range files {
|
||||
for i := range files {
|
||||
file := files[i]
|
||||
TransferTaskManager.Add(&TransferTask{
|
||||
file: file,
|
||||
|
Reference in New Issue
Block a user