diff --git a/drivers/ilanzou/driver.go b/drivers/ilanzou/driver.go index 1d8e5d36b09..63d86363962 100644 --- a/drivers/ilanzou/driver.go +++ b/drivers/ilanzou/driver.go @@ -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 diff --git a/drivers/ilanzou/meta.go b/drivers/ilanzou/meta.go index ed5b2edb52e..f15fc01a492 100644 --- a/drivers/ilanzou/meta.go +++ b/drivers/ilanzou/meta.go @@ -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", }, } diff --git a/drivers/ilanzou/util.go b/drivers/ilanzou/util.go index 37e111ad53e..c9a30765b7f 100644 --- a/drivers/ilanzou/util.go +++ b/drivers/ilanzou/util.go @@ -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)