diff --git a/drivers/123/driver.go b/drivers/123/driver.go index a96907c4650..ea2ef150142 100644 --- a/drivers/123/driver.go +++ b/drivers/123/driver.go @@ -97,7 +97,8 @@ func (d *Pan123) Link(ctx context.Context, file model.Obj, args model.LinkArgs) } } u_ := u.String() - res, err := base.NoRedirectClient.R().SetQueryParamsFromValues(u.Query()).Head(u_) + log.Debug("download url: ", u_) + res, err := base.NoRedirectClient.R().Get(u_) if err != nil { return nil, err } @@ -108,6 +109,8 @@ func (d *Pan123) Link(ctx context.Context, file model.Obj, args model.LinkArgs) log.Debugln("res code: ", res.StatusCode()) if res.StatusCode() == 302 { link.URL = res.Header().Get("location") + } else if res.StatusCode() == 200 { + link.URL = utils.Json.Get(res.Body(), "data", "redirect_url").ToString() } return &link, nil } else { diff --git a/drivers/123/util.go b/drivers/123/util.go index ffb888d036e..49587a86f19 100644 --- a/drivers/123/util.go +++ b/drivers/123/util.go @@ -19,7 +19,7 @@ const ( SignIn = API + "/user/sign_in" UserInfo = API + "/user/info" FileList = API + "/file/list/new" - DownloadInfo = API + "/file/download_info" + DownloadInfo = "https://www.123pan.com/a/api/file/download_info" Mkdir = API + "/file/upload_request" Move = API + "/file/mod_pid" Rename = API + "/file/rename"