mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-02-03 11:56:18 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f6209a8959 | ||
|
|
72ed0ea8f8 | ||
|
|
d698f82299 |
@@ -40,7 +40,7 @@ https://nfd-parser.github.io/nfd-preview/preview.html?src=https%3A%2F%2Flz.qaiu.
|
||||
|
||||
**JavaScript解析器文档:** [JavaScript解析器开发指南](parser/doc/JAVASCRIPT_PARSER_GUIDE.md) | [自定义解析器扩展指南](parser/doc/CUSTOM_PARSER_GUIDE.md) | [快速开始](parser/doc/CUSTOM_PARSER_QUICKSTART.md)
|
||||
|
||||
**Playground功能:** [JS解析器演练场密码保护说明](PLAYGROUND_PASSWORD_PROTECTION.md)
|
||||
**Playground功能:** [JS解析器演练场密码保护说明](web-service/doc/PLAYGROUND_PASSWORD_PROTECTION.md)
|
||||
|
||||
## 预览地址
|
||||
[预览地址1](https://lz.qaiu.top)
|
||||
@@ -88,7 +88,9 @@ main分支依赖JDK17, 提供了JDK11分支[main-jdk11](https://github.com/qaiu/
|
||||
- Onedrive-pod
|
||||
- Dropbox-pdp
|
||||
- iCloud-pic
|
||||
### 仅专属版提供
|
||||
### 专属版提供
|
||||
- [夸克云盘-qk](https://pan.quark.cn/)
|
||||
- [UC云盘-uc](https://fast.uc.cn/)
|
||||
- [移动云盘-p139](https://yun.139.com/)
|
||||
- [联通云盘-pwo](https://pan.wo.cn/)
|
||||
- [天翼云盘-p189](https://cloud.189.cn/)
|
||||
|
||||
@@ -294,9 +294,24 @@ public class LzTool extends PanBase {
|
||||
String sUrl = shareLinkInfo.getShareUrl();
|
||||
String pwd = shareLinkInfo.getSharePassword();
|
||||
|
||||
WebClient client = clientNoRedirects;
|
||||
client.getAbs(sUrl).send().onSuccess(res -> {
|
||||
webClientSession.getAbs(sUrl).send().onSuccess(res -> {
|
||||
String html = res.bodyAsString();
|
||||
// 检查是否需要 cookie 验证
|
||||
if (html.contains("var arg1='")) {
|
||||
webClientSession = WebClientSession.create(clientNoRedirects);
|
||||
setCookie(html);
|
||||
// 重新请求
|
||||
webClientSession.getAbs(sUrl).send().onSuccess(res2 -> {
|
||||
handleFileListParse(res2.bodyAsString(), pwd, sUrl, promise);
|
||||
}).onFailure(err -> promise.fail(err));
|
||||
return;
|
||||
}
|
||||
handleFileListParse(html, pwd, sUrl, promise);
|
||||
}).onFailure(err -> promise.fail(err));
|
||||
return promise.future();
|
||||
}
|
||||
|
||||
private void handleFileListParse(String html, String pwd, String sUrl, Promise<List<FileInfo>> promise) {
|
||||
try {
|
||||
String jsText = getJsByPwd(pwd, html, "var urls =window.location.href");
|
||||
ScriptObjectMirror scriptObjectMirror = JsExecUtils.executeDynamicJs(jsText, "file");
|
||||
@@ -307,8 +322,27 @@ public class LzTool extends PanBase {
|
||||
MultiMap headers = getHeaders(sUrl);
|
||||
|
||||
String url = SHARE_URL_PREFIX + "/filemoreajax.php?file=" + data.get("fid");
|
||||
client.postAbs(url).putHeaders(headers).sendForm(map).onSuccess(res2 -> {
|
||||
JsonObject fileListJson = asJson(res2);
|
||||
webClientSession.postAbs(url).putHeaders(headers).sendForm(map).onSuccess(res2 -> {
|
||||
String resBody = asText(res2);
|
||||
// 再次检查是否需要 cookie 验证
|
||||
if (resBody.contains("var arg1='")) {
|
||||
setCookie(resBody);
|
||||
// 重新请求
|
||||
webClientSession.postAbs(url).putHeaders(headers).sendForm(map).onSuccess(res3 -> {
|
||||
handleFileListResponse(asText(res3), promise);
|
||||
}).onFailure(err -> promise.fail(err));
|
||||
return;
|
||||
}
|
||||
handleFileListResponse(resBody, promise);
|
||||
}).onFailure(err -> promise.fail(err));
|
||||
} catch (ScriptException | NoSuchMethodException e) {
|
||||
promise.fail(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleFileListResponse(String responseBody, Promise<List<FileInfo>> promise) {
|
||||
try {
|
||||
JsonObject fileListJson = new JsonObject(responseBody);
|
||||
if (fileListJson.getInteger("zt") != 1) {
|
||||
promise.fail(baseMsg() + fileListJson.getString("info"));
|
||||
return;
|
||||
@@ -347,12 +381,9 @@ public class LzTool extends PanBase {
|
||||
list.add(fileInfo);
|
||||
});
|
||||
promise.complete(list);
|
||||
});
|
||||
} catch (ScriptException | NoSuchMethodException e) {
|
||||
} catch (Exception e) {
|
||||
promise.fail(e);
|
||||
}
|
||||
});
|
||||
return promise.future();
|
||||
}
|
||||
|
||||
void setFileInfo(String html, ShareLinkInfo shareLinkInfo) {
|
||||
|
||||
Reference in New Issue
Block a user