1. add:123云盘的新域名

2. update: 统计API支持ce盘
3. 缓存时长
This commit is contained in:
qaiu
2024-10-01 17:38:57 +08:00
parent d8666acfe8
commit 088fee9a4d
6 changed files with 38 additions and 19 deletions

View File

@@ -57,7 +57,7 @@ public enum PanDomainTemplate {
WsTool.class), WsTool.class),
// https://www.123pan.com/s/ // https://www.123pan.com/s/
YE("123网盘", YE("123网盘",
"https://www\\.123pan\\.com/s/(.+)", "https://www\\.(123pan|123865|123684)\\.com/s/(.+)",
"https://www.123pan.com/s/{shareKey}", "https://www.123pan.com/s/{shareKey}",
YeTool.class), YeTool.class),
// https://www.ecpan.cn/web/#/yunpanProxy?path=%2F%23%2Fdrive%2Foutside&data={code}&isShare=1 // https://www.ecpan.cn/web/#/yunpanProxy?path=%2F%23%2Fdrive%2Foutside&data={code}&isShare=1

View File

@@ -42,7 +42,9 @@ public class ParserCreate {
String standardUrl = getStandardUrlTemplate().replace("{shareKey}", shareKey); String standardUrl = getStandardUrlTemplate().replace("{shareKey}", shareKey);
shareLinkInfo.setShareUrl(shareUrl); shareLinkInfo.setShareUrl(shareUrl);
shareLinkInfo.setShareKey(shareKey); shareLinkInfo.setShareKey(shareKey);
shareLinkInfo.setStandardUrl(standardUrl); if (!(panDomainTemplate == PanDomainTemplate.CE)) {
shareLinkInfo.setStandardUrl(standardUrl);
}
return this; return this;
} }
throw new IllegalArgumentException("Invalid share URL for " + this.panDomainTemplate.getDisplayName()); throw new IllegalArgumentException("Invalid share URL for " + this.panDomainTemplate.getDisplayName());
@@ -101,6 +103,9 @@ public class ParserCreate {
.type(panDomainTemplate.name().toLowerCase()) .type(panDomainTemplate.name().toLowerCase())
.panName(panDomainTemplate.getDisplayName()) .panName(panDomainTemplate.getDisplayName())
.shareUrl(shareUrl).build(); .shareUrl(shareUrl).build();
if (panDomainTemplate == PanDomainTemplate.CE) {
shareLinkInfo.setStandardUrl(shareUrl);
}
ParserCreate parserCreate = new ParserCreate(panDomainTemplate, shareLinkInfo); ParserCreate parserCreate = new ParserCreate(panDomainTemplate, shareLinkInfo);
return parserCreate.normalizeShareLink(); return parserCreate.normalizeShareLink();
} }
@@ -120,4 +125,21 @@ public class ParserCreate {
throw new IllegalArgumentException("No enum constant for type name: " + type); throw new IllegalArgumentException("No enum constant for type name: " + type);
} }
} }
// 生成parser短链path(不包含domainName)
public String genPathSuffix() {
String path;
if (panDomainTemplate == PanDomainTemplate.CE) {
// 处理Cloudreve(ce)类: pan.huang1111.cn_s_wDz5TK _ -> /
path = this.shareLinkInfo.getType() + "/"
+ this.shareLinkInfo.getShareUrl()
.substring("https://".length()).replace("/", "_");
} else {
path = this.shareLinkInfo.getType() + "/" + this.shareLinkInfo.getShareKey();
}
String sharePassword = this.shareLinkInfo.getSharePassword();
return path + (StringUtils.isBlank(sharePassword) ? "" : ("@" + sharePassword));
}
} }

View File

