mirror of https://github.com/Xhofe/alist
pikpak 验证登陆时 超时时间设置为pikpak官网返回的超时时间
parent
a24cf1b9dc
commit
91efb5cc15
|
@ -401,16 +401,29 @@ func (d *PikPak) refreshCaptchaToken(action string, metas map[string]string) err
|
|||
if resp.Url != "" {
|
||||
// return fmt.Errorf(`need verify: <a target="_blank" href="%s">Click Here</a>`, resp.Url)
|
||||
if d.Addition.CaptchaApi != "" {
|
||||
var captcha_resp CaptchaApiResponse
|
||||
_, err := d.request(d.Addition.CaptchaApi, http.MethodGet, func(req *resty.Request) {
|
||||
queryParams := map[string]string{
|
||||
"url": resp.Url,
|
||||
}
|
||||
req.SetQueryParams(queryParams)
|
||||
}, &captcha_resp)
|
||||
var captcha_resp CaptchaApiResponse // 假设 captcha_resp 是某种结构体
|
||||
client := resty.New().SetTimeout(time.Duration(resp.ExpiresIn) * time.Second)
|
||||
_, err := client.R().
|
||||
SetQueryParams(map[string]string{
|
||||
"url": resp.Url, // 替换为实际的 URL
|
||||
}).
|
||||
SetResult(&captcha_resp).
|
||||
Get(d.Addition.CaptchaApi) // 替换为实际的 API 端点
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// var captcha_resp CaptchaApiResponse
|
||||
// _, err := d.request(d.Addition.CaptchaApi, http.MethodGet, func(req *resty.Request) {
|
||||
// queryParams := map[string]string{
|
||||
// "url": resp.Url,
|
||||
// }
|
||||
// req.SetQueryParams(queryParams)
|
||||
// }, &captcha_resp)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
if captcha_resp.Code == 200 {
|
||||
d.Common.SetCaptchaToken(captcha_resp.Token)
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue