国庆快乐 ^ ^ #59

This commit is contained in:
QAIU
2024-09-30 17:38:36 +08:00
parent 6c3195dea4
commit 209e9c2866
9 changed files with 259 additions and 4 deletions

View File

@@ -22,3 +22,13 @@ Cloudreve自建网盘 (ce) {origin}/s/{shareKey}
https://f.ws59.cn/f/e3peohu6192
开源版 TODO
1. 缓存优化, 配置自动重载
专属版 功能设计
1. 支持绑定域名, 后台管理-账号管理, token管理, 账号解析次数限制
2. 流量统计, 文件分享信息, 目录解析, 文件云下载
3. IP代理池

View File

@@ -6,6 +6,8 @@ import io.vertx.core.Handler;
import io.vertx.core.Promise;
import io.vertx.core.json.DecodeException;
import io.vertx.core.json.JsonObject;
import io.vertx.core.net.ProxyOptions;
import io.vertx.core.net.ProxyType;
import io.vertx.ext.web.client.HttpResponse;
import io.vertx.ext.web.client.WebClient;
import io.vertx.ext.web.client.WebClientOptions;
@@ -38,6 +40,11 @@ public abstract class PanBase {
protected WebClient clientNoRedirects = WebClient.create(WebClientVertxInit.get(),
new WebClientOptions().setFollowRedirects(false));
// test proxy
protected WebClient proxyClient = WebClient.create(WebClientVertxInit.get(), new WebClientOptions()
.setUserAgentEnabled(false).setFollowRedirects(false)
.setProxyOptions(new ProxyOptions().setHost("101.251.204.174").setPort(8080).setType(ProxyType.HTTP)));
protected ShareLinkInfo shareLinkInfo;
/**

View File

@@ -75,7 +75,7 @@ public enum PanDomainTemplate {
// 通用域名([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}
CE("Cloudreve",
"https://([a-z0-9]+(-[a-z0-9]+)*\\.)+[a-z]{2,}/s/(.+)",
"https://{CloudreveName}/s/{shareKey}",
"https://{CloudreveDomainName}/s/{shareKey}",
CeTool.class);

View File

@@ -1,11 +1,16 @@
package cn.qaiu.parser.impl;
import cn.qaiu.WebClientVertxInit;
import cn.qaiu.entity.ShareLinkInfo;
import cn.qaiu.parser.IPanTool;
import cn.qaiu.parser.PanBase;
import io.vertx.core.Future;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
import io.vertx.core.net.ProxyOptions;
import io.vertx.core.net.ProxyType;
import io.vertx.ext.web.client.WebClient;
import io.vertx.ext.web.client.WebClientOptions;
import java.util.UUID;
@@ -24,6 +29,7 @@ public class LeTool extends PanBase implements IPanTool {
final String pwd = shareLinkInfo.getSharePassword();
// {"shareId":"xxx","password":"xxx","directoryId":"-1"}
String apiUrl1 = API_URL_PREFIX + "shareInfo";
client.postAbs(apiUrl1)
.sendJsonObject(JsonObject.of("shareId", dataKey, "password", pwd, "directoryId", -1))
.onSuccess(res -> {
@@ -79,7 +85,7 @@ public class LeTool extends PanBase implements IPanTool {
return;
}
// 获取重定向链接跳转链接
clientNoRedirects.getAbs(downloadUrl).send()
client.getAbs(downloadUrl).send()
.onSuccess(res2 -> promise.complete(res2.headers().get("Location")))
.onFailure(handleFail(downloadUrl));
} else {

View File

@@ -0,0 +1,80 @@
package cn.qaiu.util;
import io.vertx.core.MultiMap;
import io.vertx.core.Vertx;
import io.vertx.core.http.impl.headers.HeadersMultiMap;
import io.vertx.ext.web.client.WebClient;
import io.vertx.ext.web.client.WebClientSession;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.ArrayList;
import java.util.List;
public class IpExtractor {
public static void main(String[] args) throws InterruptedException {
// 创建请求头Map
MultiMap headers = new HeadersMultiMap();
headers.add("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7");
headers.add("accept-language", "zh-CN,zh;q=0.9,en;q=0.8");
headers.add("cache-control", "no-cache");
headers.add("dnt", "1");
headers.add("origin", "https://ip.ihuan.me");
headers.add("pragma", "no-cache");
headers.add("priority", "u=0, i");
headers.add("referer", "https://ip.ihuan.me/ti.html");
headers.add("sec-ch-ua", "\"Google Chrome\";v=\"129\", \"Not=A?Brand\";v=\"8\", \"Chromium\";v=\"129\"");
headers.add("sec-ch-ua-mobile", "?0");
headers.add("sec-ch-ua-platform", "\"Windows\"");
headers.add("sec-fetch-dest", "document");
headers.add("sec-fetch-mode", "navigate");
headers.add("sec-fetch-site", "same-origin");
headers.add("sec-fetch-user", "?1");
headers.add("upgrade-insecure-requests", "1");
headers.add("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36");
headers.add("Content-Type", "application/x-www-form-urlencoded");
WebClient client = WebClient.create(Vertx.vertx());
WebClientSession webClientSession = WebClientSession.create(client);
webClientSession.getAbs("https://ip.ihuan.me").putHeaders(headers).send().onSuccess(res->{
System.out.println(res.toString());
webClientSession.getAbs("https://ip.ihuan.me").putHeaders(headers).send().onSuccess(res2->{
System.out.println(res2.toString());
});
});
//
// String htmlContent = "<div class=\"panel-heading\">提取结果</div>\n" +
// "<div class=\"panel-body\">111.1.27.85:80<br>42.63.65.46:80<br>118.195.242.20:8080<br>42.63.65.119:80<br>117.50.108.90:7890<br>116.62.50.250:7890<br>114.231.8.177:8089<br>190.43.92.90:999<br>221.178.85.68:8080<br><br>61.160.202.86:80<br>42.63.65.86:80<br>42.63.65.7:80<br>42.63.65.41:80<br>159.226.227.119:80<br>61.160.202.52:80<br>42.63.65.15:80<br>112.17.16.204:80<br>61.160.202.53:80<br>42.63.65.9:80<br>42.63.65.60:80<br>42.63.65.18:80<br>203.190.115.177:8071<br>42.63.65.38:80<br>42.63.65.31:80<br>91.185.3.126:8080<br>139.9.119.20:80<br>1.15.47.213:443<br>183.164.243.108:8089<br>165.225.208.177:80<br>194.163.132.232:3128<br>91.235.220.122:80<br>39.100.120.200:7890<br>141.147.33.121:80<br>183.164.243.138:8089<br>104.129.205.94:54321<br>117.160.250.138:81<br>180.120.213.208:8089<br>61.130.9.37:443<br>182.34.18.206:9999<br>117.86.12.150:8089<br>27.192.173.108:9000<br>183.164.243.11:8089<br>114.231.41.205:8089<br>103.104.233.78:8080<br>183.164.243.174:8089<br>36.6.144.230:8089<br>111.224.213.239:8089<br>182.92.73.106:80<br>36.6.145.81:8089<br>117.69.232.125:8089<br>36.6.144.64:8089<br>117.57.92.20:8089<br>47.100.69.29:8888<br>117.57.93.246:8089<br>120.234.203.171:9002<br>114.231.46.231:8089<br>183.164.242.199:8089<br>117.69.237.179:8089<br>182.44.32.239:7890<br>47.100.91.57:8080<br>117.69.236.127:8089<br>114.231.8.18:8089<br>117.69.232.183:8089<br>117.69.237.29:8089<br>183.164.242.67:8089<br>183.164.242.35:8089<br>183.164.243.71:8089<br>113.223.214.155:8089<br>36.6.145.132:8089<br>182.106.220.252:9091<br>113.223.212.176:8089<br>62.152.53.186:8909<br>117.57.92.16:8089<br>183.164.243.186:8089<br>36.6.144.210:8089<br>183.164.242.189:8089<br>213.178.39.170:8080<br>121.52.145.163:8080<br>36.6.144.240:8089<br>60.188.5.234:80<br>113.223.213.48:8089<br>183.164.243.149:8089<br>200.58.87.195:8080<br>36.6.144.153:8089<br>36.6.144.67:8089<br>36.6.145.182:8089<br>117.57.93.226:8089<br>42.112.24.127:8888<br>43.138.20.156:80<br>117.57.92.79:8089<br>65.109.111.238:3128<br>183.166.137.201:41122<br>113.223.213.150:8089<br>36.6.145.154:8089<br>185.5.209.101:80<br>36.6.144.17:8089<br>114.231.8.244:8089<br>117.69.237.24:8089<br>117.69.236.232:8089<br>117.69.236.127:8089<br>114.231.8.18:8089<br>117.69.232.183:8089<br>117.69.237.29:8089<br>183.164.242.67:8089<br>183.164.242.35:8089<br>183.164.243.71:8089<br>113.223.214.155:8089<br>36.6.145.132:8089<br>182.106.220.252:9091<br>113.223.212.176:8089<br>62.152.53.186:8909<br>117.57.92.16:8089<br>183.164.243.186:8089<br>36.6.144.210:8089<br>183.164.242.189:8089<br>213.178.39.170:8080<br>121.52.145.163:8080<br>36.6.144.240:8089<br>60.188.5.234:80<br>113.223.213.48:8089<br>183.164.243.149:8089<br>200.58.87.195:8080<br>36.6.144.153:8089<br>36.6.144.67:8089<br>36.6.145.182:8089<br>117.57.93.226:8089<br>42.112.24.127:8888<br>43.138.20.156:80<br>117.57.92.79:8089<br>65.109.111.238:3128<br>183.166.137.201:41122<br>113.223.213.150:8089<br>36.6.145.154:8089<br>185.5.209.101:80<br>36.6.144.17:8089<br>114.231.8.244:8089<br>117.69.237.24:8089<br>117.69.236.232:8089</div>";
//
// // 正则表达式匹配提取结果关键字下面的IP地址
// Pattern pattern = Pattern.compile("<div class=\"panel-heading\">提取结果</div>\\s*<div class=\"panel-body\">([\\s\\S]*?)(?=</div>)", Pattern.DOTALL);
// Matcher matcher = pattern.matcher(htmlContent);
//
// if (matcher.find()) {
// String ipText = matcher.group(1); // 获取匹配的IP地址部分
// Pattern ipPattern = Pattern.compile("(?:[0-9]{1,3}\\.){3}[0-9]{1,3}(?::\\d+)?");
// Matcher ipMatcher = ipPattern.matcher(ipText);
//
// List<String> ips = new ArrayList<>();
// while (ipMatcher.find()) {
// ips.add(ipMatcher.group());
// }
//
// System.out.println("提取到的IP地址");
// for (String ip : ips) {
//// System.out.println(ip);
// }
// } else {
// System.out.println("没有找到匹配的IP地址");
// }
//
// TimeUnit.SECONDS.sleep(1000);
}
}

View File

@@ -0,0 +1,12 @@
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());
}
}

View File

@@ -0,0 +1,74 @@
package cn.qaiu.util;
import io.vertx.core.AsyncResult;
import io.vertx.core.MultiMap;
import io.vertx.core.Vertx;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.http.impl.headers.HeadersMultiMap;
import io.vertx.ext.web.client.HttpResponse;
import io.vertx.ext.web.client.WebClient;
import io.vertx.ext.web.client.WebClientSession;
public class ReqIpUtil {
public static String BASE_URL = "https://ip.ihuan.me";
public static String BASE_URL_TEMPLATE = BASE_URL + "/{path}";
// GET https://ip.ihuan.me/mouse.do -> $("input[name='key']").val("30b4975b5547fed806bd2b9caa18485a");
public static String PATH1 = "mouse.do";
public static String PATH2 = "tqdl.html";
// 创建请求头Map
static MultiMap headers = new HeadersMultiMap();
static {
headers.set("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7");
headers.set("accept-language", "zh-CN,zh;q=0.9,en;q=0.8");
headers.set("cache-control", "no-cache");
headers.set("dnt", "1");
headers.set("origin", "https://ip.ihuan.me");
headers.set("pragma", "no-cache");
headers.set("priority", "u=0, i");
headers.set("referer", "https://ip.ihuan.me");
headers.set("sec-ch-ua", "\"Google Chrome\";v=\"129\", \"Not=A?Brand\";v=\"8\", \"Chromium\";v=\"129\"");
headers.set("sec-ch-ua-mobile", "?0");
headers.set("sec-ch-ua-platform", "\"Windows\"");
headers.set("sec-fetch-dest", "document");
headers.set("sec-fetch-mode", "navigate");
headers.set("sec-fetch-site", "same-origin");
headers.set("sec-fetch-user", "?1");
headers.set("upgrade-insecure-requests", "1");
// headers.set("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36");
}
Vertx vertx = Vertx.vertx();
WebClient webClient = WebClient.create(vertx);
// 发送GET请求
WebClientSession webClientSession = WebClientSession.create(webClient);
public void exec() {
webClientSession.getAbs(BASE_URL)
.putHeaders(headers) // 将请求头Map添加到请求中
.send(this::next);
}
void next(AsyncResult<HttpResponse<Buffer>> response) {
if (response.failed()) {
response.cause().printStackTrace();
} else {
HttpResponse<Buffer> res = response.result();
System.out.println("Received response with status code " + res.statusCode());
System.out.println("Body: " + res.body());
webClientSession.getAbs(BASE_URL_TEMPLATE).setTemplateParam("path", PATH1)
.putHeaders(headers) // 将请求头Map添加到请求中
.send(response2 -> {
System.out.println(response2.result().bodyAsString());
});
}
}
}

View File

@@ -0,0 +1,66 @@
# curl 'https://ip.ihuan.me/tqdl.html'
# -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7'
# -H 'accept-language: zh-CN,zh;q=0.9,en;q=0.8'
# -H 'cache-control: no-cache'
# -H 'content-type: application/x-www-form-urlencoded'
# -H 'cookie: 91e73cee101cc3ecefd9ca31a227d508=4380c9f80effb56e85210a54dc286c06; statistics=16453d6e2683b8800ded2a27c7f595d9; Hm_lvt_8ccd0ef22095c2eebfe4cd6187dea829=1727664099; HMACCOUNT=AA7CAD3BA9E39EC8; 28114211b4e11617bd725475433e69aa=29d9778b3f2c1b30c137fef0d6728e29; Hm_lpvt_8ccd0ef22095c2eebfe4cd6187dea829=1727667138'
# -H 'dnt: 1'
# -H 'origin: https://ip.ihuan.me'
# -H 'pragma: no-cache'
# -H 'priority: u=0, i'
# -H 'referer: https://ip.ihuan.me/ti.html'
# -H 'sec-ch-ua: "Google Chrome";v="129", "Not=A?Brand";v="8", "Chromium";v="129"'
# -H 'sec-ch-ua-mobile: ?0'
# -H 'sec-ch-ua-platform: "Windows"'
# -H 'sec-fetch-dest: document'
# -H 'sec-fetch-mode: navigate'
# -H 'sec-fetch-site: same-origin'
# -H 'sec-fetch-user: ?1'
# -H 'upgrade-insecure-requests: 1'
# -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36'
# --data-raw 'num=100&port=&kill_port=&address=&kill_address=&anonymity=&type=&post=&sort=&key=15146aca2e04e3756a2e79ec33ca5679'
#@no-cookie-jar
POST https://ip.ihuan.me/tqdl.html
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
accept-language: zh-CN,zh;q=0.9,en;q=0.8
cache-control: no-cache
cookie: 91e73cee101cc3ecefd9ca31a227d508=4380c9f80effb56e85210a54dc286c06; statistics=16453d6e2683b8800ded2a27c7f595d9; Hm_lvt_8ccd0ef22095c2eebfe4cd6187dea829=1727664099; HMACCOUNT=AA7CAD3BA9E39EC8; 28114211b4e11617bd725475433e69aa=29d9778b3f2c1b30c137fef0d6728e29; Hm_lpvt_8ccd0ef22095c2eebfe4cd6187dea829=1727667138
dnt: 1
origin: https://ip.ihuan.me
pragma: no-cache
priority: u=0, i
referer: https://ip.ihuan.me/ti.html
sec-ch-ua: "Google Chrome";v="129", "Not=A?Brand";v="8", "Chromium";v="129"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
sec-fetch-dest: document
sec-fetch-mode: navigate
sec-fetch-site: same-origin
sec-fetch-user: ?1
upgrade-insecure-requests: 1
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Content-Type: application/x-www-form-urlencoded
num=100&port=&kill_port=&address=&kill_address=&anonymity=&type=&post=&sort=&key=15146aca2e04e3756a2e79ec33ca5679
###
https://ip.ihuan.me/
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
accept-language: zh-CN,zh;q=0.9,en;q=0.8
cache-control: no-cache
#cookie: 91e73cee101cc3ecefd9ca31a227d508=4380c9f80effb56e85210a54dc286c06; statistics=16453d6e2683b8800ded2a27c7f595d9; Hm_lvt_8ccd0ef22095c2eebfe4cd6187dea829=1727664099; HMACCOUNT=AA7CAD3BA9E39EC8; 28114211b4e11617bd725475433e69aa=29d9778b3f2c1b30c137fef0d6728e29; Hm_lpvt_8ccd0ef22095c2eebfe4cd6187dea829=1727667138
dnt: 1
origin: https://ip.ihuan.me
pragma: no-cache
priority: u=0, i
referer: https://ip.ihuan.me
sec-ch-ua: "Google Chrome";v="129", "Not=A?Brand";v="8", "Chromium";v="129"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
sec-fetch-dest: document
sec-fetch-mode: navigate
sec-fetch-site: same-origin
sec-fetch-user: ?1
upgrade-insecure-requests: 1
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Content-Type: application/x-www-form-urlencoded

View File

@@ -140,7 +140,7 @@ https://f.wss.cc/f/f25625rv6p6
### TODO Cloudreve
GET http://127.0.0.1:6400/json/ce/pan.huang1111.cn_s_wDz5TK
### TODO Cloudreve2
### Cloudreve2
GET http://127.0.0.1:6400/json/ce/pan.huang1111.cn_s_g31PcQ@qaiu
### Cloudreve类 PASS
@@ -150,7 +150,7 @@ GET http://127.0.0.1:6400/json/ce/pan.huang1111.cn_s_g31PcQ@qaiu
#GET http://127.0.0.1:6400/parser?url=https://pan.huang1111.cn/s/g31PcQ&pwd=qaiu
# @no-redirect
GET http://127.0.0.1:6400/v2/linkInfo?url=https://pan.seeoss.com/s/nLNsQ
GET http://127.0.0.1:6400/parser?url=https://pan.seeoss.com/s/nLNsQ