mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2025-12-17 12:53:02 +00:00
Compare commits
174 Commits
0.1.7-rele
...
main-jdk11
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ded137539 | ||
|
|
966417f867 | ||
|
|
601a0d1b91 | ||
|
|
ae91ce773e | ||
|
|
d428380f79 | ||
|
|
b0b8b61688 | ||
|
|
7663320a55 | ||
|
|
aaae7ab9a6 | ||
|
|
db7aa2f442 | ||
|
|
d7349cbf05 | ||
|
|
3a5474c9d8 | ||
|
|
4e6ed0f936 | ||
|
|
11ae57856e | ||
|
|
66e67f3e1d | ||
|
|
8913221b97 | ||
|
|
4f4133b98c | ||
|
|
5768ba48e8 | ||
|
|
9780d09e28 | ||
|
|
8358d8d1f8 | ||
|
|
d2a7bf4417 | ||
|
|
24c5495e75 | ||
|
|
4158200ba5 | ||
|
|
2a75f9d34d | ||
|
|
441e69e5f8 | ||
|
|
0a3d91ee52 | ||
|
|
00b3af1c4c | ||
|
|
6d4e0fb56e | ||
|
|
0a296cc937 | ||
|
|
257063bae3 | ||
|
|
e21325a5d0 | ||
|
|
32284c6da0 | ||
|
|
56c68bcce6 | ||
|
|
2ef7efdc42 | ||
|
|
7f00413756 | ||
|
|
d26696d3fa | ||
|
|
595f301748 | ||
|
|
c33b0aa12c | ||
|
|
b21189b7d7 | ||
|
|
618f43da8e | ||
|
|
d28b54f694 | ||
|
|
093d651f2f | ||
|
|
ccc05c13b2 | ||
|
|
1dfcbcc132 | ||
|
|
e9770c8eb3 | ||
|
|
cb14be12e1 | ||
|
|
b0ca6aa4dd | ||
|
|
c958229960 | ||
|
|
8aa10f6f27 | ||
|
|
db073beeb5 | ||
|
|
3d46bcb5c8 | ||
|
|
66e62aead0 | ||
|
|
497a96a1df | ||
|
|
c6e0bed331 | ||
|
|
d678a5f4f0 | ||
|
|
8fcf3d225d | ||
|
|
4858461946 | ||
|
|
7afe52918b | ||
|
|
1a0064fc43 | ||
|
|
7216c84282 | ||
|
|
94a58e2174 | ||
|
|
aa2fae868c | ||
|
|
1b80f49079 | ||
|
|
135632309d | ||
|
|
4c366b7d84 | ||
|
|
e3efdc83e6 | ||
|
|
595575381b | ||
|
|
5cd1ef8bbf | ||
|
|
1aeb838fd9 | ||
|
|
ce414e80b0 | ||
|
|
c47c9bfc68 | ||
|
|
7b2c493cf7 | ||
|
|
b38291b6b2 | ||
|
|
66de667fc3 | ||
|
|
a1e9be0133 | ||
|
|
bf70a7c83d | ||
|
|
6706380558 | ||
|
|
b0d150319d | ||
|
|
03185d0592 | ||
|
|
46f092f2ed | ||
|
|
aea97caed1 | ||
|
|
6d3335d086 | ||
|
|
945e5a74e6 | ||
|
|
1f38201555 | ||
|
|
cfc5afc029 | ||
|
|
0526569d64 | ||
|
|
1c94f4ef8b | ||
|
|
26aabf19db | ||
|
|
2e14d8d345 | ||
|
|
09140d56a3 | ||
|
|
1eec14831c | ||
|
|
aafbf05d34 | ||
|
|
8ffd35f2f0 | ||
|
|
6808381292 | ||
|
|
72cc68e9ad | ||
|
|
7917870c6b | ||
|
|
facf9b645e | ||
|
|
46b4c524f0 | ||
|
|
804c6d96ec | ||
|
|
91c3b0c612 | ||
|
|
400952e33b | ||
|
|
c39f748a51 | ||
|
|
2464693288 | ||
|
|
cfce8c1aef | ||
|
|
258a7cb1cc | ||
|
|
049cfa3676 | ||
|
|
7591aa4336 | ||
|
|
2aef15c670 | ||
|
|
23f29be4b3 | ||
|
|
daea6bea68 | ||
|
|
a71028c665 | ||
|
|
afb997f516 | ||
|
|
940d73a132 | ||
|
|
214eaed56a | ||
|
|
3dab818dcb | ||
|
|
61db1af83d | ||
|
|
7d1cb5b5c1 | ||
|
|
878f61d349 | ||
|
|
9a1c9d8ba2 | ||
|
|
ffd4846924 | ||
|
|
3e1f29c12e | ||
|
|
ec9a6dfe6c | ||
|
|
a72ebbb83c | ||
|
|
a8a172c027 | ||
|
|
bcd71a844c | ||
|
|
3608eb0370 | ||
|
|
dbef574cbc | ||
|
|
e2273587a0 | ||
|
|
9f50299943 | ||
|
|
a51097e1ba | ||
|
|
5628d57299 | ||
|
|
774a069c0e | ||
|
|
5756fde338 | ||
|
|
5d6e22405a | ||
|
|
28497e900a | ||
|
|
00723cc2e2 | ||
|
|
91eb62d308 | ||
|
|
c73e614ce7 | ||
|
|
2586092760 | ||
|
|
0d5b771db8 | ||
|
|
67edd5b5d8 | ||
|
|
40eea9b5f4 | ||
|
|
29a993e1fc | ||
|
|
2c9f0d8e83 | ||
|
|
656a43e4b7 | ||
|
|
f0e28e1c37 | ||
|
|
7e5400d43c | ||
|
|
c7c932daf4 | ||
|
|
8ca0eca2ea | ||
|
|
bb925eba35 | ||
|
|
a105a7d864 | ||
|
|
60e4ac6094 | ||
|
|
8d80ff845a | ||
|
|
49c2bbe680 | ||
|
|
3017e8d17c | ||
|
|
f3ae2b79b8 | ||
|
|
c629525029 | ||
|
|
5d9b18ef41 | ||
|
|
bdee797f7e | ||
|
|
a052bcd841 | ||
|
|
616cc9ce6a | ||
|
|
f124c83286 | ||
|
|
d11fcfb282 | ||
|
|
5ec1ec7789 | ||
|
|
8b6075af37 | ||
|
|
5d23c57d0e | ||
|
|
409163ddf5 | ||
|
|
994202587d | ||
|
|
c01d41f9ca | ||
|
|
c42667fe3b | ||
|
|
c782d495ea | ||
|
|
3f4f9fa76b | ||
|
|
635c639bf5 | ||
|
|
a49b9254a4 | ||
|
|
0c91eea711 |
2
.github/workflows/maven.yml
vendored
2
.github/workflows/maven.yml
vendored
@@ -37,6 +37,8 @@ jobs:
|
|||||||
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
|
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
|
||||||
- name: Update dependency graph
|
- name: Update dependency graph
|
||||||
uses: advanced-security/maven-dependency-submission-action@v3
|
uses: advanced-security/maven-dependency-submission-action@v3
|
||||||
|
with:
|
||||||
|
ignore-maven-wrapper: true
|
||||||
|
|
||||||
# - uses: release-drafter/release-drafter@v5
|
# - uses: release-drafter/release-drafter@v5
|
||||||
# env:
|
# env:
|
||||||
|
|||||||
117
.mvn/wrapper/MavenWrapperDownloader.java
vendored
Normal file
117
.mvn/wrapper/MavenWrapperDownloader.java
vendored
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2007-present the original author or authors.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import java.net.*;
|
||||||
|
import java.io.*;
|
||||||
|
import java.nio.channels.*;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
public class MavenWrapperDownloader {
|
||||||
|
|
||||||
|
private static final String WRAPPER_VERSION = "0.5.6";
|
||||||
|
/**
|
||||||
|
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
|
||||||
|
*/
|
||||||
|
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
|
||||||
|
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
|
||||||
|
* use instead of the default one.
|
||||||
|
*/
|
||||||
|
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
|
||||||
|
".mvn/wrapper/maven-wrapper.properties";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path where the maven-wrapper.jar will be saved to.
|
||||||
|
*/
|
||||||
|
private static final String MAVEN_WRAPPER_JAR_PATH =
|
||||||
|
".mvn/wrapper/maven-wrapper.jar";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Name of the property which should be used to override the default download url for the wrapper.
|
||||||
|
*/
|
||||||
|
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
|
||||||
|
|
||||||
|
public static void main(String args[]) {
|
||||||
|
System.out.println("- Downloader started");
|
||||||
|
File baseDirectory = new File(args[0]);
|
||||||
|
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
|
||||||
|
|
||||||
|
// If the maven-wrapper.properties exists, read it and check if it contains a custom
|
||||||
|
// wrapperUrl parameter.
|
||||||
|
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
|
||||||
|
String url = DEFAULT_DOWNLOAD_URL;
|
||||||
|
if(mavenWrapperPropertyFile.exists()) {
|
||||||
|
FileInputStream mavenWrapperPropertyFileInputStream = null;
|
||||||
|
try {
|
||||||
|
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
|
||||||
|
Properties mavenWrapperProperties = new Properties();
|
||||||
|
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
|
||||||
|
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if(mavenWrapperPropertyFileInputStream != null) {
|
||||||
|
mavenWrapperPropertyFileInputStream.close();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
// Ignore ...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("- Downloading from: " + url);
|
||||||
|
|
||||||
|
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
|
||||||
|
if(!outputFile.getParentFile().exists()) {
|
||||||
|
if(!outputFile.getParentFile().mkdirs()) {
|
||||||
|
System.out.println(
|
||||||
|
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
|
||||||
|
try {
|
||||||
|
downloadFileFromURL(url, outputFile);
|
||||||
|
System.out.println("Done");
|
||||||
|
System.exit(0);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
System.out.println("- Error downloading");
|
||||||
|
e.printStackTrace();
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
|
||||||
|
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
|
||||||
|
String username = System.getenv("MVNW_USERNAME");
|
||||||
|
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
|
||||||
|
Authenticator.setDefault(new Authenticator() {
|
||||||
|
@Override
|
||||||
|
protected PasswordAuthentication getPasswordAuthentication() {
|
||||||
|
return new PasswordAuthentication(username, password);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
URL website = new URL(urlString);
|
||||||
|
ReadableByteChannel rbc;
|
||||||
|
rbc = Channels.newChannel(website.openStream());
|
||||||
|
FileOutputStream fos = new FileOutputStream(destination);
|
||||||
|
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
|
||||||
|
fos.close();
|
||||||
|
rbc.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
Normal file
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
Normal file
Binary file not shown.
2
.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
2
.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
|
||||||
|
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
|
||||||
38
README.md
38
README.md
@@ -30,7 +30,7 @@
|
|||||||
- [奶牛快传 (cow)](https://cowtransfer.com/)
|
- [奶牛快传 (cow)](https://cowtransfer.com/)
|
||||||
- [ ] 登录, 上传, 下载, 分享
|
- [ ] 登录, 上传, 下载, 分享
|
||||||
- [X] 直链解析
|
- [X] 直链解析
|
||||||
- [移动云空间 (ec)](https://www.ecpan.cn/web)
|
- [移动云云空间 (ec)](https://www.ecpan.cn/web)
|
||||||
- [ ] 登录, 上传, 下载, 分享
|
- [ ] 登录, 上传, 下载, 分享
|
||||||
- [X] 直链解析
|
- [X] 直链解析
|
||||||
- [小飞机网盘 (fj)](https://www.feijipan.com/)
|
- [小飞机网盘 (fj)](https://www.feijipan.com/)
|
||||||
@@ -60,14 +60,15 @@
|
|||||||
- 前端界面(建设中...)
|
- 前端界面(建设中...)
|
||||||
|
|
||||||
### API接口说明
|
### API接口说明
|
||||||
your_host指的是您的域名或者IP,实际使用时替换为实际域名或者IP。
|
your_host指的是您的域名或者IP,实际使用时替换为实际域名或者IP,端口默认6400,可以使用nginx代理来做域名访问。
|
||||||
解析方式分为两种类型直接跳转下载链接和获取下载链接(JSON),每一种都提供了两种接口形式parser和网盘标志/分享key拼接的短地址(标志短链),所有规则参考示例。
|
解析方式分为两种类型直接跳转下载链接和获取下载链接(JSON),每一种都提供了两种接口形式parser和网盘标志/分享key拼接的短地址(标志短链),所有规则参考示例。
|
||||||
- 通用接口: `/parser?url=分享链接`,加密分享需要加上参数pwd=密码;
|
- 通用接口: `/parser?url=分享链接`,加密分享需要加上参数pwd=密码;
|
||||||
- 标志短链: `/网盘标识/分享key` 在分享Key后面加上@密码;
|
- 标志短链: `/网盘标识/分享key` 在分享Key后面加上@密码;
|
||||||
- 直链JSON: `通用接口`和`标志短链`前加上`/json` 加密分享的密码规则同上;
|
- 直链JSON: `通用接口`和`标志短链`前加上`/json` 加密分享的密码规则同上;
|
||||||
- 网盘标识参考上面网盘支持情况
|
- 网盘标识参考上面网盘支持情况
|
||||||
- 括号内是可选内容: 表示当带有分享密码时需要加上密码参数
|
- 括号内是可选内容: 表示当带有分享密码时需要加上密码参数
|
||||||
- 移动云空间,小飞机网盘的加密分享的密码可以忽略
|
- 移动云云空间,小飞机网盘的加密分享的密码可以忽略
|
||||||
|
- 移动云空间分享key取分享链接中的data参数,比如`&data=xxx`的参数就是xxx
|
||||||
|
|
||||||
规则示例:
|
规则示例:
|
||||||
```
|
```
|
||||||
@@ -79,7 +80,7 @@ your_host指的是您的域名或者IP,实际使用时替换为实际域名或
|
|||||||
http://your_host/json/parser?url=分享链接(&pwd=xxx)
|
http://your_host/json/parser?url=分享链接(&pwd=xxx)
|
||||||
http://your_host/json/网盘标识/分享key(@分享密码)
|
http://your_host/json/网盘标识/分享key(@分享密码)
|
||||||
3. 需要特殊处理的网盘分享:
|
3. 需要特殊处理的网盘分享:
|
||||||
1. 移动云空间(ec)使用parser?url= 解析时因为分享链接比较特殊(链接带有参数且含有#符号)所以要么对#进行转义%23要么直接去掉# 或者URL直接是主机名+'/'跟一个data参数
|
1. 移动云云空间(ec)使用parser?url= 解析时因为分享链接比较特殊(链接带有参数且含有#符号)所以要么对#进行转义%23要么直接去掉# 或者URL直接是主机名+'/'跟一个data参数
|
||||||
比如 http://your_host/parser?url=https://www.ecpan.cn/web//yunpanProxy?path=%2F%23%2Fdrive%2Foutside&data=81027a5c99af5b11ca004966c945cce6W9Bf2&isShare=1
|
比如 http://your_host/parser?url=https://www.ecpan.cn/web//yunpanProxy?path=%2F%23%2Fdrive%2Foutside&data=81027a5c99af5b11ca004966c945cce6W9Bf2&isShare=1
|
||||||
http://your_host/parser?url=https://www.ecpan.cn/web/%23/yunpanProxy?path=%2F%23%2Fdrive%2Foutside&data=81027a5c99af5b11ca004966c945cce6W9Bf2&isShare=1
|
http://your_host/parser?url=https://www.ecpan.cn/web/%23/yunpanProxy?path=%2F%23%2Fdrive%2Foutside&data=81027a5c99af5b11ca004966c945cce6W9Bf2&isShare=1
|
||||||
http://your_host/parser?url=https://www.ecpan.cn/&data=81027a5c99af5b11ca004966c945cce6W9Bf2&isShare=1
|
http://your_host/parser?url=https://www.ecpan.cn/&data=81027a5c99af5b11ca004966c945cce6W9Bf2&isShare=1
|
||||||
@@ -145,17 +146,17 @@ GET http://127.0.0.1:6400/json/fc/e5079007dc31226096628870c7@QAIU
|
|||||||
# 网盘对比
|
# 网盘对比
|
||||||
|
|
||||||
|
|
||||||
| 网盘名称 | 可直接下载分享 | 加密分享 | 初始网盘空间 | 单文件大小限制 | 登录接口 |
|
| 网盘名称 | 免登陆下载分享 | 加密分享 | 初始网盘空间 | 单文件大小限制 |
|
||||||
|------------|------------------------|----------|-----------|-----------------|------|
|
|-------------|---------|----------|-----------|-----------------|
|
||||||
| 蓝奏云 | √ | √ | 不限空间 | 100M | TODO |
|
| 蓝奏云 | √ | √ | 不限空间 | 100M |
|
||||||
| 奶牛快传 | √ | X | 10G | 不限大小 | TODO |
|
| 奶牛快传 | √ | X | 10G | 不限大小 |
|
||||||
| 移动云空间 | √ | √(密码可忽略) | 5G(个人) | 不限大小 | TODO |
|
| 移动云云空间(个人版) | √ | √(密码可忽略) | 5G(个人) | 不限大小 |
|
||||||
| UC网盘 | 需要登录 | √ | 10G | 不限大小 | TODO |
|
| 小飞机网盘 | √ | √(密码可忽略) | 10G | 不限大小 |
|
||||||
| 小飞机网盘 | √ | √(密码可忽略) | 10G | 不限大小 | TODO |
|
| 360亿方云 | √ | √(密码可忽略) | 100G(须实名) | 不限大小 |
|
||||||
| 360亿方云 | √(试用账号有时间限制企业版需要599续费) | √(密码可忽略) | 100G(须实名) | 不限大小 | TODO |
|
| 123云盘 | √ | √ | 2T | 100G(>100M需要登录) |
|
||||||
| 123云盘 | √ | √ | 2T | 100G(>100M需要登录) | TODO |
|
| 文叔叔 | √ | √ | 10G | 5GB |
|
||||||
| 文叔叔(TODO) | √(注意有时间限制) | √ | 10G | 5GB | TODO |
|
| 夸克网盘 | x | √ | 10G | 不限大小 |
|
||||||
| 夸克网盘(TODO) | 需要登录 | √ | 10G | 不限大小 | TODO |
|
| UC网盘 | x | √ | 10G | 不限大小 |
|
||||||
|
|
||||||
# 打包部署
|
# 打包部署
|
||||||
|
|
||||||
@@ -163,7 +164,7 @@ GET http://127.0.0.1:6400/json/fc/e5079007dc31226096628870c7@QAIU
|
|||||||
- [阿里jdk17(Dragonwell17-windows-x86)](https://lz.qaiu.top/ec/e957acef36ce89e1053979672a90d219n)
|
- [阿里jdk17(Dragonwell17-windows-x86)](https://lz.qaiu.top/ec/e957acef36ce89e1053979672a90d219n)
|
||||||
- [阿里jdk17(Dragonwell17-linux-x86)](https://lz.qaiu.top/ec/6ebc9f2e0bbd53b4c4d5b11013f40a80NHvcYU)
|
- [阿里jdk17(Dragonwell17-linux-x86)](https://lz.qaiu.top/ec/6ebc9f2e0bbd53b4c4d5b11013f40a80NHvcYU)
|
||||||
- [阿里jdk17(Dragonwell17-linux-aarch64)](https://lz.qaiu.top/ec/d14c2d06296f61b52a876b525265e0f8tzxTc5)
|
- [阿里jdk17(Dragonwell17-linux-aarch64)](https://lz.qaiu.top/ec/d14c2d06296f61b52a876b525265e0f8tzxTc5)
|
||||||
- [解析有效性测试-移动云空间-阿里jdk17-linux-x86](https://lz.qaiu.top/json/ec/6ebc9f2e0bbd53b4c4d5b11013f40a80NHvcYU)
|
- [解析有效性测试-移动云云空间-阿里jdk17-linux-x86](https://lz.qaiu.top/json/ec/6ebc9f2e0bbd53b4c4d5b11013f40a80NHvcYU)
|
||||||
|
|
||||||
## 开发和打包
|
## 开发和打包
|
||||||
|
|
||||||
@@ -178,7 +179,7 @@ mvn package
|
|||||||
> 注意: netdisk-fast-download.service中的ExecStart的路径改为实际路径
|
> 注意: netdisk-fast-download.service中的ExecStart的路径改为实际路径
|
||||||
```shell
|
```shell
|
||||||
cd ~
|
cd ~
|
||||||
wget -O netdisk-fast-download.zip https://github.com/qaiu/netdisk-fast-download/releases/download/0.1.7/netdisk-fast-download.zip
|
wget -O netdisk-fast-download.zip https://github.com/qaiu/netdisk-fast-download/releases/download/0.1.7-release-fixed2/netdisk-fast-download-bin-fixed2.zip
|
||||||
unzip netdisk-fast-download-bin.zip
|
unzip netdisk-fast-download-bin.zip
|
||||||
cd netdisk-fast-download
|
cd netdisk-fast-download
|
||||||
bash service-install.sh
|
bash service-install.sh
|
||||||
@@ -212,8 +213,7 @@ bash service-install.sh
|
|||||||
|
|
||||||
## 0.1.8 开发计划
|
## 0.1.8 开发计划
|
||||||
- Docker部署
|
- Docker部署
|
||||||
- 联想乐云解析支持
|
- 联想乐云解析
|
||||||
- CLoudreve解析解析
|
|
||||||
- 直链缓存
|
- 直链缓存
|
||||||
- 日志优化
|
- 日志优化
|
||||||
|
|
||||||
|
|||||||
22
bin/build.bat
Normal file
22
bin/build.bat
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal
|
||||||
|
|
||||||
|
rem 获取当前 Java 版本信息并搜索是否包含 "11."
|
||||||
|
java -version 2>&1 | find "11." >nul
|
||||||
|
|
||||||
|
rem 如果找不到 JDK 17.x,则下载并安装
|
||||||
|
if errorlevel 1 (
|
||||||
|
echo JDK 11.x not found. Downloading and installing...
|
||||||
|
|
||||||
|
REM 这里添加下载和安装 JDK 的代码
|
||||||
|
|
||||||
|
rem 验证安装
|
||||||
|
java -version
|
||||||
|
|
||||||
|
echo JDK 11.x installation complete.
|
||||||
|
) else (
|
||||||
|
echo JDK 11.x is already installed.
|
||||||
|
)
|
||||||
|
|
||||||
|
endlocal
|
||||||
|
pause
|
||||||
@@ -7,7 +7,7 @@ Wants=network-online.target
|
|||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
# User=USER
|
# User=USER
|
||||||
# 需要JDK17及以上版本 注意修改为自己的路径
|
# 需要JDK11及以上版本 注意修改为自己的路径
|
||||||
ExecStart=/root/java/jdk-17.0.2/bin/java -server -Xmx128m -jar /root/java/netdisk-fast-download/netdisk-fast-download.jar
|
ExecStart=/root/java/jdk-17.0.2/bin/java -server -Xmx128m -jar /root/java/netdisk-fast-download/netdisk-fast-download.jar
|
||||||
ExecStop=/bin/kill -s QUIT $MAINPID
|
ExecStop=/bin/kill -s QUIT $MAINPID
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
@echo off && @chcp 65001 > nul
|
@echo off && @chcp 65001 > nul
|
||||||
|
|
||||||
|
:: 需要JDK11及以上版本和Windows环境变量已配置jdk的路径
|
||||||
pushd %~dp0
|
pushd %~dp0
|
||||||
set LIB_DIR=%~dp0
|
set LIB_DIR=%~dp0
|
||||||
for /f "delims=X" %%i in ('dir /b %LIB_DIR%\netdisk-fast-download.jar') do (
|
for /f "delims=X" %%i in ('dir /b %LIB_DIR%\netdisk-fast-download.jar') do (
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>netdisk-fast-download</artifactId>
|
<artifactId>netdisk-fast-download</artifactId>
|
||||||
<groupId>cn.qaiu</groupId>
|
<groupId>cn.qaiu</groupId>
|
||||||
<version>0.1.7</version>
|
<version>${revision}</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<artifactId>core-database</artifactId>
|
<artifactId>core-database</artifactId>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>17</java.version>
|
<java.version>11</java.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<slf4j.version>2.0.5</slf4j.version>
|
<slf4j.version>2.0.5</slf4j.version>
|
||||||
<commons-lang3.version>3.12.0</commons-lang3.version>
|
<commons-lang3.version>3.12.0</commons-lang3.version>
|
||||||
@@ -23,7 +23,6 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.qaiu</groupId>
|
<groupId>cn.qaiu</groupId>
|
||||||
<artifactId>core</artifactId>
|
<artifactId>core</artifactId>
|
||||||
<version>1.0.8</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
|
<!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package cn.qaiu.db.ddl;
|
package cn.qaiu.db.ddl;
|
||||||
|
|
||||||
|
import cn.qaiu.db.pool.JDBCType;
|
||||||
import cn.qaiu.vx.core.util.ReflectionUtil;
|
import cn.qaiu.vx.core.util.ReflectionUtil;
|
||||||
import io.vertx.codegen.format.CamelCase;
|
import io.vertx.codegen.format.CamelCase;
|
||||||
import io.vertx.codegen.format.Case;
|
import io.vertx.codegen.format.Case;
|
||||||
@@ -65,7 +66,9 @@ public class CreateTable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getCreateTableSQL(Class<?> clz) {
|
public static String getCreateTableSQL(Class<?> clz, JDBCType type) {
|
||||||
|
String quotationMarks = type == JDBCType.H2DB ? "\"" : "`";
|
||||||
|
String endStr = type == JDBCType.H2DB ? ");" : ")ENGINE=InnoDB DEFAULT CHARSET=utf8;";
|
||||||
// 判断类上是否有次注解
|
// 判断类上是否有次注解
|
||||||
String primaryKey = null; // 主键
|
String primaryKey = null; // 主键
|
||||||
String tableName = null; // 表名
|
String tableName = null; // 表名
|
||||||
@@ -93,7 +96,7 @@ public class CreateTable {
|
|||||||
int[] decimalSize = {22, 2};
|
int[] decimalSize = {22, 2};
|
||||||
int varcharSize = 255;
|
int varcharSize = 255;
|
||||||
StringBuilder sb = new StringBuilder(50);
|
StringBuilder sb = new StringBuilder(50);
|
||||||
sb.append("CREATE TABLE IF NOT EXISTS \"").append(tableName).append("\" ( \r\n ");
|
sb.append("CREATE TABLE IF NOT EXISTS ").append(quotationMarks).append(tableName).append(quotationMarks).append(" ( \r\n ");
|
||||||
boolean firstId = true;
|
boolean firstId = true;
|
||||||
for (Field f : fields) {
|
for (Field f : fields) {
|
||||||
Class<?> paramType = f.getType();
|
Class<?> paramType = f.getType();
|
||||||
@@ -114,7 +117,7 @@ public class CreateTable {
|
|||||||
decimalSize = fieldAnnotation.decimalSize();
|
decimalSize = fieldAnnotation.decimalSize();
|
||||||
varcharSize = fieldAnnotation.varcharSize();
|
varcharSize = fieldAnnotation.varcharSize();
|
||||||
}
|
}
|
||||||
sb.append("\"").append(column).append("\"");
|
sb.append(quotationMarks).append(column).append(quotationMarks);
|
||||||
sb.append(" ").append(sqlType);
|
sb.append(" ").append(sqlType);
|
||||||
// 添加类型长度
|
// 添加类型长度
|
||||||
if (sqlType.equals("DECIMAL")) {
|
if (sqlType.equals("DECIMAL")) {
|
||||||
@@ -155,17 +158,20 @@ public class CreateTable {
|
|||||||
//去掉最后一个逗号
|
//去掉最后一个逗号
|
||||||
int lastIndex = sql.lastIndexOf(",");
|
int lastIndex = sql.lastIndexOf(",");
|
||||||
sql = sql.substring(0, lastIndex) + sql.substring(lastIndex + 1);
|
sql = sql.substring(0, lastIndex) + sql.substring(lastIndex + 1);
|
||||||
return sql.substring(0, sql.length() - 1) + ");\r\n";
|
return sql.substring(0, sql.length() - 1) + endStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void createTable(JDBCPool pool) {
|
public static void createTable(JDBCPool pool, JDBCType type) {
|
||||||
Set<Class<?>> tableClassList = ReflectionUtil.getReflections().getTypesAnnotatedWith(Table.class);
|
Set<Class<?>> tableClassList = ReflectionUtil.getReflections().getTypesAnnotatedWith(Table.class);
|
||||||
if (tableClassList.isEmpty()) LOGGER.info("Table model class not fount");
|
if (tableClassList.isEmpty()) LOGGER.info("Table model class not fount");
|
||||||
tableClassList.forEach(clazz -> {
|
tableClassList.forEach(clazz -> {
|
||||||
String createTableSQL = getCreateTableSQL(clazz);
|
String createTableSQL = getCreateTableSQL(clazz, type);
|
||||||
|
|
||||||
pool.query(createTableSQL).execute().onSuccess(
|
pool.query(createTableSQL).execute().onSuccess(
|
||||||
rs -> LOGGER.info("\n" + createTableSQL + "create table --> ok")
|
rs -> LOGGER.info("table auto generate:\n" + createTableSQL)
|
||||||
).onFailure(Throwable::printStackTrace);
|
).onFailure(e -> {
|
||||||
|
LOGGER.error(e.getMessage() + " SQL: \n" + createTableSQL);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,13 @@
|
|||||||
package cn.qaiu.db.pool;
|
package cn.qaiu.db.pool;
|
||||||
|
|
||||||
import cn.qaiu.db.ddl.CreateTable;
|
import cn.qaiu.db.ddl.CreateTable;
|
||||||
import cn.qaiu.db.server.H2ServerHolder;
|
|
||||||
import cn.qaiu.vx.core.util.VertxHolder;
|
import cn.qaiu.vx.core.util.VertxHolder;
|
||||||
import io.vertx.core.Promise;
|
|
||||||
import io.vertx.core.Vertx;
|
import io.vertx.core.Vertx;
|
||||||
import io.vertx.core.json.JsonObject;
|
import io.vertx.core.json.JsonObject;
|
||||||
import io.vertx.jdbcclient.JDBCPool;
|
import io.vertx.jdbcclient.JDBCPool;
|
||||||
import org.h2.tools.Server;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化JDBC
|
* 初始化JDBC
|
||||||
* <br>Create date 2021/8/10 12:04
|
* <br>Create date 2021/8/10 12:04
|
||||||
@@ -28,12 +21,14 @@ public class JDBCPoolInit {
|
|||||||
JsonObject dbConfig;
|
JsonObject dbConfig;
|
||||||
Vertx vertx = VertxHolder.getVertxInstance();
|
Vertx vertx = VertxHolder.getVertxInstance();
|
||||||
String url;
|
String url;
|
||||||
|
private JDBCType type;
|
||||||
|
|
||||||
private static JDBCPoolInit instance;
|
private static JDBCPoolInit instance;
|
||||||
|
|
||||||
public JDBCPoolInit(Builder builder) {
|
public JDBCPoolInit(Builder builder) {
|
||||||
this.dbConfig = builder.dbConfig;
|
this.dbConfig = builder.dbConfig;
|
||||||
this.url = builder.url;
|
this.url = builder.url;
|
||||||
|
this.type = builder.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
@@ -47,10 +42,12 @@ public class JDBCPoolInit {
|
|||||||
public static class Builder {
|
public static class Builder {
|
||||||
private JsonObject dbConfig;
|
private JsonObject dbConfig;
|
||||||
private String url;
|
private String url;
|
||||||
|
private JDBCType type;
|
||||||
|
|
||||||
public Builder config(JsonObject dbConfig) {
|
public Builder config(JsonObject dbConfig) {
|
||||||
this.dbConfig = dbConfig;
|
this.dbConfig = dbConfig;
|
||||||
this.url = dbConfig.getString("jdbcUrl");
|
this.url = dbConfig.getString("jdbcUrl");
|
||||||
|
this.type = JDBCUtil.getJDBCType(dbConfig.getString("driverClassName"));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,67 +70,16 @@ public class JDBCPoolInit {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 异步启动H2服务
|
// 初始化数据库连接
|
||||||
vertx.createSharedWorkerExecutor("h2-server", 1, Long.MAX_VALUE)
|
vertx.createSharedWorkerExecutor("sql-pool-init")
|
||||||
.executeBlocking(this::h2serverExecute)
|
.executeBlocking(() -> {
|
||||||
.onSuccess(res->{
|
// 初始化连接池
|
||||||
LOGGER.info(res);
|
pool = JDBCPool.pool(vertx, dbConfig);
|
||||||
// 初始化数据库连接
|
CreateTable.createTable(pool, type);
|
||||||
vertx.createSharedWorkerExecutor("sql-pool-init")
|
return "数据库连接初始化: URL=" + url;
|
||||||
.executeBlocking(this::poolInitExecute)
|
|
||||||
.onSuccess(LOGGER::info)
|
|
||||||
.onFailure(Throwable::printStackTrace);
|
|
||||||
})
|
})
|
||||||
|
.onSuccess(LOGGER::info)
|
||||||
.onFailure(Throwable::printStackTrace);
|
.onFailure(Throwable::printStackTrace);
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void poolInitExecute(Promise<String> promise) {
|
|
||||||
// 初始化连接池
|
|
||||||
pool = JDBCPool.pool(vertx, dbConfig);
|
|
||||||
CreateTable.createTable(pool);
|
|
||||||
promise.complete("init jdbc pool success");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void checkOrCreateDBFile() {
|
|
||||||
LOGGER.info("init sql start");
|
|
||||||
String[] path = url.split("\\./");
|
|
||||||
path[1] = path[1].split(";")[0];
|
|
||||||
path[1] += ".mv.db";
|
|
||||||
File file = new File(path[1]);
|
|
||||||
if (!file.exists()) {
|
|
||||||
if (!file.getParentFile().exists()) {
|
|
||||||
if (file.getParentFile().mkdirs()) {
|
|
||||||
LOGGER.info("mkdirs -> {}", file.getParentFile().getAbsolutePath());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
if (file.createNewFile()) {
|
|
||||||
LOGGER.info("create file -> {}", file.getAbsolutePath());
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
LOGGER.error(e.getMessage());
|
|
||||||
throw new RuntimeException("file create failed");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void h2serverExecute(Promise<String> promise) {
|
|
||||||
// 初始化H2db, 创建本地db文件
|
|
||||||
checkOrCreateDBFile();
|
|
||||||
|
|
||||||
try {
|
|
||||||
String url = dbConfig.getString("jdbcUrl");
|
|
||||||
String[] portStr = url.split(":");
|
|
||||||
String port = portStr[portStr.length - 1].split("[/\\\\]")[0];
|
|
||||||
LOGGER.info("H2server listen port to {}", port);
|
|
||||||
H2ServerHolder.init(Server.createTcpServer("-tcp", "-tcpAllowOthers", "-tcpPort", port).start());
|
|
||||||
promise.complete("Start h2Server success");
|
|
||||||
} catch (SQLException e) {
|
|
||||||
throw new RuntimeException("Start h2Server failed: " + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package cn.qaiu.db.pool;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author <a href="https://qaiu.top">QAIU</a>
|
||||||
|
* @date 2023/10/10 14:06
|
||||||
|
*/
|
||||||
|
public enum JDBCType {
|
||||||
|
MySQL, H2DB
|
||||||
|
}
|
||||||
18
core-database/src/main/java/cn/qaiu/db/pool/JDBCUtil.java
Normal file
18
core-database/src/main/java/cn/qaiu/db/pool/JDBCUtil.java
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
package cn.qaiu.db.pool;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author <a href="https://qaiu.top">QAIU</a>
|
||||||
|
* @date 2023/10/10 14:05
|
||||||
|
*/
|
||||||
|
public class JDBCUtil {
|
||||||
|
public static JDBCType getJDBCType(String deviceName) {
|
||||||
|
switch (deviceName) {
|
||||||
|
case "com.mysql.cj.jdbc.Driver":
|
||||||
|
case "com.mysql.jdbc.Driver":
|
||||||
|
return JDBCType.MySQL;
|
||||||
|
case "org.h2.Driver":
|
||||||
|
return JDBCType.H2DB;
|
||||||
|
}
|
||||||
|
throw new RuntimeException("不支持的SQL驱动类型: " + deviceName);
|
||||||
|
}
|
||||||
|
}
|
||||||
23
core/pom.xml
23
core/pom.xml
@@ -5,28 +5,15 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>netdisk-fast-download</artifactId>
|
<artifactId>netdisk-fast-download</artifactId>
|
||||||
<groupId>cn.qaiu</groupId>
|
<groupId>cn.qaiu</groupId>
|
||||||
<version>0.1.7</version>
|
<version>${revision}</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<version>1.0.8</version>
|
|
||||||
<artifactId>core</artifactId>
|
<artifactId>core</artifactId>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencyManagement>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.vertx</groupId>
|
|
||||||
<artifactId>vertx-dependencies</artifactId>
|
|
||||||
<version>${vertx.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</dependencyManagement>
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<!--logback日志实现-->
|
<!--logback日志实现-->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -73,11 +60,13 @@
|
|||||||
<artifactId>commons-lang3</artifactId>
|
<artifactId>commons-lang3</artifactId>
|
||||||
<version>${commons-lang3.version}</version>
|
<version>${commons-lang3.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/com.melloware/commons-beanutils2 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-beanutils</groupId>
|
<groupId>com.melloware</groupId>
|
||||||
<artifactId>commons-beanutils</artifactId>
|
<artifactId>commons-beanutils2</artifactId>
|
||||||
<version>1.9.4</version>
|
<version>${commons-beanutils2.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-databind</artifactId>
|
<artifactId>jackson-databind</artifactId>
|
||||||
|
|||||||
@@ -87,19 +87,15 @@ public final class Deploy {
|
|||||||
var calendar = Calendar.getInstance();
|
var calendar = Calendar.getInstance();
|
||||||
calendar.setTime(new Date());
|
calendar.setTime(new Date());
|
||||||
var year = calendar.get(Calendar.YEAR);
|
var year = calendar.get(Calendar.YEAR);
|
||||||
var logoTemplate = """
|
|
||||||
|
|
||||||
Web Server powered by:\s
|
|
||||||
____ ____ _ _ _ \s
|
|
||||||
|_^^_| |_^^_| / |_ | | | | \s
|
|
||||||
\\ \\ / /.---. _ .--.`| |-' _ __ | |__| |_ \s
|
|
||||||
\\ \\ / // /__\\\\[ `/'`\\]| | [ \\ [ ]|____ _|\s
|
|
||||||
\\ V / | \\__., | | | |, _ > ' < _| |_ \s
|
|
||||||
\\_/ '.__.'[___] \\__/(_)[__]`\\_] |_____|\s
|
|
||||||
Version: %s; Framework version: %s; %s©%d.
|
|
||||||
|
|
||||||
""";
|
|
||||||
|
|
||||||
|
String logoTemplate = "Web Server powered by: \n" +
|
||||||
|
" ____ ____ _ _ _ \n" +
|
||||||
|
"|_^^_| |_^^_| / |_ | | | | \n" +
|
||||||
|
" \\ \\ / /.---. _ .--.`| |-' _ __ | |__| |_ \n" +
|
||||||
|
" \\ \\ / // /__\\\\[ `/'`\\]| | [ \\ [ ]|____ _|\n" +
|
||||||
|
" \\ V / | \\__., | | | |, _ > ' < _| |_ \n" +
|
||||||
|
" \\_/ '.__.'[___] \\__/(_)[__]`\\_] |_____|\n" +
|
||||||
|
" Version: %s; Framework version: %s; JDK11; %s©%d.\n\n";
|
||||||
System.out.printf(logoTemplate,
|
System.out.printf(logoTemplate,
|
||||||
conf.getString("version_app"),
|
conf.getString("version_app"),
|
||||||
VersionCommand.getVersion(),
|
VersionCommand.getVersion(),
|
||||||
@@ -132,9 +128,10 @@ public final class Deploy {
|
|||||||
localMap.put(GLOBAL_CONFIG, globalConfig);
|
localMap.put(GLOBAL_CONFIG, globalConfig);
|
||||||
localMap.put(CUSTOM_CONFIG, customConfig);
|
localMap.put(CUSTOM_CONFIG, customConfig);
|
||||||
localMap.put(SERVER, globalConfig.getJsonObject(SERVER));
|
localMap.put(SERVER, globalConfig.getJsonObject(SERVER));
|
||||||
var future0 = vertx.createSharedWorkerExecutor("other-handle").executeBlocking(bch -> {
|
var future0 = vertx.createSharedWorkerExecutor("other-handle").executeBlocking(() -> {
|
||||||
handle.handle(globalConfig);
|
handle.handle(globalConfig);
|
||||||
bch.complete("other handle complete");
|
LOGGER.info("other handle complete");
|
||||||
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 部署 路由、异步service、反向代理 服务
|
// 部署 路由、异步service、反向代理 服务
|
||||||
@@ -142,7 +139,7 @@ public final class Deploy {
|
|||||||
var future2 = vertx.deployVerticle(ServiceVerticle.class, getWorkDeploymentOptions("Service"));
|
var future2 = vertx.deployVerticle(ServiceVerticle.class, getWorkDeploymentOptions("Service"));
|
||||||
var future3 = vertx.deployVerticle(ReverseProxyVerticle.class, getWorkDeploymentOptions("proxy"));
|
var future3 = vertx.deployVerticle(ReverseProxyVerticle.class, getWorkDeploymentOptions("proxy"));
|
||||||
|
|
||||||
CompositeFuture.all(future1, future2, future3, future0)
|
Future.all(future1, future2, future3, future0)
|
||||||
.onSuccess(this::deployWorkVerticalSuccess)
|
.onSuccess(this::deployWorkVerticalSuccess)
|
||||||
.onFailure(this::deployVerticalFailed);
|
.onFailure(this::deployVerticalFailed);
|
||||||
}
|
}
|
||||||
@@ -181,7 +178,7 @@ public final class Deploy {
|
|||||||
private DeploymentOptions getWorkDeploymentOptions(String name, int ins) {
|
private DeploymentOptions getWorkDeploymentOptions(String name, int ins) {
|
||||||
return new DeploymentOptions()
|
return new DeploymentOptions()
|
||||||
.setWorkerPoolName(name)
|
.setWorkerPoolName(name)
|
||||||
.setWorker(true)
|
.setThreadingModel(ThreadingModel.WORKER)
|
||||||
.setInstances(ins);
|
.setInstances(ins);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ public class RouterHandlerFactory implements BaseHttpApi {
|
|||||||
return Integer.compare(routeHandler2.order(), routeHandler1.order());
|
return Integer.compare(routeHandler2.order(), routeHandler1.order());
|
||||||
};
|
};
|
||||||
// 获取处理器类列表
|
// 获取处理器类列表
|
||||||
List<Class<?>> sortedHandlers = handlers.stream().sorted(comparator).toList();
|
List<Class<?>> sortedHandlers = handlers.stream().sorted(comparator).collect(Collectors.toList());
|
||||||
for (Class<?> handler : sortedHandlers) {
|
for (Class<?> handler : sortedHandlers) {
|
||||||
try {
|
try {
|
||||||
// 注册请求处理方法
|
// 注册请求处理方法
|
||||||
@@ -153,7 +153,7 @@ public class RouterHandlerFactory implements BaseHttpApi {
|
|||||||
|
|
||||||
methodList.addAll(Stream.of(methods).filter(
|
methodList.addAll(Stream.of(methods).filter(
|
||||||
method -> method.isAnnotationPresent(SockRouteMapper.class)
|
method -> method.isAnnotationPresent(SockRouteMapper.class)
|
||||||
).toList());
|
).collect(Collectors.toList()));
|
||||||
|
|
||||||
// 依次注册处理方法
|
// 依次注册处理方法
|
||||||
for (Method method : methodList) {
|
for (Method method : methodList) {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||||||
import io.vertx.core.json.JsonObject;
|
import io.vertx.core.json.JsonObject;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.io.Serial;
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -17,7 +16,6 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
public class JsonResult<T> implements Serializable {
|
public class JsonResult<T> implements Serializable {
|
||||||
|
|
||||||
@Serial
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static final int SUCCESS_CODE = 200;
|
private static final int SUCCESS_CODE = 200;
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package cn.qaiu.vx.core.util;
|
|||||||
import cn.qaiu.vx.core.annotaions.HandleSortFilter;
|
import cn.qaiu.vx.core.annotaions.HandleSortFilter;
|
||||||
import io.vertx.core.buffer.Buffer;
|
import io.vertx.core.buffer.Buffer;
|
||||||
import io.vertx.core.json.JsonObject;
|
import io.vertx.core.json.JsonObject;
|
||||||
import org.apache.commons.beanutils.ConvertUtils;
|
import org.apache.commons.beanutils2.ConvertUtils;
|
||||||
import org.apache.commons.beanutils.Converter;
|
import org.apache.commons.beanutils2.Converter;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package cn.qaiu.vx.core.util;
|
package cn.qaiu.vx.core.util;
|
||||||
|
|
||||||
import io.vertx.core.MultiMap;
|
import io.vertx.core.MultiMap;
|
||||||
import org.apache.commons.beanutils.BeanUtils;
|
import org.apache.commons.beanutils2.BeanUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|||||||
@@ -5,12 +5,13 @@ import javassist.bytecode.AccessFlag;
|
|||||||
import javassist.bytecode.CodeAttribute;
|
import javassist.bytecode.CodeAttribute;
|
||||||
import javassist.bytecode.LocalVariableAttribute;
|
import javassist.bytecode.LocalVariableAttribute;
|
||||||
import javassist.bytecode.MethodInfo;
|
import javassist.bytecode.MethodInfo;
|
||||||
import org.apache.commons.beanutils.ConversionException;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.lang3.time.DateUtils;
|
import org.apache.commons.lang3.time.DateUtils;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
import org.reflections.Reflections;
|
import org.reflections.Reflections;
|
||||||
import org.reflections.scanners.*;
|
import org.reflections.scanners.MemberUsageScanner;
|
||||||
|
import org.reflections.scanners.MethodParameterNamesScanner;
|
||||||
|
import org.reflections.scanners.Scanners;
|
||||||
import org.reflections.util.ClasspathHelper;
|
import org.reflections.util.ClasspathHelper;
|
||||||
import org.reflections.util.ConfigurationBuilder;
|
import org.reflections.util.ConfigurationBuilder;
|
||||||
import org.reflections.util.FilterBuilder;
|
import org.reflections.util.FilterBuilder;
|
||||||
@@ -185,10 +186,10 @@ public final class ReflectionUtil {
|
|||||||
return DateUtils.parseDate(value, fmt);
|
return DateUtils.parseDate(value, fmt);
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new ConversionException("无法将格式化日期");
|
throw new RuntimeException("无法将格式化日期");
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
throw new ConversionException("无法将String类型" + value + "转为[" + name + "]");
|
throw new RuntimeException("无法将String类型" + value + "转为[" + name + "]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,7 +201,7 @@ public final class ReflectionUtil {
|
|||||||
* @return Array
|
* @return Array
|
||||||
*/
|
*/
|
||||||
public static Object conversionArray(CtClass ctClass, String value) {
|
public static Object conversionArray(CtClass ctClass, String value) {
|
||||||
if (!isBasicTypeArray(ctClass)) throw new ConversionException("无法解析数组");
|
if (!isBasicTypeArray(ctClass)) throw new RuntimeException("无法解析数组");
|
||||||
String[] strArr = value.split(",");
|
String[] strArr = value.split(",");
|
||||||
List<Object> obj = new ArrayList<>();
|
List<Object> obj = new ArrayList<>();
|
||||||
Arrays.stream(strArr).forEach(v -> obj.add(conversion(ctClass, v, null)));
|
Arrays.stream(strArr).forEach(v -> obj.add(conversion(ctClass, v, null)));
|
||||||
|
|||||||
310
mvnw
vendored
Normal file
310
mvnw
vendored
Normal file
@@ -0,0 +1,310 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
# or more contributor license agreements. See the NOTICE file
|
||||||
|
# distributed with this work for additional information
|
||||||
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
|
# to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance
|
||||||
|
# with the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing,
|
||||||
|
# software distributed under the License is distributed on an
|
||||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
# KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Maven Start Up Batch script
|
||||||
|
#
|
||||||
|
# Required ENV vars:
|
||||||
|
# ------------------
|
||||||
|
# JAVA_HOME - location of a JDK home dir
|
||||||
|
#
|
||||||
|
# Optional ENV vars
|
||||||
|
# -----------------
|
||||||
|
# M2_HOME - location of maven2's installed home dir
|
||||||
|
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||||
|
# e.g. to debug Maven itself, use
|
||||||
|
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||||
|
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if [ -z "$MAVEN_SKIP_RC" ] ; then
|
||||||
|
|
||||||
|
if [ -f /etc/mavenrc ] ; then
|
||||||
|
. /etc/mavenrc
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "$HOME/.mavenrc" ] ; then
|
||||||
|
. "$HOME/.mavenrc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
# OS specific support. $var _must_ be set to either true or false.
|
||||||
|
cygwin=false;
|
||||||
|
darwin=false;
|
||||||
|
mingw=false
|
||||||
|
case "`uname`" in
|
||||||
|
CYGWIN*) cygwin=true ;;
|
||||||
|
MINGW*) mingw=true;;
|
||||||
|
Darwin*) darwin=true
|
||||||
|
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||||
|
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||||
|
if [ -z "$JAVA_HOME" ]; then
|
||||||
|
if [ -x "/usr/libexec/java_home" ]; then
|
||||||
|
export JAVA_HOME="`/usr/libexec/java_home`"
|
||||||
|
else
|
||||||
|
export JAVA_HOME="/Library/Java/Home"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ] ; then
|
||||||
|
if [ -r /etc/gentoo-release ] ; then
|
||||||
|
JAVA_HOME=`java-config --jre-home`
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$M2_HOME" ] ; then
|
||||||
|
## resolve links - $0 may be a link to maven's home
|
||||||
|
PRG="$0"
|
||||||
|
|
||||||
|
# need this for relative symlinks
|
||||||
|
while [ -h "$PRG" ] ; do
|
||||||
|
ls=`ls -ld "$PRG"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
PRG="$link"
|
||||||
|
else
|
||||||
|
PRG="`dirname "$PRG"`/$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
saveddir=`pwd`
|
||||||
|
|
||||||
|
M2_HOME=`dirname "$PRG"`/..
|
||||||
|
|
||||||
|
# make it fully qualified
|
||||||
|
M2_HOME=`cd "$M2_HOME" && pwd`
|
||||||
|
|
||||||
|
cd "$saveddir"
|
||||||
|
# echo Using m2 at $M2_HOME
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||||
|
if $cygwin ; then
|
||||||
|
[ -n "$M2_HOME" ] &&
|
||||||
|
M2_HOME=`cygpath --unix "$M2_HOME"`
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||||
|
[ -n "$CLASSPATH" ] &&
|
||||||
|
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Mingw, ensure paths are in UNIX format before anything is touched
|
||||||
|
if $mingw ; then
|
||||||
|
[ -n "$M2_HOME" ] &&
|
||||||
|
M2_HOME="`(cd "$M2_HOME"; pwd)`"
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ]; then
|
||||||
|
javaExecutable="`which javac`"
|
||||||
|
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
|
||||||
|
# readlink(1) is not available as standard on Solaris 10.
|
||||||
|
readLink=`which readlink`
|
||||||
|
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
|
||||||
|
if $darwin ; then
|
||||||
|
javaHome="`dirname \"$javaExecutable\"`"
|
||||||
|
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
|
||||||
|
else
|
||||||
|
javaExecutable="`readlink -f \"$javaExecutable\"`"
|
||||||
|
fi
|
||||||
|
javaHome="`dirname \"$javaExecutable\"`"
|
||||||
|
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
|
||||||
|
JAVA_HOME="$javaHome"
|
||||||
|
export JAVA_HOME
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVACMD" ] ; then
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||||
|
else
|
||||||
|
JAVACMD="$JAVA_HOME/bin/java"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD="`which java`"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||||
|
echo " We cannot execute $JAVACMD" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ] ; then
|
||||||
|
echo "Warning: JAVA_HOME environment variable is not set."
|
||||||
|
fi
|
||||||
|
|
||||||
|
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
||||||
|
|
||||||
|
# traverses directory structure from process work directory to filesystem root
|
||||||
|
# first directory with .mvn subdirectory is considered project base directory
|
||||||
|
find_maven_basedir() {
|
||||||
|
|
||||||
|
if [ -z "$1" ]
|
||||||
|
then
|
||||||
|
echo "Path not specified to find_maven_basedir"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
basedir="$1"
|
||||||
|
wdir="$1"
|
||||||
|
while [ "$wdir" != '/' ] ; do
|
||||||
|
if [ -d "$wdir"/.mvn ] ; then
|
||||||
|
basedir=$wdir
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||||
|
if [ -d "${wdir}" ]; then
|
||||||
|
wdir=`cd "$wdir/.."; pwd`
|
||||||
|
fi
|
||||||
|
# end of workaround
|
||||||
|
done
|
||||||
|
echo "${basedir}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# concatenates all lines of a file
|
||||||
|
concat_lines() {
|
||||||
|
if [ -f "$1" ]; then
|
||||||
|
echo "$(tr -s '\n' ' ' < "$1")"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
BASE_DIR=`find_maven_basedir "$(pwd)"`
|
||||||
|
if [ -z "$BASE_DIR" ]; then
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
##########################################################################################
|
||||||
|
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||||
|
# This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||||
|
##########################################################################################
|
||||||
|
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found .mvn/wrapper/maven-wrapper.jar"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
|
||||||
|
fi
|
||||||
|
if [ -n "$MVNW_REPOURL" ]; then
|
||||||
|
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||||
|
else
|
||||||
|
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||||
|
fi
|
||||||
|
while IFS="=" read key value; do
|
||||||
|
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
|
||||||
|
esac
|
||||||
|
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Downloading from: $jarUrl"
|
||||||
|
fi
|
||||||
|
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
|
||||||
|
if $cygwin; then
|
||||||
|
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v wget > /dev/null; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found wget ... using wget"
|
||||||
|
fi
|
||||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||||
|
wget "$jarUrl" -O "$wrapperJarPath"
|
||||||
|
else
|
||||||
|
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
|
||||||
|
fi
|
||||||
|
elif command -v curl > /dev/null; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found curl ... using curl"
|
||||||
|
fi
|
||||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||||
|
curl -o "$wrapperJarPath" "$jarUrl" -f
|
||||||
|
else
|
||||||
|
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Falling back to using Java to download"
|
||||||
|
fi
|
||||||
|
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
||||||
|
# For Cygwin, switch paths to Windows format before running javac
|
||||||
|
if $cygwin; then
|
||||||
|
javaClass=`cygpath --path --windows "$javaClass"`
|
||||||
|
fi
|
||||||
|
if [ -e "$javaClass" ]; then
|
||||||
|
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo " - Compiling MavenWrapperDownloader.java ..."
|
||||||
|
fi
|
||||||
|
# Compiling the Java class
|
||||||
|
("$JAVA_HOME/bin/javac" "$javaClass")
|
||||||
|
fi
|
||||||
|
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||||
|
# Running the downloader
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo " - Running MavenWrapperDownloader.java ..."
|
||||||
|
fi
|
||||||
|
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
##########################################################################################
|
||||||
|
# End of extension
|
||||||
|
##########################################################################################
|
||||||
|
|
||||||
|
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo $MAVEN_PROJECTBASEDIR
|
||||||
|
fi
|
||||||
|
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||||
|
|
||||||
|
# For Cygwin, switch paths to Windows format before running java
|
||||||
|
if $cygwin; then
|
||||||
|
[ -n "$M2_HOME" ] &&
|
||||||
|
M2_HOME=`cygpath --path --windows "$M2_HOME"`
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
||||||
|
[ -n "$CLASSPATH" ] &&
|
||||||
|
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||||
|
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||||
|
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Provide a "standardized" way to retrieve the CLI args that will
|
||||||
|
# work with both Windows and non-Windows executions.
|
||||||
|
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
|
||||||
|
export MAVEN_CMD_LINE_ARGS
|
||||||
|
|
||||||
|
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||||
|
|
||||||
|
exec "$JAVACMD" \
|
||||||
|
$MAVEN_OPTS \
|
||||||
|
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||||
|
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||||
|
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
||||||
182
mvnw.cmd
vendored
Normal file
182
mvnw.cmd
vendored
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
@REM or more contributor license agreements. See the NOTICE file
|
||||||
|
@REM distributed with this work for additional information
|
||||||
|
@REM regarding copyright ownership. The ASF licenses this file
|
||||||
|
@REM to you under the Apache License, Version 2.0 (the
|
||||||
|
@REM "License"); you may not use this file except in compliance
|
||||||
|
@REM with the License. You may obtain a copy of the License at
|
||||||
|
@REM
|
||||||
|
@REM http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@REM
|
||||||
|
@REM Unless required by applicable law or agreed to in writing,
|
||||||
|
@REM software distributed under the License is distributed on an
|
||||||
|
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
@REM KIND, either express or implied. See the License for the
|
||||||
|
@REM specific language governing permissions and limitations
|
||||||
|
@REM under the License.
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
@REM Maven Start Up Batch script
|
||||||
|
@REM
|
||||||
|
@REM Required ENV vars:
|
||||||
|
@REM JAVA_HOME - location of a JDK home dir
|
||||||
|
@REM
|
||||||
|
@REM Optional ENV vars
|
||||||
|
@REM M2_HOME - location of maven2's installed home dir
|
||||||
|
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||||
|
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
|
||||||
|
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||||
|
@REM e.g. to debug Maven itself, use
|
||||||
|
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||||
|
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||||
|
@echo off
|
||||||
|
@REM set title of command window
|
||||||
|
title %0
|
||||||
|
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
|
||||||
|
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||||
|
|
||||||
|
@REM set %HOME% to equivalent of $HOME
|
||||||
|
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||||
|
|
||||||
|
@REM Execute a user defined script before this one
|
||||||
|
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||||
|
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||||
|
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
|
||||||
|
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
|
||||||
|
:skipRcPre
|
||||||
|
|
||||||
|
@setlocal
|
||||||
|
|
||||||
|
set ERROR_CODE=0
|
||||||
|
|
||||||
|
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||||
|
@setlocal
|
||||||
|
|
||||||
|
@REM ==== START VALIDATION ====
|
||||||
|
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Error: JAVA_HOME not found in your environment. >&2
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||||
|
echo location of your Java installation. >&2
|
||||||
|
echo.
|
||||||
|
goto error
|
||||||
|
|
||||||
|
:OkJHome
|
||||||
|
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||||
|
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||||
|
echo location of your Java installation. >&2
|
||||||
|
echo.
|
||||||
|
goto error
|
||||||
|
|
||||||
|
@REM ==== END VALIDATION ====
|
||||||
|
|
||||||
|
:init
|
||||||
|
|
||||||
|
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||||
|
@REM Fallback to current working directory if not found.
|
||||||
|
|
||||||
|
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||||
|
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||||
|
|
||||||
|
set EXEC_DIR=%CD%
|
||||||
|
set WDIR=%EXEC_DIR%
|
||||||
|
:findBaseDir
|
||||||
|
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||||
|
cd ..
|
||||||
|
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||||
|
set WDIR=%CD%
|
||||||
|
goto findBaseDir
|
||||||
|
|
||||||
|
:baseDirFound
|
||||||
|
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||||
|
cd "%EXEC_DIR%"
|
||||||
|
goto endDetectBaseDir
|
||||||
|
|
||||||
|
:baseDirNotFound
|
||||||
|
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||||
|
cd "%EXEC_DIR%"
|
||||||
|
|
||||||
|
:endDetectBaseDir
|
||||||
|
|
||||||
|
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||||
|
|
||||||
|
@setlocal EnableExtensions EnableDelayedExpansion
|
||||||
|
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||||
|
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||||
|
|
||||||
|
:endReadAdditionalConfig
|
||||||
|
|
||||||
|
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||||
|
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||||
|
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||||
|
|
||||||
|
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||||
|
|
||||||
|
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||||
|
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
|
||||||
|
)
|
||||||
|
|
||||||
|
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||||
|
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||||
|
if exist %WRAPPER_JAR% (
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Found %WRAPPER_JAR%
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
if not "%MVNW_REPOURL%" == "" (
|
||||||
|
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||||
|
)
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Couldn't find %WRAPPER_JAR%, downloading it ...
|
||||||
|
echo Downloading from: %DOWNLOAD_URL%
|
||||||
|
)
|
||||||
|
|
||||||
|
powershell -Command "&{"^
|
||||||
|
"$webclient = new-object System.Net.WebClient;"^
|
||||||
|
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
|
||||||
|
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
|
||||||
|
"}"^
|
||||||
|
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
|
||||||
|
"}"
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Finished downloading %WRAPPER_JAR%
|
||||||
|
)
|
||||||
|
)
|
||||||
|
@REM End of extension
|
||||||
|
|
||||||
|
@REM Provide a "standardized" way to retrieve the CLI args that will
|
||||||
|
@REM work with both Windows and non-Windows executions.
|
||||||
|
set MAVEN_CMD_LINE_ARGS=%*
|
||||||
|
|
||||||
|
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||||
|
if ERRORLEVEL 1 goto error
|
||||||
|
goto end
|
||||||
|
|
||||||
|
:error
|
||||||
|
set ERROR_CODE=1
|
||||||
|
|
||||||
|
:end
|
||||||
|
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||||
|
|
||||||
|
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
|
||||||
|
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||||
|
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
|
||||||
|
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
|
||||||
|
:skipRcPost
|
||||||
|
|
||||||
|
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||||
|
if "%MAVEN_BATCH_PAUSE%" == "on" pause
|
||||||
|
|
||||||
|
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
|
||||||
|
|
||||||
|
exit /B %ERROR_CODE%
|
||||||
30
note.txt
Normal file
30
note.txt
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
直链缓存设计
|
||||||
|
每个网盘对应的标准分享URL如下
|
||||||
|
|
||||||
|
蓝奏云 (lz) https://lanzoux.com/{shareKey}
|
||||||
|
蓝奏云优享 (iz) https://www.ilanzou.com/s/{shareKey}
|
||||||
|
奶牛快传 (cow) https://cowtransfer.com/s/{shareKey}
|
||||||
|
移动云云空间 (ec) https://www.ecpan.cn/web/#/yunpanProxy?path=%2F%23%2Fdrive%2Foutside&data={shareKey}&isShare=1
|
||||||
|
小飞机网盘 (fj) https://share.feijipan.com/s/{shareKey}
|
||||||
|
亿方云 (fc) https://v2.fangcloud.com/sharing/{shareKey}
|
||||||
|
123云盘 (ye) https://www.123pan.com/s/{shareKey}.html
|
||||||
|
文叔叔 (ws) https://f.ws59.cn/f/{shareKey}
|
||||||
|
联想乐云 (le) https://lecloud.lenovo.com/share/{shareKey}
|
||||||
|
|
||||||
|
私有化网盘需要自己的域名也就是origin地址.
|
||||||
|
Cloudreve自建网盘 (ce) {origin}/s/{shareKey}
|
||||||
|
|
||||||
|
分享URL -> 类型+key
|
||||||
|
类型+key -> 标准分享URL
|
||||||
|
|
||||||
|
缓存key -> 下载URL
|
||||||
|
分享链接 -> add 网盘类型 pwd origin(私有化) -> 直链
|
||||||
|
|
||||||
|
|
||||||
|
https://f.ws59.cn/f/e3peohu6192
|
||||||
|
|
||||||
|
|
||||||
|
短链接设计
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -2,13 +2,12 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>netdisk-fast-download</artifactId>
|
<artifactId>netdisk-fast-download</artifactId>
|
||||||
<groupId>cn.qaiu</groupId>
|
<groupId>cn.qaiu</groupId>
|
||||||
<version>0.1.7</version>
|
<version>${revision}</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<artifactId>parser</artifactId>
|
<artifactId>parser</artifactId>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -7,24 +7,22 @@ public interface IPanTool {
|
|||||||
Future<String> parse();
|
Future<String> parse();
|
||||||
|
|
||||||
static IPanTool typeMatching(String type, String key, String pwd) {
|
static IPanTool typeMatching(String type, String key, String pwd) {
|
||||||
return switch (type) {
|
switch (type) {
|
||||||
case "lz" -> new LzTool(key, pwd);
|
case "lz": return new LzTool(key, pwd);
|
||||||
case "cow" -> new CowTool(key, pwd);
|
case "cow": return new CowTool(key, pwd);
|
||||||
case "ec" -> new EcTool(key, pwd);
|
case "ec": return new EcTool(key, pwd);
|
||||||
case "fc" -> new FcTool(key, pwd);
|
case "fc": return new FcTool(key, pwd);
|
||||||
case "uc" -> new UcTool(key, pwd);
|
case "uc": return new UcTool(key, pwd);
|
||||||
case "ye" -> new YeTool(key, pwd);
|
case "ye": return new YeTool(key, pwd);
|
||||||
case "fj" -> new FjTool(key, pwd);
|
case "fj": return new FjTool(key, pwd);
|
||||||
case "qk" -> new QkTool(key, pwd);
|
case "qk": return new QkTool(key, pwd);
|
||||||
case "le" -> new LeTool(key, pwd);
|
case "le": return new LeTool(key, pwd);
|
||||||
case "ws" -> new WsTool(key, pwd);
|
case "ws": return new WsTool(key, pwd);
|
||||||
case "qq" -> new QQTool(key, pwd);
|
case "qq": return new QQTool(key, pwd);
|
||||||
case "iz" -> new IzTool(key, pwd);
|
case "iz": return new IzTool(key, pwd);
|
||||||
case "ce" -> new CeTool(key, pwd);
|
case "ce": return new CeTool(key, pwd);
|
||||||
default -> {
|
default: throw new UnsupportedOperationException("未知分享类型");
|
||||||
throw new UnsupportedOperationException("未知分享类型");
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static IPanTool shareURLPrefixMatching(String url, String pwd) {
|
static IPanTool shareURLPrefixMatching(String url, String pwd) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import io.vertx.uritemplate.UriTemplate;
|
|||||||
*/
|
*/
|
||||||
public class EcTool extends PanBase implements IPanTool {
|
public class EcTool extends PanBase implements IPanTool {
|
||||||
private static final String FIRST_REQUEST_URL = "https://www.ecpan.cn/drive/fileextoverrid" +
|
private static final String FIRST_REQUEST_URL = "https://www.ecpan.cn/drive/fileextoverrid" +
|
||||||
".do?chainUrlTemplate=https:%2F%2Fwww.ecpan" +
|
".do?extractionCode={extractionCode}&chainUrlTemplate=https:%2F%2Fwww.ecpan" +
|
||||||
".cn%2Fweb%2F%23%2FyunpanProxy%3Fpath%3D%252F%2523%252Fdrive%252Foutside&parentId=-1&data={dataKey}";
|
".cn%2Fweb%2F%23%2FyunpanProxy%3Fpath%3D%252F%2523%252Fdrive%252Foutside&parentId=-1&data={dataKey}";
|
||||||
|
|
||||||
private static final String DOWNLOAD_REQUEST_URL = "https://www.ecpan.cn/drive/sharedownload.do";
|
private static final String DOWNLOAD_REQUEST_URL = "https://www.ecpan.cn/drive/sharedownload.do";
|
||||||
@@ -27,7 +27,11 @@ public class EcTool extends PanBase implements IPanTool {
|
|||||||
public Future<String> parse() {
|
public Future<String> parse() {
|
||||||
String dataKey = CommonUtils.adaptShortPaths(SHARE_URL_PREFIX, key);
|
String dataKey = CommonUtils.adaptShortPaths(SHARE_URL_PREFIX, key);
|
||||||
// 第一次请求 获取文件信息
|
// 第一次请求 获取文件信息
|
||||||
client.getAbs(UriTemplate.of(FIRST_REQUEST_URL)).setTemplateParam("dataKey", dataKey).send().onSuccess(res -> {
|
client.getAbs(UriTemplate.of(FIRST_REQUEST_URL))
|
||||||
|
.setTemplateParam("dataKey", dataKey)
|
||||||
|
.setTemplateParam("extractionCode", pwd == null ? "" : pwd)
|
||||||
|
.send()
|
||||||
|
.onSuccess(res -> {
|
||||||
JsonObject jsonObject = res.bodyAsJsonObject();
|
JsonObject jsonObject = res.bodyAsJsonObject();
|
||||||
log.debug("ecPan get file info -> {}", jsonObject);
|
log.debug("ecPan get file info -> {}", jsonObject);
|
||||||
JsonObject fileInfo = jsonObject
|
JsonObject fileInfo = jsonObject
|
||||||
@@ -37,6 +41,11 @@ public class EcTool extends PanBase implements IPanTool {
|
|||||||
fail("{} 解析失败:{} key = {}", FIRST_REQUEST_URL, fileInfo.getString("errMesg"), dataKey);
|
fail("{} 解析失败:{} key = {}", FIRST_REQUEST_URL, fileInfo.getString("errMesg"), dataKey);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!fileInfo.containsKey("cloudpFile")) {
|
||||||
|
fail("{} 解析失败:cloudpFile不存在 key = {}", FIRST_REQUEST_URL, dataKey);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
JsonObject cloudpFile = fileInfo.getJsonObject("cloudpFile");
|
JsonObject cloudpFile = fileInfo.getJsonObject("cloudpFile");
|
||||||
JsonArray fileIdList = JsonArray.of(cloudpFile);
|
JsonArray fileIdList = JsonArray.of(cloudpFile);
|
||||||
// 构造请求JSON {"extCodeFlag":0,"isIp":0}
|
// 构造请求JSON {"extCodeFlag":0,"isIp":0}
|
||||||
|
|||||||
@@ -4,14 +4,14 @@ import cn.qaiu.parser.IPanTool;
|
|||||||
import cn.qaiu.parser.PanBase;
|
import cn.qaiu.parser.PanBase;
|
||||||
import cn.qaiu.util.AESUtils;
|
import cn.qaiu.util.AESUtils;
|
||||||
import cn.qaiu.util.CommonUtils;
|
import cn.qaiu.util.CommonUtils;
|
||||||
|
import cn.qaiu.util.UUIDUtil;
|
||||||
import io.vertx.core.Future;
|
import io.vertx.core.Future;
|
||||||
import io.vertx.core.MultiMap;
|
import io.vertx.core.MultiMap;
|
||||||
|
import io.vertx.core.buffer.Buffer;
|
||||||
import io.vertx.core.json.JsonObject;
|
import io.vertx.core.json.JsonObject;
|
||||||
import io.vertx.ext.web.client.WebClient;
|
import io.vertx.ext.web.client.HttpRequest;
|
||||||
import io.vertx.uritemplate.UriTemplate;
|
import io.vertx.uritemplate.UriTemplate;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小飞机网盘
|
* 小飞机网盘
|
||||||
*
|
*
|
||||||
@@ -24,11 +24,19 @@ public class FjTool extends PanBase implements IPanTool {
|
|||||||
public static final String SHARE_URL_PREFIX2 = REFERER_URL + "s/";
|
public static final String SHARE_URL_PREFIX2 = REFERER_URL + "s/";
|
||||||
private static final String API_URL_PREFIX = "https://api.feijipan.com/ws/";
|
private static final String API_URL_PREFIX = "https://api.feijipan.com/ws/";
|
||||||
|
|
||||||
private static final String FIRST_REQUEST_URL = API_URL_PREFIX + "recommend/list?devType=6&devModel=Chrome&extra" +
|
private static final String FIRST_REQUEST_URL = API_URL_PREFIX + "recommend/list?devType=6&devModel=Chrome" +
|
||||||
"=2&shareId={shareId}&type=0&offset=1&limit=60";
|
"&uuid={uuid}&extra=2×tamp={ts}&shareId={shareId}&type=0&offset=1&limit=60";
|
||||||
|
/// recommend/list?devType=6&devModel=Chrome&uuid={uuid}&extra=2×tamp={ts}&shareId={shareId}&type=0&offset=1
|
||||||
|
// &limit=60
|
||||||
|
|
||||||
private static final String SECOND_REQUEST_URL = API_URL_PREFIX + "file/redirect?downloadId={fidEncode}&enable=1" +
|
private static final String SECOND_REQUEST_URL = API_URL_PREFIX + "file/redirect?downloadId={fidEncode}&enable=1" +
|
||||||
"&devType=6&uuid={uuid}×tamp={ts}&auth={auth}";
|
"&devType=6&uuid={uuid}×tamp={ts}&auth={auth}&shareId={dataKey}";
|
||||||
|
// https://api.feijipan.com/ws/file/redirect?downloadId={fidEncode}&enable=1&devType=6&uuid={uuid}×tamp={ts}&auth={auth}&shareId={dataKey}
|
||||||
|
|
||||||
|
|
||||||
|
private static final String VIP_REQUEST_URL = API_URL_PREFIX + "/buy/vip/list?devType=6&devModel=Chrome&uuid" +
|
||||||
|
"={uuid}&extra=2×tamp={ts}";
|
||||||
|
// https://api.feijipan.com/ws/buy/vip/list?devType=6&devModel=Chrome&uuid=WQAl5yBy1naGudJEILBvE&extra=2×tamp=E2C53155F6D09417A27981561134CB73
|
||||||
|
|
||||||
public FjTool(String key, String pwd) {
|
public FjTool(String key, String pwd) {
|
||||||
super(key, pwd);
|
super(key, pwd);
|
||||||
@@ -42,49 +50,69 @@ public class FjTool extends PanBase implements IPanTool {
|
|||||||
dataKey = CommonUtils.adaptShortPaths(SHARE_URL_PREFIX, key);
|
dataKey = CommonUtils.adaptShortPaths(SHARE_URL_PREFIX, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebClient client = clientNoRedirects;
|
// 240530 此处shareId又改为了原始的shareId, nm玩呢?
|
||||||
String shareId = String.valueOf(AESUtils.idEncrypt(dataKey));
|
String shareId = dataKey; // String.valueOf(AESUtils.idEncrypt(dataKey));
|
||||||
|
long nowTs = System.currentTimeMillis();
|
||||||
|
String tsEncode = AESUtils.encrypt2Hex(Long.toString(nowTs));
|
||||||
|
String uuid = UUIDUtil.fjUuid(); // 也可以使用 UUID.randomUUID().toString()
|
||||||
|
|
||||||
// 第一次请求 获取文件信息
|
// 24.5.12 飞机盘 规则修改 需要固定UUID先请求会员接口, 再请求后续接口
|
||||||
// POST https://api.feijipan.com/ws/recommend/list?devType=6&devModel=Chrome&extra=2&shareId=146731&type=0&offset=1&limit=60
|
client.postAbs(UriTemplate.of(VIP_REQUEST_URL))
|
||||||
client.postAbs(UriTemplate.of(FIRST_REQUEST_URL)).setTemplateParam("shareId", shareId).send().onSuccess(res -> {
|
.setTemplateParam("uuid", uuid)
|
||||||
JsonObject resJson = res.bodyAsJsonObject();
|
.setTemplateParam("ts", tsEncode)
|
||||||
if (resJson.getInteger("code") != 200) {
|
.send().onSuccess(r0 -> { // 忽略res
|
||||||
fail(FIRST_REQUEST_URL + " 返回异常: " + resJson);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (resJson.getJsonArray("list").size() == 0) {
|
|
||||||
fail(FIRST_REQUEST_URL + " 解析文件列表为空: " + resJson);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 文件Id
|
|
||||||
JsonObject fileInfo = resJson.getJsonArray("list").getJsonObject(0);
|
|
||||||
String fileId = fileInfo.getString("fileIds");
|
|
||||||
String userId = fileInfo.getString("userId");
|
|
||||||
// 其他参数
|
|
||||||
long nowTs = System.currentTimeMillis();
|
|
||||||
String tsEncode = AESUtils.encrypt2Hex(Long.toString(nowTs));
|
|
||||||
String uuid = UUID.randomUUID().toString();
|
|
||||||
String fidEncode = AESUtils.encrypt2Hex(fileId + "|");
|
|
||||||
String auth = AESUtils.encrypt2Hex(fileId + "|" + nowTs);
|
|
||||||
|
|
||||||
MultiMap headers0 = MultiMap.caseInsensitiveMultiMap();
|
// long nowTs0 = System.currentTimeMillis();
|
||||||
headers0.set("referer", REFERER_URL);
|
String tsEncode0 = AESUtils.encrypt2Hex(Long.toString(nowTs));
|
||||||
// 第二次请求
|
// 第一次请求 获取文件信息
|
||||||
client.getAbs(UriTemplate.of(SECOND_REQUEST_URL))
|
// POST https://api.feijipan.com/ws/recommend/list?devType=6&devModel=Chrome&extra=2&shareId=146731&type=0&offset=1&limit=60
|
||||||
.putHeaders(headers0)
|
client.postAbs(UriTemplate.of(FIRST_REQUEST_URL))
|
||||||
.setTemplateParam("fidEncode", fidEncode)
|
.setTemplateParam("shareId", shareId)
|
||||||
.setTemplateParam("uuid", uuid)
|
.setTemplateParam("uuid", uuid)
|
||||||
.setTemplateParam("ts", tsEncode)
|
.setTemplateParam("ts", tsEncode0)
|
||||||
.setTemplateParam("auth", auth).send().onSuccess(res2 -> {
|
.send().onSuccess(res -> {
|
||||||
MultiMap headers = res2.headers();
|
JsonObject resJson = res.bodyAsJsonObject();
|
||||||
if (!headers.contains("Location")) {
|
if (resJson.getInteger("code") != 200) {
|
||||||
fail(SECOND_REQUEST_URL + " 未找到重定向URL: \n" + res.headers());
|
fail(FIRST_REQUEST_URL + " 返回异常: " + resJson);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
promise.complete(headers.get("Location"));
|
if (resJson.getJsonArray("list").size() == 0) {
|
||||||
}).onFailure(handleFail(SECOND_REQUEST_URL));
|
fail(FIRST_REQUEST_URL + " 解析文件列表为空: " + resJson);
|
||||||
}).onFailure(handleFail(FIRST_REQUEST_URL));
|
return;
|
||||||
|
}
|
||||||
|
// 文件Id
|
||||||
|
JsonObject fileInfo = resJson.getJsonArray("list").getJsonObject(0);
|
||||||
|
String fileId = fileInfo.getString("fileIds");
|
||||||
|
String userId = fileInfo.getString("userId");
|
||||||
|
// 其他参数
|
||||||
|
long nowTs2 = System.currentTimeMillis();
|
||||||
|
String tsEncode2 = AESUtils.encrypt2Hex(Long.toString(nowTs2));
|
||||||
|
String fidEncode = AESUtils.encrypt2Hex(fileId + "|" + userId);
|
||||||
|
String auth = AESUtils.encrypt2Hex(fileId + "|" + nowTs2);
|
||||||
|
|
||||||
|
MultiMap headers0 = MultiMap.caseInsensitiveMultiMap();
|
||||||
|
headers0.set("referer", REFERER_URL);
|
||||||
|
// 第二次请求
|
||||||
|
HttpRequest<Buffer> httpRequest =
|
||||||
|
clientNoRedirects.getAbs(UriTemplate.of(SECOND_REQUEST_URL))
|
||||||
|
.putHeaders(headers0)
|
||||||
|
.setTemplateParam("fidEncode", fidEncode)
|
||||||
|
.setTemplateParam("uuid", uuid)
|
||||||
|
.setTemplateParam("ts", tsEncode2)
|
||||||
|
.setTemplateParam("auth", auth)
|
||||||
|
.setTemplateParam("dataKey", dataKey);
|
||||||
|
System.out.println(httpRequest.toString());
|
||||||
|
httpRequest.send().onSuccess(res2 -> {
|
||||||
|
MultiMap headers = res2.headers();
|
||||||
|
if (!headers.contains("Location")) {
|
||||||
|
fail(SECOND_REQUEST_URL + " 未找到重定向URL: \n" + res.headers());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
promise.complete(headers.get("Location"));
|
||||||
|
}).onFailure(handleFail(SECOND_REQUEST_URL));
|
||||||
|
}).onFailure(handleFail(FIRST_REQUEST_URL));
|
||||||
|
|
||||||
|
}).onFailure(handleFail(FIRST_REQUEST_URL));
|
||||||
|
|
||||||
return promise.future();
|
return promise.future();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import cn.qaiu.util.CommonUtils;
|
|||||||
import io.vertx.core.Future;
|
import io.vertx.core.Future;
|
||||||
import io.vertx.core.MultiMap;
|
import io.vertx.core.MultiMap;
|
||||||
import io.vertx.core.json.JsonObject;
|
import io.vertx.core.json.JsonObject;
|
||||||
import io.vertx.ext.web.client.WebClient;
|
|
||||||
import io.vertx.uritemplate.UriTemplate;
|
import io.vertx.uritemplate.UriTemplate;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@@ -34,12 +33,12 @@ public class IzTool extends PanBase implements IPanTool {
|
|||||||
public Future<String> parse() {
|
public Future<String> parse() {
|
||||||
String dataKey = CommonUtils.adaptShortPaths(SHARE_URL_PREFIX, key);
|
String dataKey = CommonUtils.adaptShortPaths(SHARE_URL_PREFIX, key);
|
||||||
|
|
||||||
WebClient client = clientNoRedirects;
|
// 24.5.12 ilanzou改规则无需计算shareId
|
||||||
String shareId = String.valueOf(AESUtils.idEncryptIz(dataKey));
|
// String shareId = String.valueOf(AESUtils.idEncryptIz(dataKey));
|
||||||
|
|
||||||
// 第一次请求 获取文件信息
|
// 第一次请求 获取文件信息
|
||||||
// POST https://api.feijipan.com/ws/recommend/list?devType=6&devModel=Chrome&extra=2&shareId=146731&type=0&offset=1&limit=60
|
// POST https://api.feijipan.com/ws/recommend/list?devType=6&devModel=Chrome&extra=2&shareId=146731&type=0&offset=1&limit=60
|
||||||
client.postAbs(UriTemplate.of(FIRST_REQUEST_URL)).setTemplateParam("shareId", shareId).send().onSuccess(res -> {
|
client.postAbs(UriTemplate.of(FIRST_REQUEST_URL)).setTemplateParam("shareId", dataKey).send().onSuccess(res -> {
|
||||||
JsonObject resJson = res.bodyAsJsonObject();
|
JsonObject resJson = res.bodyAsJsonObject();
|
||||||
if (resJson.getInteger("code") != 200) {
|
if (resJson.getInteger("code") != 200) {
|
||||||
fail(FIRST_REQUEST_URL + " 返回异常: " + resJson);
|
fail(FIRST_REQUEST_URL + " 返回异常: " + resJson);
|
||||||
@@ -61,7 +60,7 @@ public class IzTool extends PanBase implements IPanTool {
|
|||||||
String fidEncode = AESUtils.encrypt2HexIz(fileId + "|" + userId);
|
String fidEncode = AESUtils.encrypt2HexIz(fileId + "|" + userId);
|
||||||
String auth = AESUtils.encrypt2HexIz(fileId + "|" + nowTs);
|
String auth = AESUtils.encrypt2HexIz(fileId + "|" + nowTs);
|
||||||
// 第二次请求
|
// 第二次请求
|
||||||
client.getAbs(UriTemplate.of(SECOND_REQUEST_URL))
|
clientNoRedirects.getAbs(UriTemplate.of(SECOND_REQUEST_URL))
|
||||||
.setTemplateParam("fidEncode", fidEncode)
|
.setTemplateParam("fidEncode", fidEncode)
|
||||||
.setTemplateParam("uuid", uuid)
|
.setTemplateParam("uuid", uuid)
|
||||||
.setTemplateParam("ts", tsEncode)
|
.setTemplateParam("ts", tsEncode)
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ public class WsTool extends PanBase implements IPanTool {
|
|||||||
super(key, pwd);
|
super(key, pwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public Future<String> parse() {
|
public Future<String> parse() {
|
||||||
|
|
||||||
WebClient httpClient = this.client;
|
WebClient httpClient = this.client;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package cn.qaiu.util;
|
package cn.qaiu.util;
|
||||||
|
|
||||||
|
import cn.qaiu.util.jdk17halper.HexFormat;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import javax.crypto.*;
|
import javax.crypto.*;
|
||||||
@@ -12,7 +13,6 @@ import java.security.MessageDigest;
|
|||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HexFormat;
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -246,6 +246,7 @@ public class AESUtils {
|
|||||||
return idEncrypt0(str, array, 2, 2);
|
return idEncrypt0(str, array, 2, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ================================蓝奏优享版Id解密========================================== //
|
// ================================蓝奏优享版Id解密========================================== //
|
||||||
public static int idEncryptIz(String str) {
|
public static int idEncryptIz(String str) {
|
||||||
// idEncrypt(e) {
|
// idEncrypt(e) {
|
||||||
|
|||||||
@@ -1,152 +1,160 @@
|
|||||||
package cn.qaiu.util;
|
package cn.qaiu.util;
|
||||||
|
|
||||||
public interface JsContent {
|
public interface JsContent {
|
||||||
String ye123 = """
|
String ye123 = "/*\n" +
|
||||||
/*
|
" https://statics.123pan.com/share-static/dist/umi.fb72555e.js\n" +
|
||||||
https://statics.123pan.com/share-static/dist/umi.fb72555e.js
|
" eaefamemdead\n" +
|
||||||
eaefamemdead
|
" eaefameidldy\n" +
|
||||||
eaefameidldy
|
" _0x4f141a(1690439821|5790548|/b/api/share/download/info|web|3|1946841013) = 秘钥\n" +
|
||||||
_0x4f141a(1690439821|5790548|/b/api/share/download/info|web|3|1946841013) = 秘钥
|
" \n" +
|
||||||
|
" _0x1e2592 1690439821 时间戳\n" +
|
||||||
_0x1e2592 1690439821 时间戳
|
" _0x48562f 5790548 随机码\n" +
|
||||||
_0x48562f 5790548 随机码
|
" _0x1e37d5 /b/api/share/download/info\n" +
|
||||||
_0x1e37d5 /b/api/share/download/info
|
" _0x4e2d74 web\n" +
|
||||||
_0x4e2d74 web
|
" _0x56f040 3\n" +
|
||||||
_0x56f040 3
|
" _0x43bdc6 1946841013 加密时间HASH戳\n" +
|
||||||
_0x43bdc6 1946841013 加密时间HASH戳
|
" \n" +
|
||||||
|
" >>>>\n" +
|
||||||
>>>>
|
" _0x43bdc6=''['concat'](_0x1e2592, '-')['concat'](_0x48562f, '-')['concat'](_0x406c4e)\n" +
|
||||||
_0x43bdc6=''['concat'](_0x1e2592, '-')['concat'](_0x48562f, '-')['concat'](_0x406c4e)
|
" 加密时间HASH戳 = 时间戳-随机码-秘钥\n" +
|
||||||
加密时间HASH戳 = 时间戳-随机码-秘钥
|
" */\n" +
|
||||||
*/
|
" \n" +
|
||||||
|
" function _0x1b5d95(_0x278d1a) {\n" +
|
||||||
function _0x1b5d95(_0x278d1a) {
|
" var _0x839b57,\n" +
|
||||||
var _0x839b57,
|
" _0x4ed4dc = arguments['length'] > 0x2 && void 0x0 !== arguments[0x2] ? arguments[0x2] : " +
|
||||||
_0x4ed4dc = arguments['length'] > 0x2 && void 0x0 !== arguments[0x2] ? arguments[0x2] : 0x8;
|
"0x8;\n" +
|
||||||
if (0x0 === arguments['length'])
|
" if (0x0 === arguments['length'])\n" +
|
||||||
return null;
|
" return null;\n" +
|
||||||
'object' === typeof _0x278d1a ? _0x839b57 = _0x278d1a : (0xa === ('' + _0x278d1a)['length'] && (_0x278d1a = 0x3e8 * parseInt(_0x278d1a)),
|
" 'object' === typeof _0x278d1a ? _0x839b57 = _0x278d1a : (0xa === ('' + _0x278d1a)" +
|
||||||
_0x839b57 = new Date(_0x278d1a));
|
"['length'] && (_0x278d1a = 0x3e8 * parseInt(_0x278d1a)),\n" +
|
||||||
var _0xc5c54a = _0x278d1a + 0xea60 * new Date(_0x278d1a)['getTimezoneOffset']()
|
" _0x839b57 = new Date(_0x278d1a));\n" +
|
||||||
, _0x3732dc = _0xc5c54a + 0x36ee80 * _0x4ed4dc;
|
" var _0xc5c54a = _0x278d1a + 0xea60 * new Date(_0x278d1a)['getTimezoneOffset']()\n" +
|
||||||
return _0x839b57 = new Date(_0x3732dc),
|
" , _0x3732dc = _0xc5c54a + 0x36ee80 * _0x4ed4dc;\n" +
|
||||||
{
|
" return _0x839b57 = new Date(_0x3732dc),\n" +
|
||||||
'y': _0x839b57['getFullYear'](),
|
" {\n" +
|
||||||
'm': _0x839b57['getMonth']() + 0x1 < 0xa ? '0' + (_0x839b57['getMonth']() + 0x1) : _0x839b57['getMonth']() + 0x1,
|
" 'y': _0x839b57['getFullYear'](),\n" +
|
||||||
'd': _0x839b57['getDate']() < 0xa ? '0' + _0x839b57['getDate']() : _0x839b57['getDate'](),
|
" 'm': _0x839b57['getMonth']() + 0x1 < 0xa ? '0' + (_0x839b57['getMonth']() + 0x1) : " +
|
||||||
'h': _0x839b57['getHours']() < 0xa ? '0' + _0x839b57['getHours']() : _0x839b57['getHours'](),
|
"_0x839b57['getMonth']() + 0x1,\n" +
|
||||||
'f': _0x839b57['getMinutes']() < 0xa ? '0' + _0x839b57['getMinutes']() : _0x839b57['getMinutes']()
|
" 'd': _0x839b57['getDate']() < 0xa ? '0' + _0x839b57['getDate']() : " +
|
||||||
};
|
"_0x839b57['getDate'](),\n" +
|
||||||
}
|
" 'h': _0x839b57['getHours']() < 0xa ? '0' + _0x839b57['getHours']() : " +
|
||||||
|
"_0x839b57['getHours'](),\n" +
|
||||||
|
" 'f': _0x839b57['getMinutes']() < 0xa ? '0' + _0x839b57['getMinutes']() : " +
|
||||||
function _0x4f141a(_0x4075b1) {
|
"_0x839b57['getMinutes']()\n" +
|
||||||
|
" };\n" +
|
||||||
for (var _0x4eddcb = arguments['length'] > 0x1 && void 0x0 !== arguments[0x1] ? arguments[0x1] : 0xa,
|
" }\n" +
|
||||||
_0x2fc680 = function() {
|
" \n" +
|
||||||
for (var _0x515c63, _0x361314 = [], _0x4cbdba = 0x0; _0x4cbdba < 0x100; _0x4cbdba++) {
|
" \n" +
|
||||||
_0x515c63 = _0x4cbdba;
|
" function _0x4f141a(_0x4075b1) {\n" +
|
||||||
for (var _0x460960 = 0x0; _0x460960 < 0x8; _0x460960++)
|
" \n" +
|
||||||
_0x515c63 = 0x1 & _0x515c63 ? 0xedb88320 ^ _0x515c63 >>> 0x1 : _0x515c63 >>> 0x1;
|
" for (var _0x4eddcb = arguments['length'] > 0x1 && void 0x0 !== arguments[0x1] ? " +
|
||||||
_0x361314[_0x4cbdba] = _0x515c63;
|
"arguments[0x1] : 0xa,\n" +
|
||||||
}
|
" _0x2fc680 = function() {\n" +
|
||||||
return _0x361314;
|
" for (var _0x515c63, _0x361314 = [], _0x4cbdba = 0x0; _0x4cbdba < 0x100; _0x4cbdba++) " +
|
||||||
},
|
"{\n" +
|
||||||
_0x4aed86 = _0x2fc680(),
|
" _0x515c63 = _0x4cbdba;\n" +
|
||||||
_0x5880f0 = _0x4075b1,
|
" for (var _0x460960 = 0x0; _0x460960 < 0x8; _0x460960++)\n" +
|
||||||
_0x492393 = -0x1, _0x25d82c = 0x0;
|
" _0x515c63 = 0x1 & _0x515c63 ? 0xedb88320 ^ _0x515c63 >>> 0x1 : _0x515c63 >>> 0x1;" +
|
||||||
_0x25d82c < _0x5880f0['length'];
|
"\n" +
|
||||||
_0x25d82c++)
|
" _0x361314[_0x4cbdba] = _0x515c63;\n" +
|
||||||
|
" }\n" +
|
||||||
_0x492393 = _0x492393 >>> 0x8 ^ _0x4aed86[0xff & (_0x492393 ^ _0x5880f0.charCodeAt(_0x25d82c))];
|
" return _0x361314;\n" +
|
||||||
return _0x492393 = (-0x1 ^ _0x492393) >>> 0x0,
|
" },\n" +
|
||||||
_0x492393.toString(_0x4eddcb);
|
" _0x4aed86 = _0x2fc680(),\n" +
|
||||||
}
|
" _0x5880f0 = _0x4075b1,\n" +
|
||||||
|
" _0x492393 = -0x1, _0x25d82c = 0x0;\n" +
|
||||||
|
" _0x25d82c < _0x5880f0['length'];\n" +
|
||||||
function getSign(_0x1e37d5) {
|
" _0x25d82c++)\n" +
|
||||||
var _0x4e2d74 = 'web';
|
" \n" +
|
||||||
var _0x56f040 = 3;
|
" _0x492393 = _0x492393 >>> 0x8 ^ _0x4aed86[0xff & (_0x492393 ^ _0x5880f0.charCodeAt" +
|
||||||
var _0x1e2592 = Math.round((new Date().getTime() + 0x3c * new Date().getTimezoneOffset() * 0x3e8 + 28800000) / 0x3e8).toString();
|
"(_0x25d82c))];\n" +
|
||||||
var key = 'a,d,e,f,g,h,l,m,y,i,j,n,o,p,k,q,r,s,t,u,b,c,v,w,s,z';
|
" return _0x492393 = (-0x1 ^ _0x492393) >>> 0x0,\n" +
|
||||||
var _0x48562f = Math['round'](0x989680 * Math['random']());
|
" _0x492393.toString(_0x4eddcb);\n" +
|
||||||
|
" }\n" +
|
||||||
var _0x2f7dfc;
|
" \n" +
|
||||||
var _0x35a889;
|
" \n" +
|
||||||
var _0x36f983;
|
" function getSign(_0x1e37d5) {\n" +
|
||||||
var _0x3b043d;
|
" var _0x4e2d74 = 'web';\n" +
|
||||||
var _0x5bc73b;
|
" var _0x56f040 = 3;\n" +
|
||||||
var _0x4b30b2;
|
" var _0x1e2592 = Math.round((new Date().getTime() + 0x3c * new Date().getTimezoneOffset() *" +
|
||||||
var _0x32399e;
|
" 0x3e8 + 28800000) / 0x3e8).toString();\n" +
|
||||||
var _0x25d94e;
|
" var key = 'a,d,e,f,g,h,l,m,y,i,j,n,o,p,k,q,r,s,t,u,b,c,v,w,s,z';\n" +
|
||||||
var _0x373490;
|
" var _0x48562f = Math['round'](0x989680 * Math['random']());\n" +
|
||||||
for (var _0x1c540f in (_0x2f7dfc = key.split(','),
|
" \n" +
|
||||||
_0x35a889 = _0x1b5d95(_0x1e2592),
|
" var _0x2f7dfc;\n" +
|
||||||
_0x36f983 = _0x35a889['y'],
|
" var _0x35a889;\n" +
|
||||||
_0x3b043d = _0x35a889['m'],
|
" var _0x36f983;\n" +
|
||||||
_0x5bc73b = _0x35a889['d'],
|
" var _0x3b043d;\n" +
|
||||||
_0x4b30b2 = _0x35a889['h'],
|
" var _0x5bc73b;\n" +
|
||||||
_0x32399e = _0x35a889['f'],
|
" var _0x4b30b2;\n" +
|
||||||
_0x25d94e = [_0x36f983, _0x3b043d, _0x5bc73b, _0x4b30b2, _0x32399e].join(''),
|
" var _0x32399e;\n" +
|
||||||
_0x373490 = [],
|
" var _0x25d94e;\n" +
|
||||||
_0x25d94e))
|
" var _0x373490;\n" +
|
||||||
_0x373490['push'](_0x2f7dfc[Number(_0x25d94e[_0x1c540f])]);
|
" for (var _0x1c540f in (_0x2f7dfc = key.split(','),\n" +
|
||||||
var _0x43bdc6;
|
" _0x35a889 = _0x1b5d95(_0x1e2592),\n" +
|
||||||
var _0x406c4e;
|
" _0x36f983 = _0x35a889['y'],\n" +
|
||||||
return _0x43bdc6 = _0x4f141a(_0x373490['join']('')),
|
" _0x3b043d = _0x35a889['m'],\n" +
|
||||||
_0x406c4e = _0x4f141a(''['concat'](_0x1e2592, '|')['concat'](_0x48562f, '|')['concat'](_0x1e37d5, '|')['concat'](_0x4e2d74, '|')['concat'](_0x56f040, '|')['concat'](_0x43bdc6)),
|
" _0x5bc73b = _0x35a889['d'],\n" +
|
||||||
[_0x43bdc6, ''['concat'](_0x1e2592, '-')['concat'](_0x48562f, '-')['concat'](_0x406c4e)];
|
" _0x4b30b2 = _0x35a889['h'],\n" +
|
||||||
}
|
" _0x32399e = _0x35a889['f'],\n" +
|
||||||
|
" _0x25d94e = [_0x36f983, _0x3b043d, _0x5bc73b, _0x4b30b2, _0x32399e].join(''),\n" +
|
||||||
""";
|
" _0x373490 = [],\n" +
|
||||||
String lz = """
|
" _0x25d94e))\n" +
|
||||||
/**
|
" _0x373490['push'](_0x2f7dfc[Number(_0x25d94e[_0x1c540f])]);\n" +
|
||||||
* 蓝奏云解析器js签名获取工具
|
" var _0x43bdc6;\n" +
|
||||||
*/
|
" var _0x406c4e;\n" +
|
||||||
|
" return _0x43bdc6 = _0x4f141a(_0x373490['join']('')),\n" +
|
||||||
var signObj;
|
" _0x406c4e = _0x4f141a(''['concat'](_0x1e2592, '|')['concat'](_0x48562f, '|')['concat']" +
|
||||||
|
"(_0x1e37d5, '|')['concat'](_0x4e2d74, '|')['concat'](_0x56f040, '|')['concat'](_0x43bdc6)),\n" +
|
||||||
|
" [_0x43bdc6, ''['concat'](_0x1e2592, '-')['concat'](_0x48562f, '-')['concat'](_0x406c4e)" +
|
||||||
var $, jQuery;
|
"];\n" +
|
||||||
|
" }\n" +
|
||||||
$ = jQuery = function () {
|
" ";
|
||||||
return new jQuery.fn.init();
|
String lz = "/**\n" +
|
||||||
}
|
" * 蓝奏云解析器js签名获取工具\n" +
|
||||||
|
" */\n" +
|
||||||
jQuery.fn = jQuery.prototype = {
|
" \n" +
|
||||||
init: function () {
|
" var signObj;\n" +
|
||||||
return {
|
" \n" +
|
||||||
focus: function (a) {
|
" \n" +
|
||||||
|
" var $, jQuery;\n" +
|
||||||
},
|
" \n" +
|
||||||
keyup: function(a) {
|
" $ = jQuery = function () {\n" +
|
||||||
|
" return new jQuery.fn.init();\n" +
|
||||||
},
|
" }\n" +
|
||||||
ajax: function (obj) {
|
" \n" +
|
||||||
signObj = obj
|
" jQuery.fn = jQuery.prototype = {\n" +
|
||||||
}
|
" init: function () {\n" +
|
||||||
|
" return {\n" +
|
||||||
}
|
" focus: function (a) {\n" +
|
||||||
},
|
" \n" +
|
||||||
|
" },\n" +
|
||||||
}
|
" keyup: function(a) {\n" +
|
||||||
|
" \n" +
|
||||||
jQuery.fn.init.prototype = jQuery.fn;
|
" },\n" +
|
||||||
|
" ajax: function (obj) {\n" +
|
||||||
|
" signObj = obj\n" +
|
||||||
// 伪装jquery.ajax函数获取关键数据
|
" }\n" +
|
||||||
$.ajax = function (obj) {
|
" \n" +
|
||||||
signObj = obj
|
" }\n" +
|
||||||
}
|
" },\n" +
|
||||||
|
" \n" +
|
||||||
var document = {
|
" }\n" +
|
||||||
getElementById: function (v) {
|
" \n" +
|
||||||
return {
|
" jQuery.fn.init.prototype = jQuery.fn;\n" +
|
||||||
value: 'v'
|
" \n" +
|
||||||
}
|
" \n" +
|
||||||
},
|
" // 伪装jquery.ajax函数获取关键数据\n" +
|
||||||
}
|
" $.ajax = function (obj) {\n" +
|
||||||
|
" signObj = obj\n" +
|
||||||
""";
|
" }\n" +
|
||||||
|
" \n" +
|
||||||
|
" var document = {\n" +
|
||||||
|
" getElementById: function (v) {\n" +
|
||||||
|
" return {\n" +
|
||||||
|
" value: 'v'\n" +
|
||||||
|
" }\n" +
|
||||||
|
" },\n" +
|
||||||
|
" }";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
package cn.qaiu.util;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author <a href="https://qaiu.top">QAIU</a>
|
|
||||||
* @date 2023/7/16 1:53
|
|
||||||
*/
|
|
||||||
public class PanExceptionUtils {
|
|
||||||
|
|
||||||
public static RuntimeException fillRunTimeException(String name, String dataKey, Throwable t) {
|
|
||||||
return new RuntimeException(name + ": 请求异常: key = " + dataKey, t.fillInStackTrace());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
35
parser/src/main/java/cn/qaiu/util/UUIDUtil.java
Normal file
35
parser/src/main/java/cn/qaiu/util/UUIDUtil.java
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
package cn.qaiu.util;
|
||||||
|
|
||||||
|
import java.security.SecureRandom;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author <a href="https://qaiu.top">QAIU</a>
|
||||||
|
* @date 2024/5/13 4:10
|
||||||
|
*/
|
||||||
|
public class UUIDUtil {
|
||||||
|
|
||||||
|
public static String fjUuid() {
|
||||||
|
return generateRandomString(21);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String generateRandomString(int length) {
|
||||||
|
SecureRandom random = new SecureRandom();
|
||||||
|
byte[] randomBytes = new byte[length];
|
||||||
|
random.nextBytes(randomBytes);
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (byte b : randomBytes) {
|
||||||
|
int value = b & 0x3F; // 63 in hexadecimal
|
||||||
|
if (value < 36) {
|
||||||
|
sb.append(Integer.toString(value, 36));
|
||||||
|
} else if (value < 62) {
|
||||||
|
sb.append(Character.toUpperCase(Integer.toString(value - 26, 36).charAt(0)));
|
||||||
|
} else if (value > 62) {
|
||||||
|
sb.append("-");
|
||||||
|
} else { // value == 62 or 63
|
||||||
|
sb.append("_");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
1081
parser/src/main/java/cn/qaiu/util/jdk17halper/HexFormat.java
Normal file
1081
parser/src/main/java/cn/qaiu/util/jdk17halper/HexFormat.java
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
|||||||
package qaiu.web.test;
|
package qaiu.web.test;
|
||||||
|
|
||||||
import cn.qaiu.util.AESUtils;
|
import cn.qaiu.util.AESUtils;
|
||||||
|
import cn.qaiu.util.jdk17halper.HexFormat;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
@@ -9,7 +10,6 @@ import javax.crypto.IllegalBlockSizeException;
|
|||||||
import javax.crypto.NoSuchPaddingException;
|
import javax.crypto.NoSuchPaddingException;
|
||||||
import java.security.InvalidKeyException;
|
import java.security.InvalidKeyException;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.util.HexFormat;
|
|
||||||
|
|
||||||
public class TestAESUtil {
|
public class TestAESUtil {
|
||||||
|
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ public class TestRegex {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void regexYFC() {
|
public void regexYFC() {
|
||||||
String html = """
|
String html = "\n" +
|
||||||
<input type="hidden" id="typed_id" value="file_559003251828">
|
" <input type=\"hidden\" id=\"typed_id\" value=\"file_559003251828\">\n" +
|
||||||
<input type="hidden" id="share_link_token" value="9cbe4b73521ba4d65a8cd38a8c">
|
" <input type=\"hidden\" id=\"share_link_token\" " +
|
||||||
""";
|
"value=\"9cbe4b73521ba4d65a8cd38a8c\">";
|
||||||
|
|
||||||
Pattern compile = Pattern.compile("id=\"typed_id\"\\s+value=\"file_(\\d+)\"");
|
Pattern compile = Pattern.compile("id=\"typed_id\"\\s+value=\"file_(\\d+)\"");
|
||||||
Matcher matcher = compile.matcher(html);
|
Matcher matcher = compile.matcher(html);
|
||||||
|
|||||||
@@ -15,9 +15,11 @@ public class TestWebClient2 {
|
|||||||
public void matcherHtml() {
|
public void matcherHtml() {
|
||||||
|
|
||||||
Pattern compile = Pattern.compile("class=\"ifr2\" name=.+src=\"(/fn\\?[a-zA-Z0-9_+/=]{16,})\"");
|
Pattern compile = Pattern.compile("class=\"ifr2\" name=.+src=\"(/fn\\?[a-zA-Z0-9_+/=]{16,})\"");
|
||||||
var text = """
|
var text = "<div class=\"ifr\"><!--<iframe class=\"ifr2\" name=\"1\" src=\"/fn?v2\" frameborder=\"0\" " +
|
||||||
<div class="ifr"><!--<iframe class="ifr2" name="1" src="/fn?v2" frameborder="0" scrolling="no"></iframe>-->
|
"scrolling=\"no\"></iframe>-->\n" +
|
||||||
<iframe class="ifr2" name="1685001208" src="/fn?UzUBa1oxBmUAYgNsUDUFNVI6BjJfJlchV21TZFU_aVWwANVQzXTBXMlUxUTcLZ1dwUn8DYwQ5AHFVOwdmBjRUPlM2AS9aOgY3AGIDMFA2" frameborder="0" scrolling="no"></iframe>""";
|
"<iframe class=\"ifr2\" name=\"1685001208\" " +
|
||||||
|
"src=\"/fn" +
|
||||||
|
"?UzUBa1oxBmUAYgNsUDUFNVI6BjJfJlchV21TZFU_aVWwANVQzXTBXMlUxUTcLZ1dwUn8DYwQ5AHFVOwdmBjRUPlM2AS9aOgY3AGIDMFA2\" frameborder=\"0\" scrolling=\"no\"></iframe>";
|
||||||
System.out.println(text);
|
System.out.println(text);
|
||||||
Matcher matcher = compile.matcher(text);
|
Matcher matcher = compile.matcher(text);
|
||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class WebClientExample {
|
|||||||
WebClient client = WebClient.create(vertx);
|
WebClient client = WebClient.create(vertx);
|
||||||
|
|
||||||
MultipartForm form = new MultipartFormImpl()
|
MultipartForm form = new MultipartFormImpl()
|
||||||
.attribute("email", "736226400@qq.com")
|
.attribute("email", "")
|
||||||
.attribute("password", "");
|
.attribute("password", "");
|
||||||
|
|
||||||
client.postAbs("https://cowtransfer.com/api/user/emaillogin")
|
client.postAbs("https://cowtransfer.com/api/user/emaillogin")
|
||||||
|
|||||||
39
pom.xml
39
pom.xml
@@ -7,7 +7,7 @@
|
|||||||
<groupId>cn.qaiu</groupId>
|
<groupId>cn.qaiu</groupId>
|
||||||
<artifactId>netdisk-fast-download</artifactId>
|
<artifactId>netdisk-fast-download</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>0.1.7</version>
|
<version>${revision}</version>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>core</module>
|
<module>core</module>
|
||||||
@@ -17,9 +17,10 @@
|
|||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>17</java.version>
|
<revision>0.1.7</revision>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<java.version>11</java.version>
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
<maven.compiler.source>11</maven.compiler.source>
|
||||||
|
<maven.compiler.target>11</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
|
||||||
<packageDirectory>${project.basedir}/web-service/target/package</packageDirectory>
|
<packageDirectory>${project.basedir}/web-service/target/package</packageDirectory>
|
||||||
@@ -30,10 +31,40 @@
|
|||||||
<lombok.version>1.18.12</lombok.version>
|
<lombok.version>1.18.12</lombok.version>
|
||||||
<slf4j.version>2.0.5</slf4j.version>
|
<slf4j.version>2.0.5</slf4j.version>
|
||||||
<commons-lang3.version>3.12.0</commons-lang3.version>
|
<commons-lang3.version>3.12.0</commons-lang3.version>
|
||||||
|
<commons-beanutils2.version>2.0.0</commons-beanutils2.version>
|
||||||
<jackson.version>2.14.2</jackson.version>
|
<jackson.version>2.14.2</jackson.version>
|
||||||
<logback.version>1.4.12</logback.version>
|
<logback.version>1.4.12</logback.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.vertx</groupId>
|
||||||
|
<artifactId>vertx-dependencies</artifactId>
|
||||||
|
<version>${vertx.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.qaiu</groupId>
|
||||||
|
<artifactId>core</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.qaiu</groupId>
|
||||||
|
<artifactId>core-database</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.qaiu</groupId>
|
||||||
|
<artifactId>parser</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|||||||
2696
web-front/package-lock.json
generated
2696
web-front/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -26,7 +26,7 @@
|
|||||||
"vue-template-compiler": "^2.6.14",
|
"vue-template-compiler": "^2.6.14",
|
||||||
|
|
||||||
"compression-webpack-plugin": "^6.1.1",
|
"compression-webpack-plugin": "^6.1.1",
|
||||||
"filemanager-webpack-plugin": "2.0.5"
|
"filemanager-webpack-plugin": "8.0.0"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"root": true,
|
"root": true,
|
||||||
|
|||||||
@@ -5,15 +5,13 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>netdisk-fast-download</artifactId>
|
<artifactId>netdisk-fast-download</artifactId>
|
||||||
<groupId>cn.qaiu</groupId>
|
<groupId>cn.qaiu</groupId>
|
||||||
<version>0.1.7</version>
|
<version>${revision}</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<version>0.1.7</version>
|
|
||||||
<artifactId>web-service</artifactId>
|
<artifactId>web-service</artifactId>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<packageDirectory>${project.basedir}/target/package</packageDirectory>
|
<packageDirectory>${project.basedir}/target/package</packageDirectory>
|
||||||
<java.version>17</java.version>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<finalName>netdisk-fast-download</finalName>
|
<finalName>netdisk-fast-download</finalName>
|
||||||
</properties>
|
</properties>
|
||||||
@@ -22,7 +20,14 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.qaiu</groupId>
|
<groupId>cn.qaiu</groupId>
|
||||||
<artifactId>core</artifactId>
|
<artifactId>core</artifactId>
|
||||||
<version>1.0.8</version>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.qaiu</groupId>
|
||||||
|
<artifactId>core-database</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.qaiu</groupId>
|
||||||
|
<artifactId>parser</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
@@ -47,16 +52,6 @@
|
|||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
<version>${slf4j.version}</version>
|
<version>${slf4j.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>cn.qaiu</groupId>
|
|
||||||
<artifactId>core-database</artifactId>
|
|
||||||
<version>0.1.7</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.qaiu</groupId>
|
|
||||||
<artifactId>parser</artifactId>
|
|
||||||
<version>0.1.7</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import cn.qaiu.vx.core.annotaions.RouteHandler;
|
|||||||
import cn.qaiu.vx.core.annotaions.RouteMapping;
|
import cn.qaiu.vx.core.annotaions.RouteMapping;
|
||||||
import cn.qaiu.vx.core.enums.RouteMethod;
|
import cn.qaiu.vx.core.enums.RouteMethod;
|
||||||
import cn.qaiu.vx.core.util.ResponseUtil;
|
import cn.qaiu.vx.core.util.ResponseUtil;
|
||||||
|
import cn.qaiu.vx.core.util.VertxHolder;
|
||||||
import io.vertx.core.Future;
|
import io.vertx.core.Future;
|
||||||
import io.vertx.core.Promise;
|
import io.vertx.core.Promise;
|
||||||
import io.vertx.core.http.HttpServerRequest;
|
import io.vertx.core.http.HttpServerRequest;
|
||||||
|
|||||||
@@ -47,12 +47,10 @@ public class DbServiceImpl implements DbService {
|
|||||||
public Future<StatisticsInfo> getStatisticsInfo() {
|
public Future<StatisticsInfo> getStatisticsInfo() {
|
||||||
JDBCPool client = JDBCPoolInit.instance().getPool();
|
JDBCPool client = JDBCPoolInit.instance().getPool();
|
||||||
Promise<StatisticsInfo> promise = Promise.promise();
|
Promise<StatisticsInfo> promise = Promise.promise();
|
||||||
String sql = """
|
String sql = "select COUNT(CASE \"code\" WHEN 500 THEN \"code\" END ) \"fail\",\n" +
|
||||||
select COUNT(CASE "code" WHEN 500 THEN "code" END ) "fail",
|
" COUNT(CASE \"code\" WHEN 200 THEN \"code\" END ) \"success\",\n" +
|
||||||
COUNT(CASE "code" WHEN 200 THEN "code" END ) "success",
|
" count(1) \"total\"\n" +
|
||||||
count(1) "total"
|
" from \"t_parser_log_info\"";
|
||||||
from "t_parser_log_info"
|
|
||||||
""";
|
|
||||||
SqlTemplate.forQuery(client, sql).mapTo(StatisticsInfo.class).execute(new HashMap<>()).onSuccess(row -> {
|
SqlTemplate.forQuery(client, sql).mapTo(StatisticsInfo.class).execute(new HashMap<>()).onSuccess(row -> {
|
||||||
StatisticsInfo info;
|
StatisticsInfo info;
|
||||||
if ((info = row.iterator().next()) != null) {
|
if ((info = row.iterator().next()) != null) {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ custom:
|
|||||||
# 数据源配置
|
# 数据源配置
|
||||||
dataSource:
|
dataSource:
|
||||||
provider_class: io.vertx.ext.jdbc.spi.impl.HikariCPDataSourceProvider
|
provider_class: io.vertx.ext.jdbc.spi.impl.HikariCPDataSourceProvider
|
||||||
jdbcUrl: jdbc:h2:tcp://127.0.0.1:9095/./db/myData;MODE=MySQL;DATABASE_TO_UPPER=FALSE
|
jdbcUrl: jdbc:h2:file:./db/nfdData;MODE=MySQL;DATABASE_TO_UPPER=FALSE
|
||||||
driverClassName: org.h2.Driver
|
driverClassName: org.h2.Driver
|
||||||
username: root
|
username: root
|
||||||
password: '123456'
|
password: '123456'
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
curl -F "file=@C:\Users\qaiu\Desktop\real\lz-web\web\src\main\resources\logback.xml" -i -XPOST 127.0.0.1:6400/demo/XXX/XXX
|
|
||||||
|
|
||||||
curl -F "file=@C:\Users\qaiu\Desktop\3.csv" -i -XPOST 127.0.0.1:6400/demo/XXX/XXX
|
|
||||||
@@ -58,4 +58,4 @@ Content-Type:application/json
|
|||||||
Origin:https://www.feijipan.com
|
Origin:https://www.feijipan.com
|
||||||
Referer:https://www.feijipan.com/
|
Referer:https://www.feijipan.com/
|
||||||
|
|
||||||
{"loginName":"15687886400","loginPwd":"4458225ff"}
|
{"loginName":"","loginPwd":""}
|
||||||
|
|||||||
@@ -30,14 +30,14 @@ GET http://127.0.0.1:6400/json/parser?url=https://www.ilanzou.com/s/6XwnC4X
|
|||||||
###
|
###
|
||||||
GET http://127.0.0.1:6400/json/parser?url=https://www.ilanzou.com/s/zHkna1S
|
GET http://127.0.0.1:6400/json/parser?url=https://www.ilanzou.com/s/zHkna1S
|
||||||
|
|
||||||
### 奶牛
|
### 奶牛 https://cowtransfer.com/s/9a644fe3e3a748
|
||||||
GET http://127.0.0.1:6400/json/cow/9a644fe3e3a748
|
GET http://127.0.0.1:6400/json/cow/9a644fe3e3a748
|
||||||
Referer: https://cowtransfer.com/
|
Referer: https://cowtransfer.com/
|
||||||
|
|
||||||
### 奶牛
|
### 奶牛
|
||||||
# @no-redirect
|
# @no-redirect
|
||||||
GET http://127.0.0.1:6400/cow/e4f41b51b5da4f
|
GET http://127.0.0.1:6400/cow/e4f41b51b5da4f
|
||||||
Referer: https://cowtransfer.com/
|
|
||||||
|
|
||||||
### 奶牛
|
### 奶牛
|
||||||
# @no-redirect
|
# @no-redirect
|
||||||
@@ -55,8 +55,13 @@ GET http://127.0.0.1:6400/parser?url=https://www.ecpan.cn/web//yunpanProxy?path=
|
|||||||
# @no-redirect
|
# @no-redirect
|
||||||
GET http://127.0.0.1:6400/ec/81027a5c99af5b11ca004966c945cce6W9Bf2
|
GET http://127.0.0.1:6400/ec/81027a5c99af5b11ca004966c945cce6W9Bf2
|
||||||
|
|
||||||
|
### https://www.ecpan.cn/web/#/yunpanProxy?path=%2F%23%2Fdrive%2Foutside&data=4b3d786755688b85c6eb0c04b9124f4dalzdaJpXHx&isShare=1 密码 T6O1RC
|
||||||
|
GET http://127.0.0.1:6400/json/ec/4b3d786755688b85c6eb0c04b9124f4dalzdaJpXHx@T6O1RC
|
||||||
|
|
||||||
###
|
###
|
||||||
GET http://127.0.0.1:6400/json/ec/aa0cae0164d8885e6d35826b5b2901eckbWJBalM
|
#@no-redirect
|
||||||
|
GET http://127.0.0.1:6400/parser?url=https://www.ecpan.cn/web/#/yunpanProxy?path=%2F%23%2Fdrive%2Foutside&data=4b3d786755688b85c6eb0c04b9124f4dalzdaJpXHx&isShare=1&pwd=T6O1RC
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### UC网盘
|
### UC网盘
|
||||||
@@ -78,16 +83,15 @@ GET http://127.0.0.1:6400/parser?url=https://share.feijipan.com/s/nMtCOXL
|
|||||||
### 小飞机盘 https://share.feijipan.com/s/laUshYGk
|
### 小飞机盘 https://share.feijipan.com/s/laUshYGk
|
||||||
# @no-redirect
|
# @no-redirect
|
||||||
GET http://127.0.0.1:6400/parser?url=https://share.feijipan.com/s/laUshYGk
|
GET http://127.0.0.1:6400/parser?url=https://share.feijipan.com/s/laUshYGk
|
||||||
### 小飞机盘
|
### 小飞机盘 tIfhRqH
|
||||||
GET http://127.0.0.1:6400/json/fj/tIfhRqH
|
GET http://127.0.0.1:6400/json/fj/tIfhRqH
|
||||||
### 小飞机盘 https://share.feijipan.com/s/7jy0zlv
|
### 小飞机盘 https://share.feijipan.com/s/7jy0zlv
|
||||||
GET http://127.0.0.1:6400/json/fj/7jy0zlv
|
GET http://127.0.0.1:6400/json/fj/7jy0zlv
|
||||||
|
### 小飞机盘 https://share.feijipan.com/s/nMtCOXL
|
||||||
### 小飞机盘
|
|
||||||
# @no-redirect
|
# @no-redirect
|
||||||
GET http://127.0.0.1:6400/fj/tIfhRqH
|
GET http://127.0.0.1:6400/fj/nMtCOXL
|
||||||
|
|
||||||
### 360亿方云
|
### 360亿方云 https://v2.fangcloud.com/sharing/fb54bdf03c66c04334fe3687a3
|
||||||
# @no-redirect
|
# @no-redirect
|
||||||
GET http://127.0.0.1:6400/parser?url=https://v2.fangcloud.com/sharing/fb54bdf03c66c04334fe3687a3
|
GET http://127.0.0.1:6400/parser?url=https://v2.fangcloud.com/sharing/fb54bdf03c66c04334fe3687a3
|
||||||
|
|
||||||
@@ -117,9 +121,9 @@ GET http://127.0.0.1:6400/ye/iaKtVv-qOECd
|
|||||||
# @no-redirect
|
# @no-redirect
|
||||||
GET http://127.0.0.1:6400/ye/Ev1lVv-t3SY3
|
GET http://127.0.0.1:6400/ye/Ev1lVv-t3SY3
|
||||||
|
|
||||||
### 123
|
### 123 https://www.123pan.com/s/iaKtVv-6OECd.html
|
||||||
# @no-redirect
|
# @no-redirect
|
||||||
GET http://127.0.0.1:6400/parser?url=https://www.123pan.com/s/iaKtVv-6OECd.html&pwd=DcGe
|
GET http://127.0.0.1:6400/json/parser?url=https://www.123pan.com/s/iaKtVv-6OECd.html&pwd=DcGe
|
||||||
|
|
||||||
|
|
||||||
### 123
|
### 123
|
||||||
@@ -142,10 +146,13 @@ GET http://127.0.0.1:6400/le/2RkKbLP9BrppS9b43@ex2b
|
|||||||
### 联想乐云
|
### 联想乐云
|
||||||
GET http://127.0.0.1:6400/json/le/2RkKbLP9BrppS9b43@ex2b
|
GET http://127.0.0.1:6400/json/le/2RkKbLP9BrppS9b43@ex2b
|
||||||
|
|
||||||
|
### 文叔叔
|
||||||
|
GET http://127.0.0.1:6400/json/parser?url=https://f.ws59.cn/f/e3peohu6192
|
||||||
|
|
||||||
### Cloudreve
|
### Cloudreve
|
||||||
GET http://127.0.0.1:6400/json/ce/https_pan.huang1111.cn_s_wDz5TK
|
GET http://127.0.0.1:6400/json/ce/https_pan.huang1111.cn_s_wDz5TK
|
||||||
|
|
||||||
### Cloudreve
|
### Cloudreve https://pan.huang1111.cn/s/g31PcQ
|
||||||
GET http://127.0.0.1:6400/json/parser?url=https://pan.huang1111.cn/s/g31PcQ&pwd=qaiu
|
GET http://127.0.0.1:6400/json/parser?url=https://pan.huang1111.cn/s/g31PcQ&pwd=qaiu
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package cn.qaiu.web.test;
|
package cn.qaiu.web.test;
|
||||||
|
|
||||||
import io.vertx.ext.web.RoutingContext;
|
import io.vertx.ext.web.RoutingContext;
|
||||||
import org.apache.commons.beanutils.BeanUtils;
|
import org.apache.commons.beanutils2.BeanUtils;
|
||||||
import org.apache.commons.beanutils.ConvertUtils;
|
import org.apache.commons.beanutils2.ConvertUtils;
|
||||||
import org.apache.commons.beanutils.Converter;
|
import org.apache.commons.beanutils2.Converter;
|
||||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||||
import org.apache.commons.lang3.time.DateUtils;
|
import org.apache.commons.lang3.time.DateUtils;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|||||||
@@ -9,10 +9,9 @@ public class TestRegex {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void regexYFC() {
|
public void regexYFC() {
|
||||||
String html = """
|
String html = "<input type=\"hidden\" id=\"typed_id\" value=\"file_559003251828\">\n" +
|
||||||
<input type="hidden" id="typed_id" value="file_559003251828">
|
" <input type=\"hidden\" id=\"share_link_token\" " +
|
||||||
<input type="hidden" id="share_link_token" value="9cbe4b73521ba4d65a8cd38a8c">
|
"value=\"9cbe4b73521ba4d65a8cd38a8c\">";
|
||||||
""";
|
|
||||||
|
|
||||||
Pattern compile = Pattern.compile("id=\"typed_id\"\\s+value=\"file_(\\d+)\"");
|
Pattern compile = Pattern.compile("id=\"typed_id\"\\s+value=\"file_(\\d+)\"");
|
||||||
Matcher matcher = compile.matcher(html);
|
Matcher matcher = compile.matcher(html);
|
||||||
|
|||||||
@@ -154,14 +154,14 @@ public class WebProxyExamples {
|
|||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
final WebProxyExamples examples = new WebProxyExamples();
|
final WebProxyExamples examples = new WebProxyExamples();
|
||||||
examples.vertx.executeBlocking(rs -> {
|
// examples.vertx.executeBlocking(rs -> {
|
||||||
rs.complete();
|
// rs.complete();
|
||||||
examples.origin();
|
// examples.origin();
|
||||||
});
|
// });
|
||||||
examples.vertx.executeBlocking(rs -> {
|
// examples.vertx.executeBlocking(rs -> {
|
||||||
rs.complete();
|
// rs.complete();
|
||||||
examples.route();
|
// examples.route();
|
||||||
});
|
// });
|
||||||
System.out.println("ok");
|
System.out.println("ok");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user