This commit is contained in:
@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"github.com/alist-org/alist/v3/internal/op"
|
||||
"net/http"
|
||||
"regexp"
|
||||
"time"
|
||||
|
||||
"github.com/alist-org/alist/v3/internal/driver"
|
||||
@ -37,7 +36,6 @@ func (d *PikPakShare) Init(ctx context.Context) error {
|
||||
d.Common.CaptchaToken = token
|
||||
op.MustSaveDriverStorage(d)
|
||||
},
|
||||
LowLatencyAddr: "",
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,14 +69,6 @@ func (d *PikPakShare) Init(ctx context.Context) error {
|
||||
d.UserAgent = "MainWindow Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) PikPak/2.5.6.4831 Chrome/100.0.4896.160 Electron/18.3.15 Safari/537.36"
|
||||
}
|
||||
|
||||
if d.UseLowLatencyAddress && d.Addition.CustomLowLatencyAddress != "" {
|
||||
d.Common.LowLatencyAddr = d.Addition.CustomLowLatencyAddress
|
||||
} else if d.UseLowLatencyAddress {
|
||||
d.Common.LowLatencyAddr = findLowestLatencyAddress(DlAddr)
|
||||
d.Addition.CustomLowLatencyAddress = d.Common.LowLatencyAddr
|
||||
op.MustSaveDriverStorage(d)
|
||||
}
|
||||
|
||||
// 获取CaptchaToken
|
||||
err := d.RefreshCaptchaToken(GetAction(http.MethodGet, "https://api-drive.mypikpak.net/drive/v1/share:batch_file_info"), "")
|
||||
if err != nil {
|
||||
@ -131,12 +121,6 @@ func (d *PikPakShare) Link(ctx context.Context, file model.Obj, args model.LinkA
|
||||
|
||||
}
|
||||
|
||||
if d.UseLowLatencyAddress && d.Common.LowLatencyAddr != "" {
|
||||
// 替换为加速链接
|
||||
re := regexp.MustCompile(`https://[^/]+/download/`)
|
||||
downloadUrl = re.ReplaceAllString(downloadUrl, "https://"+d.Common.LowLatencyAddr+"/download/")
|
||||
}
|
||||
|
||||
return &model.Link{
|
||||
URL: downloadUrl,
|
||||
}, nil
|
||||
|
Reference in New Issue
Block a user