mirror of https://github.com/Xhofe/alist
Fix 123 download (#9235)
* fix(driver): handle additional HTTP status code 210 for URL redirection * fix(driver): 123 download url error --------- Co-authored-by: Sky_slience <Skyslience@spdzy.com>pull/8491/merge
parent
280960ce3e
commit
394a18cbd9
|
@ -113,6 +113,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() == 210 {
|
||||
link.URL = downloadUrl
|
||||
} else if res.StatusCode() < 300 {
|
||||
link.URL = utils.Json.Get(res.Body(), "data", "redirect_url").ToString()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue