mirror of
https://github.com/tickstep/aliyunpan.git
synced 2025-01-23 14:32:14 +08:00
fix illegal download file issue #183
This commit is contained in:
parent
2e4a6d94df
commit
00e1c3e3d4
@ -28,6 +28,7 @@ import (
|
||||
"github.com/tickstep/library-go/requester/rio/speeds"
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
@ -388,7 +389,7 @@ func (der *Downloader) Execute() error {
|
||||
cmdutil.Trigger(der.onCancelEvent)
|
||||
return apierr
|
||||
}
|
||||
if durl == nil || durl.Url == "" || durl.Url == aliyunpan.IllegalDownloadUrl {
|
||||
if durl == nil || durl.Url == "" || strings.HasPrefix(durl.Url, aliyunpan.IllegalDownloadUrlPrefix) {
|
||||
logger.Verbosef("无法获取有效的下载链接: %+v\n", durl)
|
||||
cmdutil.Trigger(der.onCancelEvent)
|
||||
der.removeInstanceState() // 移除断点续传文件
|
||||
|
@ -227,7 +227,7 @@ func (f *FileActionTask) downloadFile(ctx context.Context) error {
|
||||
f.syncFileDb.Update(f.syncItem)
|
||||
return fmt.Errorf("无法获取有效的下载链接")
|
||||
}
|
||||
if durl.Url == aliyunpan.IllegalDownloadUrl {
|
||||
if strings.HasPrefix(durl.Url, aliyunpan.IllegalDownloadUrlPrefix) {
|
||||
logger.Verbosef("无法获取有效的下载链接: %+v\n", durl)
|
||||
f.syncItem.Status = SyncFileStatusIllegal
|
||||
f.syncItem.StatusUpdateTime = utils.NowTimeStr()
|
||||
|
Loading…
Reference in New Issue
Block a user