From e1d88b071fbd70770f34c38f5df54359e7525d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=85=E4=B8=98?= <126961341+rzsgsfm@users.noreply.github.com> Date: Sat, 3 Oct 2026 14:50:51 +0800 Subject: [PATCH] fix(drivers/lanzou): support new /fn download page structure (#3157) Lanzou recently changed the file share page: download params moved into an iframe (/fn?) inner page, and the download API is now an absolute URL (https://apifile.woozooo.com/ajaxfile.php?file=N) with new sign params (wp_sign/ajaxdata, action=downprocess). The old findFileIDReg ('/ajaxm.php?file=N' relative path) no longer matches, causing 'failed link: failed get link: not find file id'. Fall back to parsing the new /fn page structure when the legacy regex does not match. Legacy flow is kept untouched. Signed-off-by: rzsgsfm Co-authored-by: rzsgsfm Co-authored-by: GLM (ZCode CLI) --- drivers/lanzou/util.go | 51 +++++++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/drivers/lanzou/util.go b/drivers/lanzou/util.go index 22ea45146..be922a6be 100644 --- a/drivers/lanzou/util.go +++ b/drivers/lanzou/util.go @@ -315,6 +315,36 @@ var findDownPageParamReg = regexp.MustCompile(`= 2 { + // 旧版结构:相对路径 /ajaxm.php?file=N + param, err = htmlJsonToMap(nextPageData) + if err != nil { + return nil, err + } + ajaxUrl := d.ShareUrl + matches[0][1:len(matches[0])-1] + _, err = d.post(ajaxUrl, func(req *resty.Request) { req.SetFormData(param) }, &resp) + } else if fnUrl, fnForm, ferr := parseFnPage(nextPageData); ferr == nil { + // 2026-10 改版结构:/fn? 内页携带 apifile 绝对地址与签名参数 + _, err = d.post(fnUrl, func(req *resty.Request) { req.SetFormData(fnForm) }, &resp) + } else { return nil, fmt.Errorf("not find file id") } - ajaxUrl := d.ShareUrl + matches[0][1:len(matches[0])-1] - var resp FileShareInfoAndUrlResp[int] - _, err = d.post(ajaxUrl, func(req *resty.Request) { req.SetFormData(param) }, &resp) if err != nil { return nil, err }