fix(ilanzou): upgrade devVersion

pull/6513/head v3.35.0
Andy Hsu 2024-05-23 20:05:00 +08:00
parent 0a8d710e01
commit 8e2b9c681a
3 changed files with 13 additions and 6 deletions

View File

@ -147,7 +147,8 @@ func (d *ILanZou) Link(ctx context.Context, file model.Obj, args model.LinkArgs)
// get the url after redirect
res, err := base.NoRedirectClient.R().SetHeaders(map[string]string{
//"Origin": d.conf.site,
"Referer": d.conf.site + "/",
"Referer": d.conf.site + "/",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0",
}).Get(realURL)
if err != nil {
return nil, err
@ -155,7 +156,12 @@ func (d *ILanZou) Link(ctx context.Context, file model.Obj, args model.LinkArgs)
if res.StatusCode() == 302 {
realURL = res.Header().Get("location")
} else {
return nil, fmt.Errorf("redirect failed, status: %d", res.StatusCode())
contentLengthStr := res.Header().Get("Content-Length")
contentLength, err := strconv.Atoi(contentLengthStr)
if err != nil || contentLength == 0 || contentLength > 1024*10 {
return nil, fmt.Errorf("redirect failed, status: %d", res.StatusCode())
}
return nil, fmt.Errorf("redirect failed, content: %s", res.String())
}
link := model.Link{URL: realURL}
return &link, nil

View File

@ -46,7 +46,7 @@ func init() {
bucket: "wpanstore-lanzou",
unproved: "unproved",
proved: "proved",
devVersion: "122",
devVersion: "125",
site: "https://www.ilanzou.com",
},
}
@ -72,7 +72,7 @@ func init() {
bucket: "wpanstore",
unproved: "ws",
proved: "app",
devVersion: "121",
devVersion: "125",
site: "https://www.feijipan.com",
},
}

View File

@ -59,8 +59,9 @@ func (d *ILanZou) request(pathname, method string, callback base.ReqCallback, pr
"extra": "2",
})
req.SetHeaders(map[string]string{
"Origin": d.conf.site,
"Referer": d.conf.site + "/",
"Origin": d.conf.site,
"Referer": d.conf.site + "/",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0",
})
if proved {
req.SetQueryParam("appToken", d.Token)