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:
Muione
2024-07-07 16:50:05 +08:00
committed by GitHub
parent ca30849e24
commit 3a3d0adfa0
7 changed files with 339 additions and 3 deletions

View File

@ -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,