Compare commits

...
Author SHA1 Message Date
Cursor Agentandqaiu e91c08548a parser: recognize 蓝奏 ajaxfiles.php in file pages
File page iframes now post to /ajaxfiles.php?file=… instead of
ajaxfile.php. The ajax regexes only accepted ajaxm/ajaxfile, so every
file share failed with 获取失败0. The form fields are unchanged.

Co-authored-by: qaiu <[email protected]>
2026-11-25 15:30:41 +00:00
qaiu e794b34982 release: v0.4.12 (#309)
Bump the app version for folder pagination (#308) and the Lanzou
folder risk-page fix (#307). The release notes link the early paging
request in #112 and state that 小飞机 was only mock-tested and 蓝奏优享
was not tried on a folder over 60 items.
2026-11-25 09:42:10 +08:00
qaiu 0a631e75ea Merge pull request #308 from qaiu/cursor/dir-pagination-f75b
目录分页:蓝奏 / 小飞机 / 蓝奏优享(含 #307 目录修复)
2026-11-25 09:02:50 +08:00
9 changed files with 161 additions and 13 deletions

No files matched your search

+2 -2
View File
@@ -25,8 +25,8 @@ body:
id: version
attributes:
label: 版本号
description: 页面上的版本,或发布包名里的版本,例如 0.4.11。
placeholder: "0.4.11"
description: 页面上的版本,或发布包名里的版本,例如 0.4.12。
placeholder: "0.4.12"
validations:
required: true
- type: dropdown
+2 -2
View File
@@ -25,8 +25,8 @@ body:
id: version
attributes:
label: 版本号
description: 例如 0.4.11。不确定就写获取方式。
placeholder: "0.4.11"
description: 例如 0.4.12。不确定就写获取方式。
placeholder: "0.4.12"
validations:
required: true
- type: dropdown
+20 -3
View File
@@ -1,8 +1,25 @@
## 更新内容
- 城通网盘:免密分享,以及带访问密码的单文件和目录,都先走匿名 ALTCHA。已用项目解析器实测带密码 PDF(4005749 字节,文件头 `%PDF-`、文件尾 `%%EOF`)和目录内 zip(158842 字节,文件头 `PK`,可解压)。官方 `/v4` 只在匿名结果仍是 Cloudflare Turnstile、且自己配置了登录令牌时作为可选回退。登录态没有实测。
- 永硕 E 盘:适配新版密码入口页。`ys168.com` 会跟随重定向到对应的 `ysepan.com` 后再验证密码。已实测 `sohehe4.ysepan.com`(密码 `1234`)列出目录,并通过 `parseById` 下载 134041 字节的 MRPG 文件和 128 字节的文本文件。
目录列表支持分页了。之前蓝奏云目录只返回前 50 个文件,小飞机盘和蓝奏云优享只返回前 60 个。早先的分页需求见 https://github.com/qaiu/netdisk-fast-download/issues/112 。
- 目录分页(#308):
- 蓝奏云:按页读取 `filemoreajax`,每页 50 个。只有 `zt=2`(翻过最后一页)或不足 50 个的页才算结束。`zt=4`「请刷新,重试0」视为限流,同一页等 2 秒、再等 5 秒重试;仍失败就返回可重试的错误,不当作最后一页。每页返回 `nextCursor`,下一页沿用同一组翻页参数。不带游标时最多直接请求到第 6 页。
- 小飞机盘、蓝奏云优享:`offset` 作为页码,每页 60 个,由 `totalPage` / `total` 判断是否还有下一页。
- 新接口 `/v2/getFileListPage` 返回 `list`、`hasMore`、`nextPage`、`nextCursor`、`total`、`totalPage`。`/v2/getFileList` 也接受 `page`(或 `pg`)和 `pageCursor`。不带页码时返回结构和以前一样。不支持分页的网盘请求第 2 页及以后时返回空页。
- 前端:目录面板和树形视图有「加载更多」,滚动到底也会自动加载下一页。已加载的文件会保留,加载失败时显示错误并停止自动加载,点击可重试。`list.html` 同样支持。
- 蓝奏云目录风控页(#307):目录分享页改用移动端 UA 请求,文件页仍用桌面 UA。如果仍返回空白风控页,提示「访问风控,不能据此判断分享已失效」,不再报成分享已失效。
- 新增 Issue 表单:解析失败、运行问题、功能建议(#305)。
## 实测范围
- 蓝奏云 `pan.lanzoui.com/b66477`:连续翻完 93 页,共 4598 个文件,没有重复,最后一页 9 个且 `hasMore=false`。实测遇到 `zt=4` 时,2 秒后重试成功。第 2 页的文件可以下载。
- 蓝奏云带密码目录 `moteam.lanzoum.com/b00yaejvte`(密码 `1234`):第 1 页 7 个且没有下一页,第 2 页为空。不带页码的旧接口仍返回 7 个。
- 蓝奏云优享:用真实小目录、把每页条数临时设为 1 来验证。`offset` 是从 1 开始的页码,`total` / `totalPage` 正确,翻过最后一页为空。
- 夸克、城通:目录列表和以前一样,请求第 2 页返回空页。
## 限制
这次只修复并实测了上述城通和永硕样例,不表示所有分享都可用。服务端不能解开 Cloudflare Turnstile。没有配置城通登录令牌时,如果匿名 ALTCHA 之后仍然返回 Turnstile,带密码分享会失败。永硕 `ysupan.com` 旧接口,以及部分直链端口,这次没有改。
- 小飞机盘没有可用的真实目录样本,只做了本地模拟测试(与蓝奏云优享是同一套接口)。
- 蓝奏云优享没有实测超过 60 个文件的大目录。
- 蓝奏云不带游标直接请求第 7 页及以后会提示需要游标,请按 `nextCursor` 顺序翻页。
- 风控页提示只能说明这次请求被拦截,不代表分享一定有效。
+1 -1
View File
@@ -470,7 +470,7 @@ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtow
> 注意: netdisk-fast-download.service中的ExecStart的路径改为实际路径
```shell
cd ~
wget -O netdisk-fast-download.zip https://github.com/qaiu/netdisk-fast-download/releases/download/v0.4.11/netdisk-fast-download-linux-amd64.zip
wget -O netdisk-fast-download.zip https://github.com/qaiu/netdisk-fast-download/releases/download/v0.4.12/netdisk-fast-download-linux-amd64.zip
unzip netdisk-fast-download.zip
cd netdisk-fast-download
bash service-install.sh
@@ -99,11 +99,14 @@ public class LzTool extends PanBase {
private static final Pattern P_AJAXDATA = Pattern.compile("ajaxdata\\s*=\\s*'([^']+)'");
private static final Pattern P_WEBSIGN = Pattern.compile("'websign'\\s*:\\s*'([^']*)'");
private static final Pattern P_WEBPAGE = Pattern.compile("[?&]webpage=([^&\"'\\s#]+)");
/** 页面脚本里的绝对 ajax,例如 https://apifile.lanzouw.com/ajaxfile.php?file=123 */
/**
* 页面脚本里的绝对 ajax,例如 https://apifile.lanzouw.com/ajaxfile.php?file=123。
* 文件名有 ajaxm / ajaxfile / ajaxfiles 三种,2026-11 起文件页 iframe 改用 ajaxfiles.php。
*/
private static final Pattern P_AJAX_ABSOLUTE = Pattern.compile(
"['\"]((?:https?:)?//[^'\"\\s<>]+/ajax(?:m|file)\\.php\\?file=\\d+)['\"]",
"['\"]((?:https?:)?//[^'\"\\s<>]+/ajax(?:m|files?)\\.php\\?file=\\d+)['\"]",
Pattern.CASE_INSENSITIVE);
private static final Pattern P_AJAX_PATH = Pattern.compile("(?:['\"/]|^)(ajax(?:m|file)\\.php\\?file=\\d+)");
private static final Pattern P_AJAX_PATH = Pattern.compile("(?:['\"/]|^)(ajax(?:m|files?)\\.php\\?file=\\d+)");
private static final Pattern P_SIGN = Pattern.compile("'sign'\\s*:\\s*'([^']+)'");
private static final Pattern P_ISNGIS = Pattern.compile("var\\s+isngis\\s*=\\s*'([^']+)'");
private static final Pattern P_VERIFY_FILE = Pattern.compile("'file'\\s*:\\s*'([^']+)'");
@@ -0,0 +1,118 @@
package cn.qaiu.parser.impl;
import cn.qaiu.WebClientVertxInit;
import cn.qaiu.entity.ShareLinkInfo;
import io.vertx.core.MultiMap;
import io.vertx.core.Vertx;
import io.vertx.core.http.HttpServer;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.TimeUnit;
import static org.junit.Assert.assertEquals;
/**
* 蓝奏文件页离线回归:2026-11 起文件页 iframe 的下载 ajax 改名为 ajaxfiles.php,
* 其余字段(wp_sign / ajaxdata / kd / ves)不变。本地模拟 分享页 → /fn iframe → ajaxfiles.php → 下载域 302。
*/
public class LzToolAjaxfilesTest {
private static final String SHARE_KEY = "winx123";
private static final String FILE_ID = "333017612";
private Vertx vertx;
private HttpServer server;
private final List<String> ajaxPaths = new CopyOnWriteArrayList<>();
private final List<MultiMap> ajaxForms = new CopyOnWriteArrayList<>();
@Before
public void setup() throws Exception {
vertx = Vertx.vertx();
WebClientVertxInit.init(vertx);
server = vertx.createHttpServer().requestHandler(req -> {
String path = req.path();
if ("GET".equals(req.method().name()) && path.equals("/" + SHARE_KEY)) {
html(req.response(), sharePage());
} else if ("GET".equals(req.method().name()) && path.equals("/fn")) {
html(req.response(), iframePage());
} else if ("POST".equals(req.method().name()) && path.startsWith("/ajax")) {
req.setExpectMultipart(true);
req.endHandler(v -> {
ajaxPaths.add(req.uri());
ajaxForms.add(MultiMap.caseInsensitiveMultiMap().addAll(req.formAttributes()));
String dom = "http://127.0.0.1:" + server.actualPort();
req.response().putHeader("Content-Type", "application/json")
.end("{\"zt\":1,\"dom\":\"" + dom + "\",\"url\":\"?mock-token\",\"inf\":0}");
});
} else if (path.equals("/file/")) {
req.response().setStatusCode(302)
.putHeader("Location", "http://cdn.test/2026/11/25/steam.zip")
.end();
} else {
req.response().setStatusCode(404).end();
}
}).listen(0, "127.0.0.1").toCompletionStage().toCompletableFuture().get(10, TimeUnit.SECONDS);
}
@After
public void cleanup() throws Exception {
server.close().toCompletionStage().toCompletableFuture().get(10, TimeUnit.SECONDS);
vertx.close().toCompletionStage().toCompletableFuture().get(10, TimeUnit.SECONDS);
}
@Test
public void filePageWithAjaxfilesIframeResolvesDirectLink() throws Exception {
String url = "http://127.0.0.1:" + server.actualPort() + "/" + SHARE_KEY;
ShareLinkInfo info = ShareLinkInfo.newBuilder().type("lz").panName("蓝奏云").shareKey(SHARE_KEY)
.shareUrl(url).standardUrl(url).build();
String link = new LzTool(info).parse().toCompletionStage().toCompletableFuture()
.get(30, TimeUnit.SECONDS);
assertEquals("http://cdn.test/2026/11/25/steam.zip", link);
assertEquals(List.of("/ajaxfiles.php?file=" + FILE_ID), ajaxPaths);
MultiMap form = ajaxForms.get(0);
assertEquals("downprocess", form.get("action"));
assertEquals("test-wp-sign", form.get("sign"));
assertEquals("test-ajaxdata", form.get("websignkey"));
assertEquals("test-ajaxdata", form.get("signs"));
assertEquals("1", form.get("ves"));
}
private static void html(io.vertx.core.http.HttpServerResponse res, String body) {
res.putHeader("Content-Type", "text/html; charset=utf-8").end(body);
}
private static String sharePage() {
return """
<!DOCTYPE html><html><head><title>steam.zip - 蓝奏云</title>
<meta name="description" content="文件大小:1.1 M" /></head><body>
<div class="n_box_3fn" id="filenajax">steam.zip</div>
<div class="n_file"><div class="n_filesize">大小:1.1 M</div>
<iframe class="n_downlink" name="1795620352" src="/fn?mock-fn-query" frameborder="0" scrolling="no"></iframe></div>
</body></html>
""";
}
private static String iframePage() {
return """
<html><body><div id="tourl"></div>
<script type="text/javascript">
var wsk_sign = 'c20230908';
var wp_sign = 'test-wp-sign';
var ajaxdata = 'test-ajaxdata';
var kdns =1;
$.ajax({
type : 'post',
url : '/ajaxfiles.php?file=%s',
data : { 'action':'downprocess','websignkey':ajaxdata,'signs':ajaxdata,'sign':wp_sign,'websign':'','kd':kdns,'ves':1 },
dataType : 'json'
});
</script></body></html>
""".formatted(FILE_ID);
}
}
@@ -156,6 +156,16 @@ public class LzToolShareUrlTest {
assertEquals("https://apifile.lanzouw.com/ajaxm.php?file=42", LzTool.fileAjaxTarget(html));
}
@Test
public void ajaxfilesEndpointIsRecognized() {
assertEquals("/ajaxfiles.php?file=333017612",
LzTool.fileAjaxTarget("url : '/ajaxfiles.php?file=333017612',"));
assertEquals("https://apifile.lanzouw.com/ajaxfiles.php?file=7",
LzTool.fileAjaxTarget("url : 'https://apifile.lanzouw.com/ajaxfiles.php?file=7',"));
assertEquals("/ajaxm.php?file=5", LzTool.fileAjaxTarget("url : '/ajaxm.php?file=5',"));
assertNull(LzTool.fileAjaxTarget("url : '/ajaxfilex.php?file=5',"));
}
@Test
public void relativeFileAjaxFallsThroughToApifileBeforeWwww() {
String html = "url : '/ajaxfile.php?file=150233466',";
+1 -1
View File
@@ -17,7 +17,7 @@
</modules>
<properties>
<revision>0.4.11</revision>
<revision>0.4.12</revision>
<java.version>17</java.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "nfd-web",
"version": "0.4.11",
"version": "0.4.12",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",