@@ -9,10 +9,6 @@
content="Netdisk fast download,网盘直链解析工具"> content="Netdisk fast download,网盘直链解析工具">
<meta name="description" <meta name="description"
content="Netdisk fast download 网盘直链解析工具"> content="Netdisk fast download 网盘直链解析工具">
<script charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js"></script>
<script>LA.init({id:"K8zkCkZMgFA6ShZK",ck:"K8zkCkZMgFA6ShZK"})</script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9851170484804006"
crossorigin="anonymous"></script>
<style> <style>
.page-loading-wrap { .page-loading-wrap {
padding: 120px; padding: 120px;

View File

@@ -14,13 +14,10 @@ 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.AsyncServiceUtil; import cn.qaiu.vx.core.util.AsyncServiceUtil;
import cn.qaiu.vx.core.util.ResponseUtil;
import cn.qaiu.vx.core.util.SharedDataUtil; import cn.qaiu.vx.core.util.SharedDataUtil;
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;
import io.vertx.core.http.HttpServerResponse;
import io.vertx.core.net.HostAndPort;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@@ -48,10 +45,11 @@ public class ParserApi {
public Future<LinkInfoResp> parse(HttpServerRequest request, String pwd) { public Future<LinkInfoResp> parse(HttpServerRequest request, String pwd) {
Promise<LinkInfoResp> promise = Promise.promise(); Promise<LinkInfoResp> promise = Promise.promise();
String url = URLParamUtil.parserParams(request); String url = URLParamUtil.parserParams(request);
ShareLinkInfo shareLinkInfo = ParserCreate.fromShareUrl(url).setShareLinkInfoPwd(pwd).getShareLinkInfo(); ParserCreate parserCreate = ParserCreate.fromShareUrl(url).setShareLinkInfoPwd(pwd);
ShareLinkInfo shareLinkInfo = parserCreate.getShareLinkInfo();
LinkInfoResp build = LinkInfoResp.builder() LinkInfoResp build = LinkInfoResp.builder()
.downLink(getDownLink(shareLinkInfo, false)) .downLink(getDownLink(parserCreate, false))
.apiLink(getDownLink(shareLinkInfo, true)) .apiLink(getDownLink(parserCreate, true))
.shareLinkInfo(shareLinkInfo).build(); .shareLinkInfo(shareLinkInfo).build();
// 解析次数统计 // 解析次数统计
cacheManager.getShareKeyTotal(shareLinkInfo.getCacheKey()).onSuccess(res -> { cacheManager.getShareKeyTotal(shareLinkInfo.getCacheKey()).onSuccess(res -> {
@@ -68,16 +66,14 @@ public class ParserApi {
return promise.future(); return promise.future();
} }
private static String getDownLink(ShareLinkInfo shareLinkInfo, boolean isJson) { private static String getDownLink(ParserCreate create, boolean isJson) {
String linkPrefix = SharedDataUtil.getJsonConfig("server") String linkPrefix = SharedDataUtil.getJsonConfig("server")
.getString("domainName"); .getString("domainName");
if (StringUtils.isBlank(linkPrefix)) { if (StringUtils.isBlank(linkPrefix)) {
linkPrefix = "http://127.0.0.1"; linkPrefix = "http://127.0.0.1";
} }
String pwd = shareLinkInfo.getSharePassword(); return linkPrefix + (isJson ? "/json/" : "/") + create.genPathSuffix();
return linkPrefix + (isJson ? "/json/" : "/") + shareLinkInfo.getType() + "/" + shareLinkInfo.getShareKey() +
(StringUtils.isBlank(pwd) ? "" : ("@" + pwd));
} }
} }

View File

@@ -53,8 +53,8 @@ cache:
cow: cow:
ec: ec:
fc: fc:
fj: fj: 30
iz: iz: 20
le: 2879 le: 2879
lz: lz:
qq: 999999 qq: 999999

View File

@@ -111,6 +111,9 @@ GET http://127.0.0.1:6400/ye/Ev1lVv-t3SY3
# @no-redirect # @no-redirect
GET http://127.0.0.1:6400/json/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 PASS https://www.123865.com/s/iaKtVv-6OECd.html
# @no-redirect
GET http://127.0.0.1:6400/json/parser?url=https://www.123865.com/s/iaKtVv-6OECd.html&pwd=DcGe
### 123 ### 123
# @no-redirect # @no-redirect
@@ -164,7 +167,9 @@ GET http://127.0.0.1:6400/json/parser?url=https://iwx.mail.qq.com/ftn/download?f
GET http://127.0.0.1:6400/v2/statisticsInfo GET http://127.0.0.1:6400/v2/statisticsInfo
### ###
GET http://127.0.0.1:6400/v2/linkInfo?url=https://www.123pan.com/s/iaKtVv-6OECd.html&pwd=DcGe GET http://127.0.0.1:6400/v2/linkInfo?url=https://www.123865.com/s/iaKtVv-6OECd.html&pwd=DcGe
###
GET http://127.0.0.1:6400/v2/linkInfo?url=https://pan.seeoss.com/s/nLNsQ&pwd=DcGe
### ###
POST http://127.0.0.1:6400/v2/login?username=asd POST http://127.0.0.1:6400/v2/login?username=asd