Skip to content

Commit

Permalink
fix(ilanzou): upgrade devVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed May 23, 2024
1 parent 0a8d710 commit 8e2b9c6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
10 changes: 8 additions & 2 deletions drivers/ilanzou/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,21 @@ 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
}
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
Expand Down
4 changes: 2 additions & 2 deletions drivers/ilanzou/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func init() {
bucket: "wpanstore-lanzou",
unproved: "unproved",
proved: "proved",
devVersion: "122",
devVersion: "125",
site: "https://www.ilanzou.com",
},
}
Expand All @@ -72,7 +72,7 @@ func init() {
bucket: "wpanstore",
unproved: "ws",
proved: "app",
devVersion: "121",
devVersion: "125",
site: "https://www.feijipan.com",
},
}
Expand Down
5 changes: 3 additions & 2 deletions drivers/ilanzou/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

1 comment on commit 8e2b9c6

@huolanyun
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

飞机盘无法下载,点击下载 是这个地址 https://tip.feejii.com/202405241240/b9b355ce0ea8cfeae31a7813ec118d1e/common/param.html
蓝奏优享进不了 下载页面,提示 failed link: failed get link: redirect failed, content: {"msg":"该IP已被锁定,请联系客服","code":-1}

Please sign in to comment.