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 != "" {
|
if resp.Url != "" {
|
||||||
// return fmt.Errorf(`need verify: <a target="_blank" href="%s">Click Here</a>`, resp.Url)
|
// return fmt.Errorf(`need verify: <a target="_blank" href="%s">Click Here</a>`, resp.Url)
|
||||||
if d.Addition.CaptchaApi != "" {
|
if d.Addition.CaptchaApi != "" {
|
||||||
var captcha_resp CaptchaApiResponse
|
var captcha_resp CaptchaApiResponse // 假设 captcha_resp 是某种结构体
|
||||||
_, err := d.request(d.Addition.CaptchaApi, http.MethodGet, func(req *resty.Request) {
|
client := resty.New().SetTimeout(time.Duration(resp.ExpiresIn) * time.Second)
|
||||||
queryParams := map[string]string{
|
_, err := client.R().
|
||||||
"url": resp.Url,
|
SetQueryParams(map[string]string{
|
||||||
}
|
"url": resp.Url, // 替换为实际的 URL
|
||||||
req.SetQueryParams(queryParams)
|
}).
|
||||||
}, &captcha_resp)
|
SetResult(&captcha_resp).
|
||||||
|
Get(d.Addition.CaptchaApi) // 替换为实际的 API 端点
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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 {
|
if captcha_resp.Code == 200 {
|
||||||
d.Common.SetCaptchaToken(captcha_resp.Token)
|
d.Common.SetCaptchaToken(captcha_resp.Token)
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue