Compare commits

...
Author SHA1 Message Date
qaiu b0471904fa Merge pull request #317 from qaiu/release/v0.4.14
release: v0.4.14
2026-11-29 14:34:07 +08:00
qaiu 53e921aa80 release: v0.4.14
Bump the app version to 0.4.14 and parserVersion to 10.2.7 for the
Lanzou cross-site ajax password-page fix (#316) and the 123 pan
v2 App-Version 149 change (#313). Skip parser 10.2.6, which is already
on Maven Central from before these fixes. Release notes record the
2026-11-29 14:19 Asia/Shanghai check on 249 with 792d721: the share
resolved to 2311.exe / 64.9 M, direct link only, file body not fully
downloaded.
2026-11-29 14:28:32 +08:00
qaiu f08dd36635 Merge pull request #316 from qaiu/fix/lz-ajax-empty
fix(parser): 蓝奏跨站 ajax 对齐浏览器头,避免空响应误报
2026-11-29 14:21:53 +08:00
qaiu 792d7210a7 fix(parser): 蓝奏跨站 ajax 对齐浏览器头,避免空 body 被报成空响应
密码页官方 ajax 在 apifile2.woozooo.com,属跨站 XHR。原先固定
Sec-Fetch-Site: same-origin 且不带 Origin,与 Referer 矛盾。
空响应时 bodyAsString 为 null 会 NPE,最终只看到「空响应」。
2026-11-29 13:44:12 +08:00
10 changed files with 111 additions and 33 deletions

No files matched your search

+2 -2
View File
@@ -25,8 +25,8 @@ body:
id: version
attributes:
label: 版本号
description: 页面上的版本,或发布包名里的版本,例如 0.4.13。
placeholder: "0.4.13"
description: 页面上的版本,或发布包名里的版本,例如 0.4.14。
placeholder: "0.4.14"
validations:
required: true
- type: dropdown
+2 -2
View File
@@ -25,8 +25,8 @@ body:
id: version
attributes:
label: 版本号
description: 例如 0.4.13。不确定就写获取方式。
placeholder: "0.4.13"
description: 例如 0.4.14。不确定就写获取方式。
placeholder: "0.4.14"
validations:
required: true
- type: dropdown
+7 -17
View File
@@ -1,22 +1,12 @@
## 更新内容
- 蓝奏文件页识别 `ajaxfiles.php`(#310):
- 单文件页 iframe 里的下载 ajax 写成了 `/ajaxfiles.php`。解析器原来只认 `ajaxm.php` 和 `ajaxfile.php`,匹配不上就报「获取失败0, 可能分享已失效」。表单字段没有改。
- `https://njkn.lanzouw.com/winx123`(无密码)没有失效。修复后本机完整下载 1,197,569 字节,`unzip -t` 无错误。
- 另外三个同样改成 `ajaxfiles.php` 的对照只各下载了 1 MiB Range,返回 206,文件头分别是 7z、zip、zip,没有做完整下载:
- `wwn.lanzouy.com/ihLkw1gezutg`
- b66477 目录下的 `pan.lanzoui.com/io4y41i3zq5e`
- 密码目录 `b00yaejvte` 里的子文件 `w1.lanzn.com/i4VjZ332qzwh`
- 带密码的单文件分享没有找到公开样例,没有实测。
- 目录按已加载文件名筛选(#311):
- 分享目录浏览器和首页解析后的目录共用目录树。两套视图以及独立的 `list.html` 按文件名做大小写不敏感的子串匹配,只筛已经加载的行,不把后续页自动拉完。
- 目录树底部「全选 / 取消全选」只作用于当前关键字命中的、已经加载的可选文件。不勾选被筛掉的项,不拉取未加载分页,也不清掉范围外原来的选择。
- 分页仍走现有的 `nextCursor` / `pageCursor`。
- 界面验收跑在本机开发服务和本机夹具,不是线上分享页。
- 蓝奏密码页跨站 ajax(#316):
- 密码页请求 ajax 时补齐与浏览器一致的跨站头:`Origin` 和 `Sec-Fetch-Site: cross-site`。原先空 body 会被报成空响应,甚至触发 NPE;现在空 body 不再按空响应处理。
- 2026-11-29 14:19 Asia/Shanghai 在 249 用 `792d721` 解析 `https://wwaov.lanzouw.com/iNUOu4hbih4h`(密码 `1t54`),得到 `2311.exe` / 64.9 M / 68052582 字节,直链主机 `exe2.webgetstore.com`。只解析直链,没有完整下载文件体。
- 123 单文件分享下载改为 v2 App-Version 149(#313)。
- Maven 解析器模块版本改为 10.2.7。不使用 10.2.6:Maven Central 已有 `cn.qaiu:parser:10.2.6`,发布时间早于 #313 / #316。
## 限制
- 没有把这次界面验收当成线上分享页或全站界面已验。
- 三个对照链接只验证了 1 MiB Range,不能据此说这些文件已经完整下载并核对。
- 带密码的单文件分享未测。
- 本机访问部分蓝奏下载域时连接时好时坏。winx123 曾连续超时,重试后完整下载成功。
- 蓝奏加密分享的云端验证只解析了直链,没有完整下载并核对文件体。
- 本说明中的版本号变更,不等于已经把 parser 发布到 Maven Central。发布时需要发 10.2.7,不是 10.2.6。
+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.13/netdisk-fast-download-linux-amd64.zip
wget -O netdisk-fast-download.zip https://github.com/qaiu/netdisk-fast-download/releases/download/v0.4.14/netdisk-fast-download-linux-amd64.zip
unzip netdisk-fast-download.zip
cd netdisk-fast-download
bash service-install.sh
+4 -4
View File
@@ -4,26 +4,26 @@ NFD 解析器模块:聚合各类网盘/分享页解析,统一输出文件列
- 语言:Java 17
- 构建:Maven
- 模块版本:10.2.5
- 模块版本:10.2.7
## 依赖(Maven Central)
```xml
<dependency>
<groupId>cn.qaiu</groupId>
<artifactId>parser</artifactId>
<version>10.2.5</version>
<version>10.2.7</version>
</dependency>
```
- Gradle Groovy DSL:
```groovy
dependencies {
implementation 'cn.qaiu:parser:10.2.5'
implementation 'cn.qaiu:parser:10.2.7'
}
```
- Gradle Kotlin DSL:
```kotlin
dependencies {
implementation("cn.qaiu:parser:10.2.5")
implementation("cn.qaiu:parser:10.2.7")
}
```
@@ -423,6 +423,38 @@ public class LzTool extends PanBase {
return "/" + ajax.group(1);
}
/** 分享页 / iframe 里的文件 ajax 表单;提取不到时返回 null。 */
static Map<String, String> fileAjaxForm(String html, String pwd) {
AjaxCall call = extractAjaxFromHtml(html, pwd);
return call == null ? null : call.form();
}
/**
* 文件 ajax 头。官方页把下载 POST 打到 apifile / apifile2 等跨站主机,
* 浏览器会带 Origin 且 Sec-Fetch-Site=cross-site;写 same-origin 与 Referer 矛盾,部分出口会被 ESA 拦。
*/
static MultiMap fileAjaxHeaders(String pageUrl, String ajaxTarget) {
MultiMap headers = HeaderUtils.parseHeaders(DOWN_AJAX_HEADERS);
String page = pageUrl == null ? "" : pageUrl.trim();
if (!page.isEmpty()) {
headers.set("referer", page);
}
String pageOrigin = normalizeOrigin(originOf(page, ""));
String ajaxOrigin = originFromAjaxTarget(ajaxTarget);
if (ajaxOrigin.isEmpty()) {
ajaxOrigin = pageOrigin;
}
if (!pageOrigin.isEmpty()) {
headers.set("origin", pageOrigin);
}
if (!ajaxOrigin.isEmpty() && !ajaxOrigin.equalsIgnoreCase(pageOrigin)) {
headers.set("Sec-Fetch-Site", "cross-site");
} else {
headers.set("Sec-Fetch-Site", "same-origin");
}
return headers;
}
private static void addAjaxOrigin(List<String> origins, String origin) {
if (origin != null && origin.contains("://") && !origins.contains(origin)) {
origins.add(origin);
@@ -814,13 +846,12 @@ public class LzTool extends PanBase {
}
private void getDownURL(String referer, AjaxCall call) {
MultiMap headers = HeaderUtils.parseHeaders(DOWN_AJAX_HEADERS);
// 文件 ajax 优先用页面里的绝对地址(常见 apifile.lanzouw.com)。
// 文件 ajax 优先用页面里的绝对地址(常见 apifile / apifile2)。
// 页面源站空响应再换 FILE_AJAX_FALLBACK_ORIGINS,wwww 仍在最后。
// iframe / 分享页的 Referer 保持原主机,不把页面 GET 改写到 wwww。
String page = referer != null && !referer.isBlank() ? referer : resolveShareUrl();
headers.set("referer", page);
String target = call.absoluteUrl() != null ? call.absoluteUrl() : call.path();
MultiMap headers = fileAjaxHeaders(page, target);
postAjaxAt(fileAjaxOrigins(page, target), 0, call, headers, this::handleAjaxDownResponse, null);
}
@@ -92,7 +92,17 @@ public class HttpResponseHelper {
// -------------------- Buffer 转换 --------------------
private static Buffer toBuffer(HttpResponse<?> res) {
return res.body() instanceof Buffer ? (Buffer) res.body() : Buffer.buffer(res.bodyAsString());
Object raw = res.body();
if (raw instanceof Buffer buf) {
return buf;
}
// 407/空 body 时 body() 与 bodyAsString() 都可能是 null,Buffer.buffer(null) 会 NPE,
// 最终被当成「ajax 返回非JSON: 空响应」。
if (raw == null) {
return Buffer.buffer();
}
String text = res.bodyAsString();
return text == null ? Buffer.buffer() : Buffer.buffer(text);
}
private static void ensureBodyLimit(Buffer body) {
@@ -237,4 +237,51 @@ public class LzToolShareUrlTest {
assertEquals("https://wwww.lanzoux.com", origins.get(origins.size() - 1));
assertFalse(origins.get(0).contains("wwww"));
}
@Test
public void passwordPageUsesApifile2AndIsngisSign() {
String html = """
<div class="passwddiv-btn" onclick="down_p();"></div>
<input id="pwd" />
<script type="text/javascript">
function down_p(){
var kdns =1;
var isngis = '';
var isngis = 'SIGNVALUEFROMISNGIS';
var pwd =document.getElementById('pwd').value;
$.ajax({
type : 'post',
url : 'https://apifile2.woozooo.com/ajaxfile.php?file=333149117',
data : { 'action':'downprocess','sign':isngis,'kd':kdns,'p':pwd, },
dataType : 'json'
});
}
</script>
""";
String target = LzTool.fileAjaxTarget(html);
assertEquals("https://apifile2.woozooo.com/ajaxfile.php?file=333149117", target);
Map<String, String> form = LzTool.fileAjaxForm(html, "1t54");
assertEquals("downprocess", form.get("action"));
assertEquals("SIGNVALUEFROMISNGIS", form.get("sign"));
assertEquals("1", form.get("kd"));
assertEquals("1t54", form.get("p"));
List<String> origins = LzTool.fileAjaxOrigins("https://wwaov.lanzouw.com/iNUOu4hbih4h", target);
assertEquals("https://apifile2.woozooo.com", origins.get(0));
io.vertx.core.MultiMap headers = LzTool.fileAjaxHeaders(
"https://wwaov.lanzouw.com/iNUOu4hbih4h", target);
assertEquals("https://wwaov.lanzouw.com/iNUOu4hbih4h", headers.get("referer"));
assertEquals("https://wwaov.lanzouw.com", headers.get("origin"));
assertEquals("cross-site", headers.get("Sec-Fetch-Site"));
}
@Test
public void sameOriginFileAjaxKeepsSameSiteFetchMetadata() {
io.vertx.core.MultiMap headers = LzTool.fileAjaxHeaders(
"https://apifile.lanzouw.com/fn?x", "/ajaxfile.php?file=1");
assertEquals("same-origin", headers.get("Sec-Fetch-Site"));
assertEquals("https://apifile.lanzouw.com", headers.get("origin"));
assertEquals("https://apifile.lanzouw.com/fn?x", headers.get("referer"));
}
}
+2 -2
View File
@@ -17,7 +17,7 @@
</modules>
<properties>
<revision>0.4.13</revision>
<revision>0.4.14</revision>
<java.version>17</java.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
@@ -32,7 +32,7 @@
<slf4j.version>2.0.16</slf4j.version>
<commons-lang3.version>3.18.0</commons-lang3.version>
<commons-beanutils2.version>2.0.0</commons-beanutils2.version>
<parserVersion>10.2.5</parserVersion>
<parserVersion>10.2.7</parserVersion>
<jackson.version>2.18.9</jackson.version>
<!-- Logback 最新稳定版 -->
<logback.version>1.5.34</logback.version>
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "nfd-web",
"version": "0.4.13",
"version": "0.4.14",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",