fix(drivers/lanzou): support new /fn download page structure - #3157
Merged
Merged
Conversation
Lanzou recently changed the file share page: download params moved into an iframe (/fn?<token>) 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. Co-Authored-By: GLM (ZCode CLI) <noreply@z.ai> Signed-off-by: rzsgsfm <rzsgsfm@users.noreply.github.com>
8 of 9 tasks
xrgzs
approved these changes
Oct 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 摘要
蓝奏云近期再次改版(约 2026-09 底),文件分享页的下载参数被移入一个
<iframe src="/fn?<token>">内页,下载接口从原来的相对路径'/ajaxm.php?file=N'改为绝对地址https://apifile.woozooo.com/ajaxfile.php?file=N,并新增签名参数。现有正则findFileIDReg无法匹配新页面,导致所有 Lanzou 存储取直链时报failed link: failed get link: not find file id(详见 #3155)。本 PR 在旧版正则匹配失败时回退到新版
/fn页解析,旧版流程完全保留:parseFnPage:从/fn内页提取domain1/domain2(ajaxfile.php?file=N绝对地址)、wp_sign、ajaxdataaction=downprocess, websignkey=ajaxdata, signs=ajaxdata, sign=wp_sign, websign=2, kd=1, ves=1{"zt":1,"dom":"...","url":"?..."}),复用现有FileShareInfoAndUrlResp[int]与GetBaseUrl()/GetDownloadUrl(),后续重定向解析逻辑无需改动行为变化:仅影响取直链路径,目录列表、密码校验、上传等其他逻辑不变,无配置/兼容性变化。
Related repository PRs / 关联仓库 PR:
Related Issues / 关联 Issue
Fixes #3155
Testing / 测试
go build ./drivers/lanzou/(Go 1.27.1, linux/amd64)针对真实抓取的
/fn页面 fixture 单测parseFnPage,正确提取 ajax 地址与签名参数Manual test / 手动测试:使用带提取码的真实蓝奏云分享目录,通过本 PR 代码路径完整执行
GetFolderByShareUrl(列目录)→GetFilesByShareUrl(取直链),成功返回真实下载地址(https://*.lanosso.com/file/...)。修复前同一流程报not find file id。说明:
go test ./...未完整执行(仓库既有代码存在fmt.Errorf(info)触发 vet 报错,与本 PR 无关);涉及 lanzou 的验证以上述构建 + 真实环境手动测试代替。Manual test / 手动测试(详见上)
Checklist / 检查清单
gofmt(gofmt -l drivers/lanzou/无输出).AI Disclosure / AI 使用声明
Tools used / 使用工具:
Usage scope / 使用范围:
Code generation / 代码生成
Documentation / 文档
I have reviewed and validated all AI-assisted content included in this PR.
I have ensured that all AI-assisted commits include
Co-Authored-Byattribution.I can reproduce all AI-assisted content included in this PR without any AI tools.