feat(115): support 302 redirect (#5733)

This commit is contained in:
foxxorcat 2023-12-25 11:28:57 +08:00 committed by GitHub
parent 3eca38e599
commit 299bfb4d7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -63,8 +63,13 @@ func (d *Pan115) Link(ctx context.Context, file model.Obj, args model.LinkArgs)
if err := d.WaitLimit(ctx); err != nil {
return nil, err
}
var userAgent = args.Header.Get("User-Agent")
if userAgent == "" {
userAgent = driver115.UA115Browser
}
downloadInfo, err := d.client.
DownloadWithUA(file.(*FileObj).PickCode, driver115.UA115Browser)
DownloadWithUA(file.(*FileObj).PickCode, userAgent)
if err != nil {
return nil, err
}

View File

@ -16,7 +16,7 @@ type Addition struct {
var config = driver.Config{
Name: "115 Cloud",
DefaultRoot: "0",
OnlyProxy: true,
//OnlyProxy: true,
//OnlyLocal: true,
NoOverwriteUpload: true,
}