mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2025-12-16 12:23:03 +00:00
fixed 123pan /b/api/share/download/info->/a/api/share/download/info
This commit is contained in:
@@ -7,7 +7,6 @@ import cn.qaiu.vx.core.verticle.ReverseProxyVerticle;
|
|||||||
import cn.qaiu.vx.core.verticle.RouterVerticle;
|
import cn.qaiu.vx.core.verticle.RouterVerticle;
|
||||||
import cn.qaiu.vx.core.verticle.ServiceVerticle;
|
import cn.qaiu.vx.core.verticle.ServiceVerticle;
|
||||||
import io.vertx.core.*;
|
import io.vertx.core.*;
|
||||||
import io.vertx.core.impl.launcher.commands.VersionCommand;
|
|
||||||
import io.vertx.core.json.JsonObject;
|
import io.vertx.core.json.JsonObject;
|
||||||
import io.vertx.core.shareddata.LocalMap;
|
import io.vertx.core.shareddata.LocalMap;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -96,7 +95,7 @@ public final class Deploy {
|
|||||||
|
|
||||||
System.out.printf(logoTemplete,
|
System.out.printf(logoTemplete,
|
||||||
conf.getString("version_app"),
|
conf.getString("version_app"),
|
||||||
VersionCommand.getVersion(),
|
conf.getString("version_vertx"),
|
||||||
conf.getString("copyright"),
|
conf.getString("copyright"),
|
||||||
year
|
year
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,10 +12,8 @@ import io.vertx.ext.web.RoutingContext;
|
|||||||
public interface Interceptor {
|
public interface Interceptor {
|
||||||
|
|
||||||
default Handler<RoutingContext> doHandle() {
|
default Handler<RoutingContext> doHandle() {
|
||||||
return this::beforeHandle;
|
return this::handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
void beforeHandle(RoutingContext context);
|
void handle(RoutingContext context);
|
||||||
|
|
||||||
void afterHandle(RoutingContext context);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,11 +70,11 @@ public final class ReflectionUtil {
|
|||||||
// 发现注解api层 没有继承父类时 这里反射一直有问题(Scanner SubTypesScanner was not configured)
|
// 发现注解api层 没有继承父类时 这里反射一直有问题(Scanner SubTypesScanner was not configured)
|
||||||
// 因此这里需要手动配置各种Scanner扫描器 -- https://blog.csdn.net/qq_29499107/article/details/106889781
|
// 因此这里需要手动配置各种Scanner扫描器 -- https://blog.csdn.net/qq_29499107/article/details/106889781
|
||||||
configurationBuilder.setScanners(
|
configurationBuilder.setScanners(
|
||||||
Scanners.SubTypes.filterResultsBy(s -> true), //允许getAllTypes获取所有Object的子类, 不设置为false则 getAllTypes 会报错.默认为true.
|
new SubTypesScanner(false), //允许getAllTypes获取所有Object的子类, 不设置为false则 getAllTypes 会报错.默认为true.
|
||||||
new MethodParameterNamesScanner(), //设置方法参数名称 扫描器,否则调用getConstructorParamNames 会报错
|
new MethodParameterNamesScanner(), //设置方法参数名称 扫描器,否则调用getConstructorParamNames 会报错
|
||||||
Scanners.MethodsAnnotated, //设置方法注解 扫描器, 否则getConstructorsAnnotatedWith,getMethodsAnnotatedWith 会报错
|
new MethodAnnotationsScanner(), //设置方法注解 扫描器, 否则getConstructorsAnnotatedWith,getMethodsAnnotatedWith 会报错
|
||||||
new MemberUsageScanner(), //设置 member 扫描器,否则 getMethodUsage 会报错, 不推荐使用,有可能会报错 Caused by: java.lang.ClassCastException: javassist.bytecode.InterfaceMethodrefInfo cannot be cast to javassist.bytecode.MethodrefInfo
|
new MemberUsageScanner(), //设置 member 扫描器,否则 getMethodUsage 会报错, 不推荐使用,有可能会报错 Caused by: java.lang.ClassCastException: javassist.bytecode.InterfaceMethodrefInfo cannot be cast to javassist.bytecode.MethodrefInfo
|
||||||
Scanners.TypesAnnotated //设置类注解 扫描器 ,否则 getTypesAnnotatedWith 会报错
|
new TypeAnnotationsScanner() //设置类注解 扫描器 ,否则 getTypesAnnotatedWith 会报错
|
||||||
);
|
);
|
||||||
|
|
||||||
configurationBuilder.filterInputsBy(filterBuilder);
|
configurationBuilder.filterInputsBy(filterBuilder);
|
||||||
|
|||||||
@@ -2,10 +2,15 @@ package cn.qaiu.lz.common.interceptorImpl;
|
|||||||
|
|
||||||
import cn.qaiu.vx.core.base.BaseHttpApi;
|
import cn.qaiu.vx.core.base.BaseHttpApi;
|
||||||
import cn.qaiu.vx.core.interceptor.Interceptor;
|
import cn.qaiu.vx.core.interceptor.Interceptor;
|
||||||
|
import cn.qaiu.vx.core.model.JsonResult;
|
||||||
|
import cn.qaiu.vx.core.util.CommonUtil;
|
||||||
import cn.qaiu.vx.core.util.SharedDataUtil;
|
import cn.qaiu.vx.core.util.SharedDataUtil;
|
||||||
|
import cn.qaiu.vx.core.util.VertxHolder;
|
||||||
import io.vertx.core.json.JsonArray;
|
import io.vertx.core.json.JsonArray;
|
||||||
|
import io.vertx.core.shareddata.LocalMap;
|
||||||
import io.vertx.ext.web.RoutingContext;
|
import io.vertx.ext.web.RoutingContext;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import lombok.val;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 默认拦截器实现
|
* 默认拦截器实现
|
||||||
@@ -18,12 +23,7 @@ public class DefaultInterceptor implements Interceptor, BaseHttpApi {
|
|||||||
private final JsonArray ignores = SharedDataUtil.getJsonArrayForCustomConfig("ignoresReg");
|
private final JsonArray ignores = SharedDataUtil.getJsonArrayForCustomConfig("ignoresReg");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void beforeHandle(RoutingContext ctx) {
|
public void handle(RoutingContext ctx) {
|
||||||
ctx.next();
|
ctx.next();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void afterHandle(RoutingContext context) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,42 +4,42 @@ import cn.qaiu.lz.common.parser.impl.*;
|
|||||||
import io.vertx.core.Future;
|
import io.vertx.core.Future;
|
||||||
|
|
||||||
public interface IPanTool {
|
public interface IPanTool {
|
||||||
Future<String> parse();
|
Future<String> parse(String data, String code);
|
||||||
|
|
||||||
static IPanTool typeMatching(String type, String key, String pwd) {
|
static IPanTool typeMatching(String type) {
|
||||||
return switch (type) {
|
return switch (type) {
|
||||||
case "lz" -> new LzTool(key, pwd);
|
case "lz" -> new LzTool();
|
||||||
case "cow" -> new CowTool(key, pwd);
|
case "cow" -> new CowTool();
|
||||||
case "ec" -> new EcTool(key, pwd);
|
case "ec" -> new EcTool();
|
||||||
case "fc" -> new FcTool(key, pwd);
|
case "fc" -> new FcTool();
|
||||||
case "uc" -> new UcTool(key, pwd);
|
case "uc" -> new UcTool();
|
||||||
case "ye" -> new YeTool(key, pwd);
|
case "ye" -> new YeTool();
|
||||||
case "fj" -> new FjTool(key, pwd);
|
case "fj" -> new FjTool();
|
||||||
default -> {
|
default -> {
|
||||||
throw new UnsupportedOperationException("未知分享类型");
|
throw new IllegalArgumentException("未知分享类型");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static IPanTool shareURLPrefixMatching(String url, String pwd) {
|
static IPanTool shareURLPrefixMatching(String url) {
|
||||||
|
|
||||||
if (url.startsWith(CowTool.SHARE_URL_PREFIX)) {
|
if (url.startsWith(CowTool.SHARE_URL_PREFIX)) {
|
||||||
return new CowTool(url, pwd);
|
return new CowTool();
|
||||||
} else if (url.startsWith(EcTool.SHARE_URL_PREFIX)) {
|
} else if (url.startsWith(EcTool.SHARE_URL_PREFIX)) {
|
||||||
return new EcTool(url, pwd);
|
return new EcTool();
|
||||||
} else if (url.startsWith(FcTool.SHARE_URL_PREFIX0)) {
|
} else if (url.startsWith(FcTool.SHARE_URL_PREFIX0)) {
|
||||||
return new FcTool(url, pwd);
|
return new FcTool();
|
||||||
} else if (url.startsWith(UcTool.SHARE_URL_PREFIX)) {
|
} else if (url.startsWith(UcTool.SHARE_URL_PREFIX)) {
|
||||||
return new UcTool(url, pwd);
|
return new UcTool();
|
||||||
} else if (url.startsWith(YeTool.SHARE_URL_PREFIX)) {
|
} else if (url.startsWith(YeTool.SHARE_URL_PREFIX)) {
|
||||||
return new YeTool(url, pwd);
|
return new YeTool();
|
||||||
} else if (url.startsWith(FjTool.SHARE_URL_PREFIX)) {
|
} else if (url.startsWith(FjTool.SHARE_URL_PREFIX)) {
|
||||||
return new FjTool(url, pwd);
|
return new FjTool();
|
||||||
} else if (url.contains("lanzou")) {
|
} else if (url.contains("lanzou")) {
|
||||||
return new LzTool(url, pwd);
|
return new LzTool();
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new UnsupportedOperationException("未知分享类型");
|
throw new IllegalArgumentException("未知分享类型");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
package cn.qaiu.lz.common.parser;
|
|
||||||
|
|
||||||
import cn.qaiu.vx.core.util.VertxHolder;
|
|
||||||
import io.vertx.core.Handler;
|
|
||||||
import io.vertx.core.Promise;
|
|
||||||
import io.vertx.ext.web.client.WebClient;
|
|
||||||
import io.vertx.ext.web.client.WebClientOptions;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
public abstract class PanBase {
|
|
||||||
protected Logger log = LoggerFactory.getLogger(this.getClass());
|
|
||||||
|
|
||||||
protected Promise<String> promise = Promise.promise();
|
|
||||||
|
|
||||||
protected WebClient client = WebClient.create(VertxHolder.getVertxInstance());
|
|
||||||
protected WebClient clientNoRedirects = WebClient.create(VertxHolder.getVertxInstance(), OPTIONS);
|
|
||||||
private static final WebClientOptions OPTIONS = new WebClientOptions().setFollowRedirects(false);
|
|
||||||
|
|
||||||
|
|
||||||
protected String key;
|
|
||||||
protected String pwd;
|
|
||||||
|
|
||||||
protected PanBase(String key, String pwd) {
|
|
||||||
this.key = key;
|
|
||||||
this.pwd = pwd;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void fail(Throwable t, String errorMsg, Object... args) {
|
|
||||||
try {
|
|
||||||
String s = String.format(errorMsg.replaceAll("\\{}", "%s"), args);
|
|
||||||
log.error("解析异常: " + s, t.fillInStackTrace());
|
|
||||||
promise.fail(this.getClass().getSimpleName() + ": 解析异常: " + s + " -> " + t);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("ErrorMsg format fail. The parameter has been discarded", e);
|
|
||||||
log.error("解析异常: " + errorMsg, t.fillInStackTrace());
|
|
||||||
promise.fail(this.getClass().getSimpleName() + ": 解析异常: " + errorMsg + " -> " + t);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void fail(String errorMsg, Object... args) {
|
|
||||||
try {
|
|
||||||
String s = String.format(errorMsg.replaceAll("\\{}", "%s"), args);
|
|
||||||
log.error("解析异常: " + s);
|
|
||||||
promise.fail(this.getClass().getSimpleName() + " - 解析异常: " + s);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("ErrorMsg format fail. The parameter has been discarded", e);
|
|
||||||
log.error("解析异常: " + errorMsg);
|
|
||||||
promise.fail(this.getClass().getSimpleName() + " - 解析异常: " + errorMsg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Handler<Throwable> handleFail(String errorMsg) {
|
|
||||||
return t -> fail(this.getClass().getSimpleName() + " - 请求异常 {}: -> {}", errorMsg, t.fillInStackTrace());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,14 @@
|
|||||||
package cn.qaiu.lz.common.parser.impl;
|
package cn.qaiu.lz.common.parser.impl;
|
||||||
|
|
||||||
import cn.qaiu.lz.common.parser.IPanTool;
|
import cn.qaiu.lz.common.parser.IPanTool;
|
||||||
import cn.qaiu.lz.common.parser.PanBase;
|
|
||||||
import cn.qaiu.lz.common.util.CommonUtils;
|
import cn.qaiu.lz.common.util.CommonUtils;
|
||||||
|
import cn.qaiu.lz.common.util.PanExceptionUtils;
|
||||||
|
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.json.JsonObject;
|
import io.vertx.core.json.JsonObject;
|
||||||
|
import io.vertx.ext.web.client.WebClient;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,19 +17,17 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
* @author <a href="https://qaiu.top">QAIU</a>
|
* @author <a href="https://qaiu.top">QAIU</a>
|
||||||
* @date 2023/4/21 21:19
|
* @date 2023/4/21 21:19
|
||||||
*/
|
*/
|
||||||
public class CowTool extends PanBase implements IPanTool {
|
@Slf4j
|
||||||
|
public class CowTool implements IPanTool {
|
||||||
|
|
||||||
private static final String API_REQUEST_URL = "https://cowtransfer.com/core/api/transfer/share";
|
private static final String API_REQUEST_URL = "https://cowtransfer.com/core/api/transfer/share";
|
||||||
public static final String SHARE_URL_PREFIX = "https://cowtransfer.com/s/";
|
public static final String SHARE_URL_PREFIX = "https://cowtransfer.com/s/";
|
||||||
|
|
||||||
public CowTool(String key, String pwd) {
|
public Future<String> parse(String data, String code) {
|
||||||
super(key, pwd);
|
Promise<String> promise = Promise.promise();
|
||||||
}
|
WebClient client = WebClient.create(VertxHolder.getVertxInstance());
|
||||||
|
String key = CommonUtils.adaptShortPaths(SHARE_URL_PREFIX, data);
|
||||||
public Future<String> parse() {
|
client.getAbs(API_REQUEST_URL + "?uniqueUrl=" + key).send().onSuccess(res -> {
|
||||||
key = CommonUtils.adaptShortPaths(SHARE_URL_PREFIX, key);
|
|
||||||
String url = API_REQUEST_URL + "?uniqueUrl=" + key;
|
|
||||||
client.getAbs(url).send().onSuccess(res -> {
|
|
||||||
JsonObject resJson = res.bodyAsJsonObject();
|
JsonObject resJson = res.bodyAsJsonObject();
|
||||||
if ("success".equals(resJson.getString("message")) && resJson.containsKey("data")) {
|
if ("success".equals(resJson.getString("message")) && resJson.containsKey("data")) {
|
||||||
JsonObject dataJson = resJson.getJsonObject("data");
|
JsonObject dataJson = resJson.getJsonObject("data");
|
||||||
@@ -42,15 +44,19 @@ public class CowTool extends PanBase implements IPanTool {
|
|||||||
promise.complete(downloadUrl);
|
promise.complete(downloadUrl);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fail("cow parse fail: {}; downloadUrl is empty", url2);
|
|
||||||
|
log.error("cow parse fail: {}; downloadUrl is empty", url2);
|
||||||
|
promise.fail("cow parse fail: " + url2 + "; downloadUrl is empty");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fail("cow parse fail: {}; json: {}", url2, res2Json);
|
log.error("cow parse fail: {}; json: {}", url2, res2Json);
|
||||||
}).onFailure(handleFail(url2));
|
promise.fail("cow parse fail: " + url2 + "; json:" + res2Json);
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fail("cow parse fail: {}; json: {}", key, resJson);
|
log.error("cow parse fail: {}; json: {}", key, resJson);
|
||||||
}).onFailure(handleFail(url));
|
promise.fail("cow parse fail: " + key + "; json:" + resJson);
|
||||||
|
}).onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Cow", key, t)));
|
||||||
return promise.future();
|
return promise.future();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,22 @@
|
|||||||
package cn.qaiu.lz.common.parser.impl;
|
package cn.qaiu.lz.common.parser.impl;
|
||||||
|
|
||||||
import cn.qaiu.lz.common.parser.IPanTool;
|
import cn.qaiu.lz.common.parser.IPanTool;
|
||||||
import cn.qaiu.lz.common.parser.PanBase;
|
|
||||||
import cn.qaiu.lz.common.util.CommonUtils;
|
import cn.qaiu.lz.common.util.CommonUtils;
|
||||||
|
import cn.qaiu.lz.common.util.PanExceptionUtils;
|
||||||
|
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.json.JsonArray;
|
import io.vertx.core.json.JsonArray;
|
||||||
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 lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 移动云空间解析
|
* 移动云空间解析
|
||||||
*/
|
*/
|
||||||
public class EcTool extends PanBase implements IPanTool {
|
@Slf4j
|
||||||
|
public class EcTool 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?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}";
|
||||||
@@ -20,12 +25,10 @@ public class EcTool extends PanBase implements IPanTool {
|
|||||||
|
|
||||||
public static final String SHARE_URL_PREFIX = "www.ecpan.cn/";
|
public static final String SHARE_URL_PREFIX = "www.ecpan.cn/";
|
||||||
|
|
||||||
public EcTool(String key, String pwd) {
|
public Future<String> parse(String data, String code) {
|
||||||
super(key, pwd);
|
String dataKey = CommonUtils.adaptShortPaths(SHARE_URL_PREFIX, data);
|
||||||
}
|
Promise<String> promise = Promise.promise();
|
||||||
|
WebClient client = WebClient.create(VertxHolder.getVertxInstance());
|
||||||
public Future<String> parse() {
|
|
||||||
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).send().onSuccess(res -> {
|
||||||
JsonObject jsonObject = res.bodyAsJsonObject();
|
JsonObject jsonObject = res.bodyAsJsonObject();
|
||||||
@@ -34,7 +37,8 @@ public class EcTool extends PanBase implements IPanTool {
|
|||||||
.getJsonObject("var")
|
.getJsonObject("var")
|
||||||
.getJsonObject("chainFileInfo");
|
.getJsonObject("chainFileInfo");
|
||||||
if (fileInfo.containsKey("errMesg")) {
|
if (fileInfo.containsKey("errMesg")) {
|
||||||
fail("{} 解析失败:{} key = {}", FIRST_REQUEST_URL, fileInfo.getString("errMesg"), dataKey);
|
promise.fail(new RuntimeException(DOWNLOAD_REQUEST_URL + " 解析失败: "
|
||||||
|
+ fileInfo.getString("errMesg")) + " key = " + dataKey);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
JsonObject cloudpFile = fileInfo.getJsonObject("cloudpFile");
|
JsonObject cloudpFile = fileInfo.getJsonObject("cloudpFile");
|
||||||
@@ -51,9 +55,9 @@ public class EcTool extends PanBase implements IPanTool {
|
|||||||
JsonObject jsonRes = res2.bodyAsJsonObject();
|
JsonObject jsonRes = res2.bodyAsJsonObject();
|
||||||
log.debug("ecPan get download url -> {}", res2.body().toString());
|
log.debug("ecPan get download url -> {}", res2.body().toString());
|
||||||
promise.complete(jsonRes.getJsonObject("var").getString("downloadUrl"));
|
promise.complete(jsonRes.getJsonObject("var").getString("downloadUrl"));
|
||||||
}).onFailure(handleFail(""));
|
}).onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Ec", dataKey, t)));
|
||||||
}
|
}
|
||||||
).onFailure(handleFail(FIRST_REQUEST_URL));
|
).onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Ec", dataKey, t)));;
|
||||||
return promise.future();
|
return promise.future();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,18 @@
|
|||||||
package cn.qaiu.lz.common.parser.impl;
|
package cn.qaiu.lz.common.parser.impl;
|
||||||
|
|
||||||
import cn.qaiu.lz.common.parser.IPanTool;
|
import cn.qaiu.lz.common.parser.IPanTool;
|
||||||
import cn.qaiu.lz.common.parser.PanBase;
|
|
||||||
import cn.qaiu.lz.common.util.CommonUtils;
|
import cn.qaiu.lz.common.util.CommonUtils;
|
||||||
|
import cn.qaiu.lz.common.util.PanExceptionUtils;
|
||||||
|
import cn.qaiu.vx.core.util.VertxHolder;
|
||||||
import io.vertx.core.Future;
|
import io.vertx.core.Future;
|
||||||
import io.vertx.core.MultiMap;
|
import io.vertx.core.MultiMap;
|
||||||
import io.vertx.core.Promise;
|
import io.vertx.core.Promise;
|
||||||
|
import io.vertx.core.Vertx;
|
||||||
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 io.vertx.ext.web.client.HttpResponse;
|
import io.vertx.ext.web.client.HttpResponse;
|
||||||
|
import io.vertx.ext.web.client.WebClient;
|
||||||
|
import io.vertx.ext.web.client.WebClientOptions;
|
||||||
import io.vertx.ext.web.client.WebClientSession;
|
import io.vertx.ext.web.client.WebClientSession;
|
||||||
import io.vertx.uritemplate.UriTemplate;
|
import io.vertx.uritemplate.UriTemplate;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@@ -19,7 +23,7 @@ import java.util.regex.Pattern;
|
|||||||
/**
|
/**
|
||||||
* 360亿方云
|
* 360亿方云
|
||||||
*/
|
*/
|
||||||
public class FcTool extends PanBase implements IPanTool {
|
public class FcTool implements IPanTool {
|
||||||
|
|
||||||
public static final String SHARE_URL_PREFIX0 = "https://v2.fangcloud.com/s";
|
public static final String SHARE_URL_PREFIX0 = "https://v2.fangcloud.com/s";
|
||||||
public static final String SHARE_URL_PREFIX = "https://v2.fangcloud.com/sharing/";
|
public static final String SHARE_URL_PREFIX = "https://v2.fangcloud.com/sharing/";
|
||||||
@@ -27,44 +31,45 @@ public class FcTool extends PanBase implements IPanTool {
|
|||||||
private static final String DOWN_REQUEST_URL = "https://v2.fangcloud.cn/apps/files/download?file_id={fid}" +
|
private static final String DOWN_REQUEST_URL = "https://v2.fangcloud.cn/apps/files/download?file_id={fid}" +
|
||||||
"&scenario=share&unique_name={uname}";
|
"&scenario=share&unique_name={uname}";
|
||||||
|
|
||||||
public FcTool(String key, String pwd) {
|
public Future<String> parse(String data, String code) {
|
||||||
super(key, pwd);
|
data = data.replace("share","sharing");
|
||||||
}
|
|
||||||
|
|
||||||
public Future<String> parse() {
|
|
||||||
String data = key.replace("share","sharing");
|
|
||||||
String dataKey = CommonUtils.adaptShortPaths(SHARE_URL_PREFIX, data);
|
String dataKey = CommonUtils.adaptShortPaths(SHARE_URL_PREFIX, data);
|
||||||
|
|
||||||
|
Promise<String> promise = Promise.promise();
|
||||||
|
|
||||||
|
Vertx vertx = VertxHolder.getVertxInstance();
|
||||||
|
WebClient client = WebClient.create(vertx);
|
||||||
WebClientSession sClient = WebClientSession.create(client);
|
WebClientSession sClient = WebClientSession.create(client);
|
||||||
// 第一次请求 自动重定向
|
// 第一次请求 自动重定向
|
||||||
sClient.getAbs(SHARE_URL_PREFIX + dataKey).send().onSuccess(res -> {
|
sClient.getAbs(SHARE_URL_PREFIX + dataKey).send().onSuccess(res -> {
|
||||||
|
|
||||||
// 判断是否是加密分享
|
// 判断是否是加密分享
|
||||||
if (StringUtils.isNotEmpty(pwd)) {
|
if (StringUtils.isNotEmpty(code)) {
|
||||||
// 获取requesttoken
|
// 获取requesttoken
|
||||||
String html = res.bodyAsString();
|
String html = res.bodyAsString();
|
||||||
Pattern compile = Pattern.compile("name=\"requesttoken\"\\s+value=\"([a-zA-Z0-9_+=]+)\"");
|
Pattern compile = Pattern.compile("name=\"requesttoken\"\\s+value=\"([a-zA-Z0-9_+=]+)\"");
|
||||||
Matcher matcher = compile.matcher(html);
|
Matcher matcher = compile.matcher(html);
|
||||||
if (!matcher.find()) {
|
if (!matcher.find()) {
|
||||||
fail(SHARE_URL_PREFIX + " 未匹配到加密分享的密码输入页面的requesttoken");
|
promise.fail(SHARE_URL_PREFIX + " 未匹配到加密分享的密码输入页面的requesttoken: \n" + html);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String token = matcher.group(1);
|
String token = matcher.group(1);
|
||||||
|
|
||||||
sClient.postAbs(SHARE_URL_PREFIX2 + dataKey).sendForm(MultiMap.caseInsensitiveMultiMap()
|
sClient.postAbs(SHARE_URL_PREFIX2 + dataKey).sendForm(MultiMap.caseInsensitiveMultiMap()
|
||||||
.set("requesttoken", token)
|
.set("requesttoken", token)
|
||||||
.set("password", pwd)).onSuccess(res2 -> {
|
.set("password", code)).onSuccess(res2 -> {
|
||||||
if (res2.statusCode() == 302) {
|
if (res2.statusCode() == 302) {
|
||||||
sClient.getAbs(res2.getHeader("Location")).send()
|
sClient.getAbs(res2.getHeader("Location")).send().onSuccess(res3 ->
|
||||||
.onSuccess(res3 -> getDownURL(dataKey, promise, res3, sClient))
|
getDownURL(dataKey, promise, res3, sClient))
|
||||||
.onFailure(handleFail(res2.getHeader("Location")));
|
.onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Fc", dataKey, t)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fail(SHARE_URL_PREFIX + " 密码跳转后获取重定向失败");
|
promise.fail(SHARE_URL_PREFIX + " 密码跳转后获取重定向失败 \n" + html);
|
||||||
}).onFailure(handleFail(SHARE_URL_PREFIX2));
|
}).onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Fc", dataKey, t)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
getDownURL(dataKey, promise, res, sClient);
|
getDownURL(dataKey, promise, res, sClient);
|
||||||
}).onFailure(handleFail(SHARE_URL_PREFIX + dataKey));
|
}).onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Fc", dataKey, t)));
|
||||||
return promise.future();
|
return promise.future();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,12 +80,14 @@ public class FcTool extends PanBase implements IPanTool {
|
|||||||
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);
|
||||||
if (!matcher.find()) {
|
if (!matcher.find()) {
|
||||||
fail(SHARE_URL_PREFIX + " 未匹配到文件id(typed_id)");
|
promise.fail(SHARE_URL_PREFIX + " 未匹配到文件id(typed_id): \n" + html);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String fid = matcher.group(1);
|
String fid = matcher.group(1);
|
||||||
|
|
||||||
// 创建一个不自动重定向的WebClientSession
|
// 创建一个不自动重定向的WebClientSession
|
||||||
|
WebClient clientNoRedirects = WebClient.create(VertxHolder.getVertxInstance(),
|
||||||
|
new WebClientOptions().setFollowRedirects(false));
|
||||||
WebClientSession sClientNoRedirects = WebClientSession.create(clientNoRedirects, sClient.cookieStore());
|
WebClientSession sClientNoRedirects = WebClientSession.create(clientNoRedirects, sClient.cookieStore());
|
||||||
// 第二次请求
|
// 第二次请求
|
||||||
sClientNoRedirects.getAbs(UriTemplate.of(DOWN_REQUEST_URL))
|
sClientNoRedirects.getAbs(UriTemplate.of(DOWN_REQUEST_URL))
|
||||||
@@ -90,14 +97,14 @@ public class FcTool extends PanBase implements IPanTool {
|
|||||||
try {
|
try {
|
||||||
resJson = res2.bodyAsJsonObject();
|
resJson = res2.bodyAsJsonObject();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
fail(e, DOWN_REQUEST_URL + " 第二次请求没有返回JSON, 可能下载受限");
|
promise.fail(DOWN_REQUEST_URL + " 第二次请求没有返回JSON, 可能下载受限: " + res2.bodyAsString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!resJson.getBoolean("success")) {
|
if (!resJson.getBoolean("success")) {
|
||||||
fail(DOWN_REQUEST_URL + " 第二次请求未得到正确相应: " + resJson);
|
promise.fail(DOWN_REQUEST_URL + " 第二次请求未得到正确相应: " + resJson);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
promise.complete(resJson.getString("download_url"));
|
promise.complete(resJson.getString("download_url"));
|
||||||
}).onFailure(handleFail(DOWN_REQUEST_URL));
|
}).onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Fc", dataKey, t)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
package cn.qaiu.lz.common.parser.impl;
|
package cn.qaiu.lz.common.parser.impl;
|
||||||
|
|
||||||
import cn.qaiu.lz.common.parser.IPanTool;
|
import cn.qaiu.lz.common.parser.IPanTool;
|
||||||
import cn.qaiu.lz.common.parser.PanBase;
|
|
||||||
import cn.qaiu.lz.common.util.AESUtils;
|
import cn.qaiu.lz.common.util.AESUtils;
|
||||||
import cn.qaiu.lz.common.util.CommonUtils;
|
import cn.qaiu.lz.common.util.CommonUtils;
|
||||||
|
import cn.qaiu.lz.common.util.PanExceptionUtils;
|
||||||
import cn.qaiu.vx.core.util.VertxHolder;
|
import cn.qaiu.vx.core.util.VertxHolder;
|
||||||
import io.vertx.core.Future;
|
import io.vertx.core.Future;
|
||||||
import io.vertx.core.MultiMap;
|
import io.vertx.core.MultiMap;
|
||||||
|
import io.vertx.core.Promise;
|
||||||
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.WebClient;
|
||||||
import io.vertx.ext.web.client.WebClientOptions;
|
import io.vertx.ext.web.client.WebClientOptions;
|
||||||
@@ -19,7 +20,7 @@ import java.util.UUID;
|
|||||||
*
|
*
|
||||||
* @version V016_230609
|
* @version V016_230609
|
||||||
*/
|
*/
|
||||||
public class FjTool extends PanBase implements IPanTool {
|
public class FjTool implements IPanTool {
|
||||||
|
|
||||||
public static final String SHARE_URL_PREFIX = "https://www.feijix.com/s/";
|
public static final String SHARE_URL_PREFIX = "https://www.feijix.com/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/";
|
||||||
@@ -30,13 +31,10 @@ public class FjTool extends PanBase implements IPanTool {
|
|||||||
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}";
|
||||||
|
|
||||||
public FjTool(String key, String pwd) {
|
public Future<String> parse(String data, String code) {
|
||||||
super(key, pwd);
|
String dataKey = CommonUtils.adaptShortPaths(SHARE_URL_PREFIX, data);
|
||||||
}
|
|
||||||
|
|
||||||
public Future<String> parse() {
|
|
||||||
String dataKey = CommonUtils.adaptShortPaths(SHARE_URL_PREFIX, key);
|
|
||||||
|
|
||||||
|
Promise<String> promise = Promise.promise();
|
||||||
WebClient client = WebClient.create(VertxHolder.getVertxInstance(),
|
WebClient client = WebClient.create(VertxHolder.getVertxInstance(),
|
||||||
new WebClientOptions().setFollowRedirects(false));
|
new WebClientOptions().setFollowRedirects(false));
|
||||||
String shareId = String.valueOf(AESUtils.idEncrypt(dataKey));
|
String shareId = String.valueOf(AESUtils.idEncrypt(dataKey));
|
||||||
@@ -46,11 +44,11 @@ public class FjTool extends PanBase implements IPanTool {
|
|||||||
client.postAbs(UriTemplate.of(FIRST_REQUEST_URL)).setTemplateParam("shareId", shareId).send().onSuccess(res -> {
|
client.postAbs(UriTemplate.of(FIRST_REQUEST_URL)).setTemplateParam("shareId", shareId).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);
|
promise.fail(FIRST_REQUEST_URL + " 返回异常: " + resJson);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (resJson.getJsonArray("list").size() == 0) {
|
if (resJson.getJsonArray("list").size() == 0) {
|
||||||
fail(FIRST_REQUEST_URL + " 解析文件列表为空: " + resJson);
|
promise.fail(FIRST_REQUEST_URL + " 解析文件列表为空: " + resJson);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 文件Id
|
// 文件Id
|
||||||
@@ -69,12 +67,12 @@ public class FjTool extends PanBase implements IPanTool {
|
|||||||
.setTemplateParam("auth", auth).send().onSuccess(res2 -> {
|
.setTemplateParam("auth", auth).send().onSuccess(res2 -> {
|
||||||
MultiMap headers = res2.headers();
|
MultiMap headers = res2.headers();
|
||||||
if (!headers.contains("Location")) {
|
if (!headers.contains("Location")) {
|
||||||
fail(SECOND_REQUEST_URL + " 未找到重定向URL: \n" + res.headers());
|
promise.fail(SECOND_REQUEST_URL + " 未找到重定向URL: \n" + res.headers());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
promise.complete(headers.get("Location"));
|
promise.complete(headers.get("Location"));
|
||||||
}).onFailure(handleFail(SECOND_REQUEST_URL));
|
}).onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Fj", dataKey, t)));
|
||||||
}).onFailure(handleFail(FIRST_REQUEST_URL));
|
}).onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Fj", dataKey, t)));
|
||||||
|
|
||||||
return promise.future();
|
return promise.future();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package cn.qaiu.lz.common.parser.impl;
|
package cn.qaiu.lz.common.parser.impl;
|
||||||
|
|
||||||
import cn.qaiu.lz.common.parser.IPanTool;
|
import cn.qaiu.lz.common.parser.IPanTool;
|
||||||
import cn.qaiu.lz.common.parser.PanBase;
|
import cn.qaiu.lz.common.util.PanExceptionUtils;
|
||||||
import cn.qaiu.vx.core.util.VertxHolder;
|
import cn.qaiu.vx.core.util.VertxHolder;
|
||||||
import io.vertx.core.Future;
|
import io.vertx.core.Future;
|
||||||
import io.vertx.core.MultiMap;
|
import io.vertx.core.MultiMap;
|
||||||
@@ -19,20 +19,17 @@ import java.util.regex.Pattern;
|
|||||||
* @author QAIU
|
* @author QAIU
|
||||||
* @version 1.0 update 2021/5/16 10:39
|
* @version 1.0 update 2021/5/16 10:39
|
||||||
*/
|
*/
|
||||||
public class LzTool extends PanBase implements IPanTool {
|
public class LzTool implements IPanTool {
|
||||||
|
|
||||||
public static final String SHARE_URL_PREFIX = "https://wwwa.lanzoui.com";
|
public static final String SHARE_URL_PREFIX = "https://wwwa.lanzoui.com";
|
||||||
|
|
||||||
public LzTool(String key, String pwd) {
|
public Future<String> parse(String data, String code) {
|
||||||
super(key, pwd);
|
Promise<String> promise = Promise.promise();
|
||||||
}
|
String key = data.indexOf('/') > 0 ? data : SHARE_URL_PREFIX + "/" + data;
|
||||||
|
|
||||||
public Future<String> parse() {
|
|
||||||
String sUrl = key.startsWith("https://") ? key : SHARE_URL_PREFIX + "/" + key;
|
|
||||||
|
|
||||||
WebClient client = WebClient.create(VertxHolder.getVertxInstance(),
|
WebClient client = WebClient.create(VertxHolder.getVertxInstance(),
|
||||||
new WebClientOptions().setFollowRedirects(false));
|
new WebClientOptions().setFollowRedirects(false));
|
||||||
client.getAbs(sUrl).send().onSuccess(res -> {
|
client.getAbs(key).send().onSuccess(res -> {
|
||||||
String html = res.bodyAsString();
|
String html = res.bodyAsString();
|
||||||
// 匹配iframe
|
// 匹配iframe
|
||||||
Pattern compile = Pattern.compile("src=\"(/fn\\?[a-zA-Z\\d_+/=]{16,})\"");
|
Pattern compile = Pattern.compile("src=\"(/fn\\?[a-zA-Z\\d_+/=]{16,})\"");
|
||||||
@@ -42,11 +39,11 @@ public class LzTool extends PanBase implements IPanTool {
|
|||||||
Pattern compile2 = Pattern.compile("sign=(\\w{16,})");
|
Pattern compile2 = Pattern.compile("sign=(\\w{16,})");
|
||||||
Matcher matcher2 = compile2.matcher(html);
|
Matcher matcher2 = compile2.matcher(html);
|
||||||
if (!matcher2.find()) {
|
if (!matcher2.find()) {
|
||||||
fail(sUrl + ": sign正则匹配失败, 可能分享已失效");
|
promise.fail(key + ": sign正则匹配失败, 可能分享已失效: " + html);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String sign = matcher2.group(1);
|
String sign = matcher2.group(1);
|
||||||
getDownURL(promise, sUrl, client, sign);
|
getDownURL(promise, code, key, client, sign);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String iframePath = matcher.group(1);
|
String iframePath = matcher.group(1);
|
||||||
@@ -55,17 +52,17 @@ public class LzTool extends PanBase implements IPanTool {
|
|||||||
System.out.println(html);
|
System.out.println(html);
|
||||||
Matcher matcher2 = Pattern.compile("'sign'\s*:\s*'(\\w+)'").matcher(html2);
|
Matcher matcher2 = Pattern.compile("'sign'\s*:\s*'(\\w+)'").matcher(html2);
|
||||||
if (!matcher2.find()) {
|
if (!matcher2.find()) {
|
||||||
fail(SHARE_URL_PREFIX + iframePath + " -> " + sUrl + ": sign正则匹配失败, 可能分享已失效");
|
promise.fail(SHARE_URL_PREFIX + iframePath + " -> " + key + ": sign正则匹配失败, 可能分享已失效: " + html2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String sign = matcher2.group(1);
|
String sign = matcher2.group(1);
|
||||||
getDownURL(promise, sUrl, client, sign);
|
getDownURL(promise, code, key, client, sign);
|
||||||
}).onFailure(handleFail(SHARE_URL_PREFIX));
|
}).onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Lz", key, t)));
|
||||||
}).onFailure(handleFail(sUrl));
|
}).onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Lz", key, t)));
|
||||||
return promise.future();
|
return promise.future();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getDownURL(Promise<String> promise, String key, WebClient client, String sign) {
|
private void getDownURL(Promise<String> promise, String code, String key, WebClient client, String sign) {
|
||||||
MultiMap headers = MultiMap.caseInsensitiveMultiMap();
|
MultiMap headers = MultiMap.caseInsensitiveMultiMap();
|
||||||
var userAgent2 = "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, " +
|
var userAgent2 = "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, " +
|
||||||
"like " +
|
"like " +
|
||||||
@@ -76,20 +73,19 @@ public class LzTool extends PanBase implements IPanTool {
|
|||||||
headers.set("Accept-Language", "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2");
|
headers.set("Accept-Language", "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2");
|
||||||
headers.set("sec-ch-ua-mobile", "sec-ch-ua-mobile");
|
headers.set("sec-ch-ua-mobile", "sec-ch-ua-mobile");
|
||||||
|
|
||||||
String url = SHARE_URL_PREFIX + "/ajaxm.php";
|
client.postAbs(SHARE_URL_PREFIX + "/ajaxm.php").putHeaders(headers).sendForm(MultiMap
|
||||||
client.postAbs(url).putHeaders(headers).sendForm(MultiMap
|
|
||||||
.caseInsensitiveMultiMap()
|
.caseInsensitiveMultiMap()
|
||||||
.set("action", "downprocess")
|
.set("action", "downprocess")
|
||||||
.set("sign", sign).set("p", pwd)).onSuccess(res2 -> {
|
.set("sign", sign).set("p", code)).onSuccess(res2 -> {
|
||||||
JsonObject urlJson = res2.bodyAsJsonObject();
|
JsonObject urlJson = res2.bodyAsJsonObject();
|
||||||
if (urlJson.getInteger("zt") != 1) {
|
if (urlJson.getInteger("zt") != 1) {
|
||||||
fail(urlJson.getString("inf"));
|
promise.fail(urlJson.getString("inf"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String downUrl = urlJson.getString("dom") + "/file/" + urlJson.getString("url");
|
String downUrl = urlJson.getString("dom") + "/file/" + urlJson.getString("url");
|
||||||
client.getAbs(downUrl).putHeaders(headers).send()
|
client.getAbs(downUrl).putHeaders(headers).send()
|
||||||
.onSuccess(res3 -> promise.complete(res3.headers().get("Location")))
|
.onSuccess(res3 -> promise.complete(res3.headers().get("Location")))
|
||||||
.onFailure(handleFail(downUrl));
|
.onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Lz", key, t)));
|
||||||
}).onFailure(handleFail(url));
|
}).onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Lz", key, t)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import io.vertx.core.Future;
|
|||||||
import io.vertx.core.Promise;
|
import io.vertx.core.Promise;
|
||||||
|
|
||||||
public class QkTool {
|
public class QkTool {
|
||||||
public static Future<String> parse() {
|
public static Future<String> parse(String data, String code) {
|
||||||
Promise<String> promise = Promise.promise();
|
Promise<String> promise = Promise.promise();
|
||||||
|
|
||||||
return promise.future();
|
return promise.future();
|
||||||
|
|||||||
@@ -1,17 +1,22 @@
|
|||||||
package cn.qaiu.lz.common.parser.impl;
|
package cn.qaiu.lz.common.parser.impl;
|
||||||
|
|
||||||
import cn.qaiu.lz.common.parser.IPanTool;
|
import cn.qaiu.lz.common.parser.IPanTool;
|
||||||
import cn.qaiu.lz.common.parser.PanBase;
|
|
||||||
import cn.qaiu.lz.common.util.CommonUtils;
|
import cn.qaiu.lz.common.util.CommonUtils;
|
||||||
|
import cn.qaiu.lz.common.util.PanExceptionUtils;
|
||||||
|
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.json.JsonArray;
|
import io.vertx.core.json.JsonArray;
|
||||||
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 lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UC网盘解析
|
* UC网盘解析
|
||||||
*/
|
*/
|
||||||
public class UcTool extends PanBase implements IPanTool {
|
@Slf4j
|
||||||
|
public class UcTool implements IPanTool {
|
||||||
private static final String API_URL_PREFIX = "https://pc-api.uc.cn/1/clouddrive/";
|
private static final String API_URL_PREFIX = "https://pc-api.uc.cn/1/clouddrive/";
|
||||||
|
|
||||||
public static final String SHARE_URL_PREFIX = "https://fast.uc.cn/s/";
|
public static final String SHARE_URL_PREFIX = "https://fast.uc.cn/s/";
|
||||||
@@ -24,13 +29,11 @@ public class UcTool extends PanBase implements IPanTool {
|
|||||||
|
|
||||||
private static final String THIRD_REQUEST_URL = API_URL_PREFIX + "file/download?entry=ft&fr=pc&pr=UCBrowser";
|
private static final String THIRD_REQUEST_URL = API_URL_PREFIX + "file/download?entry=ft&fr=pc&pr=UCBrowser";
|
||||||
|
|
||||||
public UcTool(String key, String pwd) {
|
public Future<String> parse(String data, String code) {
|
||||||
super(key, pwd);
|
var dataKey = CommonUtils.adaptShortPaths(SHARE_URL_PREFIX, data);
|
||||||
}
|
var passcode = (code == null) ? "" : code;
|
||||||
|
Promise<String> promise = Promise.promise();
|
||||||
public Future<String> parse() {
|
var client = WebClient.create(VertxHolder.getVertxInstance());
|
||||||
var dataKey = CommonUtils.adaptShortPaths(SHARE_URL_PREFIX, key);
|
|
||||||
var passcode = (pwd == null) ? "" : pwd;
|
|
||||||
var jsonObject = JsonObject.of("share_for_transfer", true);
|
var jsonObject = JsonObject.of("share_for_transfer", true);
|
||||||
jsonObject.put("pwd_id", dataKey);
|
jsonObject.put("pwd_id", dataKey);
|
||||||
jsonObject.put("passcode", passcode);
|
jsonObject.put("passcode", passcode);
|
||||||
@@ -39,7 +42,7 @@ public class UcTool extends PanBase implements IPanTool {
|
|||||||
log.debug("第一阶段 {}", res.body());
|
log.debug("第一阶段 {}", res.body());
|
||||||
var resJson = res.bodyAsJsonObject();
|
var resJson = res.bodyAsJsonObject();
|
||||||
if (resJson.getInteger("code") != 0) {
|
if (resJson.getInteger("code") != 0) {
|
||||||
fail(FIRST_REQUEST_URL + " 返回异常: " + resJson);
|
promise.fail(FIRST_REQUEST_URL + " 返回异常: " + resJson);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var stoken = resJson.getJsonObject("data").getString("stoken");
|
var stoken = resJson.getJsonObject("data").getString("stoken");
|
||||||
@@ -52,7 +55,7 @@ public class UcTool extends PanBase implements IPanTool {
|
|||||||
log.debug("第二阶段 {}", res2.body());
|
log.debug("第二阶段 {}", res2.body());
|
||||||
JsonObject resJson2 = res2.bodyAsJsonObject();
|
JsonObject resJson2 = res2.bodyAsJsonObject();
|
||||||
if (resJson2.getInteger("code") != 0) {
|
if (resJson2.getInteger("code") != 0) {
|
||||||
fail(FIRST_REQUEST_URL + " 返回异常: " + resJson2);
|
promise.fail(FIRST_REQUEST_URL + " 返回异常: " + resJson2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 文件信息
|
// 文件信息
|
||||||
@@ -68,15 +71,15 @@ public class UcTool extends PanBase implements IPanTool {
|
|||||||
log.debug("第三阶段 {}", res3.body());
|
log.debug("第三阶段 {}", res3.body());
|
||||||
var resJson3 = res3.bodyAsJsonObject();
|
var resJson3 = res3.bodyAsJsonObject();
|
||||||
if (resJson3.getInteger("code") != 0) {
|
if (resJson3.getInteger("code") != 0) {
|
||||||
fail(FIRST_REQUEST_URL + " 返回异常: " + resJson2);
|
promise.fail(FIRST_REQUEST_URL + " 返回异常: " + resJson2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
promise.complete(resJson3.getJsonArray("data").getJsonObject(0).getString("download_url"));
|
promise.complete(resJson3.getJsonArray("data").getJsonObject(0).getString("download_url"));
|
||||||
}).onFailure(handleFail(THIRD_REQUEST_URL));
|
}).onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Uc", dataKey, t)));
|
||||||
|
|
||||||
}).onFailure(handleFail(SECOND_REQUEST_URL));
|
}).onFailure(t -> promise.fail(new RuntimeException("解析异常: ", t.fillInStackTrace())));
|
||||||
}
|
}
|
||||||
).onFailure(handleFail(FIRST_REQUEST_URL));
|
).onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Uc", dataKey, t)));
|
||||||
return promise.future();
|
return promise.future();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,22 @@
|
|||||||
package cn.qaiu.lz.common.parser.impl;
|
package cn.qaiu.lz.common.parser.impl;
|
||||||
|
|
||||||
import cn.qaiu.lz.common.parser.IPanTool;
|
import cn.qaiu.lz.common.parser.IPanTool;
|
||||||
import cn.qaiu.lz.common.parser.PanBase;
|
|
||||||
import cn.qaiu.lz.common.util.CommonUtils;
|
import cn.qaiu.lz.common.util.CommonUtils;
|
||||||
import cn.qaiu.lz.common.util.JsExecUtils;
|
import cn.qaiu.lz.common.util.JsExecUtils;
|
||||||
|
import cn.qaiu.lz.common.util.PanExceptionUtils;
|
||||||
|
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.json.JsonObject;
|
import io.vertx.core.json.JsonObject;
|
||||||
import io.vertx.ext.web.client.WebClient;
|
import io.vertx.ext.web.client.WebClient;
|
||||||
import io.vertx.uritemplate.UriTemplate;
|
import io.vertx.uritemplate.UriTemplate;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openjdk.nashorn.api.scripting.ScriptObjectMirror;
|
import org.openjdk.nashorn.api.scripting.ScriptObjectMirror;
|
||||||
|
|
||||||
|
import javax.script.ScriptException;
|
||||||
|
import java.io.IOException;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -20,23 +26,30 @@ import java.util.regex.Pattern;
|
|||||||
/**
|
/**
|
||||||
* 123网盘
|
* 123网盘
|
||||||
*/
|
*/
|
||||||
public class YeTool extends PanBase implements IPanTool {
|
@Slf4j
|
||||||
|
public class YeTool implements IPanTool {
|
||||||
public static final String SHARE_URL_PREFIX = "https://www.123pan.com/s/";
|
public static final String SHARE_URL_PREFIX = "https://www.123pan.com/s/";
|
||||||
public static final String FIRST_REQUEST_URL = SHARE_URL_PREFIX + "{key}.html";
|
public static final String FIRST_REQUEST_URL = SHARE_URL_PREFIX + "{key}.html";
|
||||||
|
/*
|
||||||
|
private static final String GET_FILE_INFO_URL = "https://www.123pan.com/a/api/share/get?limit=100&next=1&orderBy" +
|
||||||
|
"=file_name&orderDirection=asc&shareKey={shareKey}&SharePwd={pwd}&ParentFileId=0&Page=1&event" +
|
||||||
|
"=homeListFile&operateType=1";
|
||||||
|
private static final String GET_FILE_INFO_URL="https://www.123pan
|
||||||
|
.com/b/api/share/get?limit=100&next=1&orderBy=file_name&orderDirection=asc" +
|
||||||
|
"&shareKey={shareKey}&SharePwd={pwd}&ParentFileId=0&Page=1&event=homeListFile&operateType=1&auth-key
|
||||||
|
={authKey}";
|
||||||
|
*/
|
||||||
|
|
||||||
private static final String GET_FILE_INFO_URL = "https://www.123pan.com/b/api/share/get?limit=100&next=1&orderBy" +
|
private static final String GET_FILE_INFO_URL = "https://www.123pan.com/a/api/share/get?limit=100&next=1&orderBy" +
|
||||||
"=file_name&orderDirection=asc" +
|
"=file_name&orderDirection=asc" +
|
||||||
"&shareKey={shareKey}&SharePwd={pwd}&ParentFileId=0&Page=1&event=homeListFile&operateType=1";
|
"&shareKey={shareKey}&SharePwd={pwd}&ParentFileId=0&Page=1&event=homeListFile&operateType=1";
|
||||||
private static final String DOWNLOAD_API_URL = "https://www.123pan.com/b/api/share/download/info?{authK}={authV}";
|
private static final String DOWNLOAD_API_URL = "https://www.123pan.com/a/api/share/download/info?{authK}={authV}";
|
||||||
|
|
||||||
public YeTool(String key, String pwd) {
|
public Future<String> parse(String data, String code) {
|
||||||
super(key, pwd);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Future<String> parse() {
|
String dataKey = CommonUtils.adaptShortPaths(SHARE_URL_PREFIX, data);
|
||||||
|
Promise<String> promise = Promise.promise();
|
||||||
String dataKey = CommonUtils.adaptShortPaths(SHARE_URL_PREFIX, key);
|
WebClient client = WebClient.create(VertxHolder.getVertxInstance());
|
||||||
|
|
||||||
client.getAbs(UriTemplate.of(FIRST_REQUEST_URL)).setTemplateParam("key", dataKey).send().onSuccess(res -> {
|
client.getAbs(UriTemplate.of(FIRST_REQUEST_URL)).setTemplateParam("key", dataKey).send().onSuccess(res -> {
|
||||||
|
|
||||||
@@ -45,7 +58,7 @@ public class YeTool extends PanBase implements IPanTool {
|
|||||||
Matcher matcher = compile.matcher(html);
|
Matcher matcher = compile.matcher(html);
|
||||||
|
|
||||||
if (!matcher.find()) {
|
if (!matcher.find()) {
|
||||||
fail(html + "\n Ye: " + dataKey + " 正则匹配失败");
|
promise.fail(html + "\n Ye: " + dataKey + " 正则匹配失败");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String fileInfoString = matcher.group(1);
|
String fileInfoString = matcher.group(1);
|
||||||
@@ -54,45 +67,45 @@ public class YeTool extends PanBase implements IPanTool {
|
|||||||
JsonObject resListJson = fileInfoJson.getJsonObject("reslist");
|
JsonObject resListJson = fileInfoJson.getJsonObject("reslist");
|
||||||
|
|
||||||
if (resJson == null || resJson.getInteger("code") != 0) {
|
if (resJson == null || resJson.getInteger("code") != 0) {
|
||||||
fail(dataKey + " 解析到异常JSON: " + resJson);
|
promise.fail(dataKey + " 解析到异常JSON: " + resJson);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String shareKey = resJson.getJsonObject("data").getString("ShareKey");
|
String shareKey = resJson.getJsonObject("data").getString("ShareKey");
|
||||||
if (resListJson == null || resListJson.getInteger("code") != 0) {
|
if (resListJson == null || resListJson.getInteger("code") != 0) {
|
||||||
// 加密分享
|
// 加密分享
|
||||||
if (StringUtils.isNotEmpty(pwd)) {
|
if (StringUtils.isNotEmpty(code)) {
|
||||||
client.getAbs(UriTemplate.of(GET_FILE_INFO_URL))
|
client.getAbs(UriTemplate.of(GET_FILE_INFO_URL))
|
||||||
.setTemplateParam("shareKey", shareKey)
|
.setTemplateParam("shareKey", shareKey)
|
||||||
.setTemplateParam("pwd", pwd)
|
.setTemplateParam("pwd", code)
|
||||||
// .setTemplateParam("authKey", AESUtils.getAuthKey("/b/api/share/get"))
|
// .setTemplateParam("authKey", AESUtils.getAuthKey("/b/api/share/get"))
|
||||||
.putHeader("Platform", "web")
|
.putHeader("Platform", "web")
|
||||||
.putHeader("App-Version", "3")
|
.putHeader("App-Version", "3")
|
||||||
.send().onSuccess(res2 -> {
|
.send().onSuccess(res2 -> {
|
||||||
JsonObject infoJson = res2.bodyAsJsonObject();
|
JsonObject infoJson = res2.bodyAsJsonObject();
|
||||||
if (infoJson.getInteger("code") != 0) {
|
if (infoJson.getInteger("code") != 0) {
|
||||||
fail("{} 状态码异常 {}", dataKey, infoJson);
|
promise.fail("Ye: " + dataKey + " 状态码异常" + infoJson);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
JsonObject getFileInfoJson =
|
JsonObject getFileInfoJson =
|
||||||
infoJson.getJsonObject("data").getJsonArray("InfoList").getJsonObject(0);
|
infoJson.getJsonObject("data").getJsonArray("InfoList").getJsonObject(0);
|
||||||
getFileInfoJson.put("ShareKey", shareKey);
|
getFileInfoJson.put("ShareKey", shareKey);
|
||||||
getDownUrl(client, getFileInfoJson);
|
getDownUrl(promise, client, getFileInfoJson);
|
||||||
}).onFailure(this.handleFail(GET_FILE_INFO_URL));
|
}).onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Ye", dataKey, t)));
|
||||||
} else {
|
} else {
|
||||||
fail("该分享[{}]需要密码",dataKey);
|
promise.fail(dataKey + " 该分享需要密码");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
JsonObject reqBodyJson = resListJson.getJsonObject("data").getJsonArray("InfoList").getJsonObject(0);
|
JsonObject reqBodyJson = resListJson.getJsonObject("data").getJsonArray("InfoList").getJsonObject(0);
|
||||||
reqBodyJson.put("ShareKey", shareKey);
|
reqBodyJson.put("ShareKey", shareKey);
|
||||||
getDownUrl(client, reqBodyJson);
|
getDownUrl(promise, client, reqBodyJson);
|
||||||
}).onFailure(this.handleFail(FIRST_REQUEST_URL));
|
}).onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Ye", dataKey, t)));
|
||||||
|
|
||||||
return promise.future();
|
return promise.future();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getDownUrl(WebClient client, JsonObject reqBodyJson) {
|
private static void getDownUrl(Promise<String> promise, WebClient client, JsonObject reqBodyJson) {
|
||||||
log.info(reqBodyJson.encodePrettily());
|
log.info(reqBodyJson.encodePrettily());
|
||||||
JsonObject jsonObject = new JsonObject();
|
JsonObject jsonObject = new JsonObject();
|
||||||
// {"ShareKey":"iaKtVv-6OECd","FileID":2193732,"S3keyFlag":"1811834632-0","Size":4203111,
|
// {"ShareKey":"iaKtVv-6OECd","FileID":2193732,"S3keyFlag":"1811834632-0","Size":4203111,
|
||||||
@@ -106,9 +119,13 @@ public class YeTool extends PanBase implements IPanTool {
|
|||||||
// 调用JS文件获取签名
|
// 调用JS文件获取签名
|
||||||
ScriptObjectMirror getSign;
|
ScriptObjectMirror getSign;
|
||||||
try {
|
try {
|
||||||
getSign = JsExecUtils.executeJs("getSign", "/b/api/share/download/info");
|
getSign = JsExecUtils.executeJs("getSign", "/a/api/share/download/info");
|
||||||
} catch (Exception e) {
|
} catch (ScriptException | IOException | NoSuchMethodException e) {
|
||||||
fail(e, "JS函数执行异常");
|
promise.fail(e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (getSign == null) {
|
||||||
|
promise.fail(ArrayUtils.toString(getSign));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
log.info("ye getSign: {}={}", getSign.get("0").toString(), getSign.get("1").toString());
|
log.info("ye getSign: {}={}", getSign.get("0").toString(), getSign.get("1").toString());
|
||||||
@@ -123,11 +140,11 @@ public class YeTool extends PanBase implements IPanTool {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (downURLJson.getInteger("code") != 0) {
|
if (downURLJson.getInteger("code") != 0) {
|
||||||
fail("Ye: downURLJson返回值异常->" + downURLJson);
|
promise.fail("Ye: downURLJson返回值异常->" + downURLJson);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
fail("Ye: downURLJson格式异常->" + downURLJson);
|
promise.fail("Ye: downURLJson格式异常->" + downURLJson);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String downURL = downURLJson.getJsonObject("data").getString("DownloadURL");
|
String downURL = downURLJson.getJsonObject("data").getString("DownloadURL");
|
||||||
@@ -142,21 +159,23 @@ public class YeTool extends PanBase implements IPanTool {
|
|||||||
JsonObject res3Json = res3.bodyAsJsonObject();
|
JsonObject res3Json = res3.bodyAsJsonObject();
|
||||||
try {
|
try {
|
||||||
if (res3Json.getInteger("code") != 0) {
|
if (res3Json.getInteger("code") != 0) {
|
||||||
fail("Ye: downUrl2返回值异常->" + res3Json);
|
promise.fail("Ye: downUrl2返回值异常->" + res3Json);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
fail("Ye: downUrl2格式异常->" + downURLJson);
|
promise.fail("Ye: downUrl2格式异常->" + downURLJson);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
promise.complete(res3Json.getJsonObject("data").getString("redirect_url"));
|
promise.complete(res3Json.getJsonObject("data").getString("redirect_url"));
|
||||||
|
|
||||||
}).onFailure(this.handleFail("获取直链失败"));
|
}).onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Ye",
|
||||||
|
reqBodyJson.encodePrettily(), t)));
|
||||||
|
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
fail("urlParams解析异常" + e.getMessage());
|
promise.fail("urlParams解析异常" + e.getMessage());
|
||||||
}
|
}
|
||||||
}).onFailure(this.handleFail(DOWNLOAD_API_URL));
|
}).onFailure(t -> promise.fail(PanExceptionUtils.fillRunTimeException("Ye",
|
||||||
|
reqBodyJson.encodePrettily(), t)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import javax.script.Invocable;
|
|||||||
import javax.script.ScriptEngine;
|
import javax.script.ScriptEngine;
|
||||||
import javax.script.ScriptEngineManager;
|
import javax.script.ScriptEngineManager;
|
||||||
import javax.script.ScriptException;
|
import javax.script.ScriptException;
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.FileReader;
|
import java.io.FileReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
@@ -18,32 +17,26 @@ import java.net.URL;
|
|||||||
*/
|
*/
|
||||||
public class JsExecUtils {
|
public class JsExecUtils {
|
||||||
private static final String JS_PATH = "/js/ye123.js";
|
private static final String JS_PATH = "/js/ye123.js";
|
||||||
private static Invocable inv;
|
|
||||||
|
|
||||||
// 初始化脚本引擎
|
/**
|
||||||
static {
|
* 调用js文件
|
||||||
|
*/
|
||||||
|
public static ScriptObjectMirror executeJs(String functionName, Object... args) throws ScriptException,
|
||||||
|
IOException, NoSuchMethodException {
|
||||||
ScriptEngineManager engineManager = new ScriptEngineManager();
|
ScriptEngineManager engineManager = new ScriptEngineManager();
|
||||||
ScriptEngine engine = engineManager.getEngineByName("JavaScript"); // 得到脚本引擎
|
ScriptEngine engine = engineManager.getEngineByName("JavaScript"); // 得到脚本引擎
|
||||||
//获取文件所在的相对路径
|
//获取文件所在的相对路径
|
||||||
URL resource = JsExecUtils.class.getResource("/");
|
URL resource = JsExecUtils.class.getResource("/");
|
||||||
if (resource == null) {
|
if (resource == null) {
|
||||||
throw new RuntimeException("js resource path is null");
|
throw new ScriptException("js resource path is null");
|
||||||
}
|
}
|
||||||
String path = resource.getPath();
|
String path = resource.getPath();
|
||||||
String reader = path + JS_PATH;
|
String reader = path + JS_PATH;
|
||||||
try (FileReader fReader = new FileReader(reader)){
|
FileReader fReader = new FileReader(reader);
|
||||||
engine.eval(fReader);
|
engine.eval(fReader);
|
||||||
fReader.close();
|
fReader.close();
|
||||||
inv = (Invocable) engine;
|
|
||||||
} catch (IOException | ScriptException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
Invocable inv = (Invocable) engine;
|
||||||
* 调用js文件
|
|
||||||
*/
|
|
||||||
public static ScriptObjectMirror executeJs(String functionName, Object... args) throws ScriptException, NoSuchMethodException {
|
|
||||||
//调用js中的方法
|
//调用js中的方法
|
||||||
return (ScriptObjectMirror) inv.invokeFunction(functionName, args);
|
return (ScriptObjectMirror) inv.invokeFunction(functionName, args);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public class ServerApi {
|
|||||||
url = EcTool.SHARE_URL_PREFIX + request.getParam("data");
|
url = EcTool.SHARE_URL_PREFIX + request.getParam("data");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
IPanTool.shareURLPrefixMatching(url, pwd).parse().onSuccess(resUrl -> {
|
IPanTool.shareURLPrefixMatching(url).parse(url, pwd).onSuccess(resUrl -> {
|
||||||
response.putHeader("location", resUrl).setStatusCode(302).end();
|
response.putHeader("location", resUrl).setStatusCode(302).end();
|
||||||
promise.complete();
|
promise.complete();
|
||||||
}).onFailure(t -> promise.fail(t.fillInStackTrace()));
|
}).onFailure(t -> promise.fail(t.fillInStackTrace()));
|
||||||
@@ -54,12 +54,12 @@ public class ServerApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RouteMapping(value = "/json/parser", method = RouteMethod.GET, order = 3)
|
@RouteMapping(value = "/json/parser", method = RouteMethod.GET, order = 3)
|
||||||
public Future<String> parseJson(HttpServerRequest request, String url, String pwd) {
|
public Future<String> parseJson(HttpServerResponse response, HttpServerRequest request, String url, String pwd) {
|
||||||
if (url.contains(EcTool.SHARE_URL_PREFIX)) {
|
if (url.contains(EcTool.SHARE_URL_PREFIX)) {
|
||||||
// 默认读取Url参数会被截断手动获取一下其他参数
|
// 默认读取Url参数会被截断手动获取一下其他参数
|
||||||
url = EcTool.SHARE_URL_PREFIX + request.getParam("data");
|
url = EcTool.SHARE_URL_PREFIX + request.getParam("data");
|
||||||
}
|
}
|
||||||
return IPanTool.shareURLPrefixMatching(url, pwd).parse();
|
return IPanTool.shareURLPrefixMatching(url).parse(url, pwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ public class ServerApi {
|
|||||||
code = keys[1];
|
code = keys[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
IPanTool.typeMatching(type, key, code).parse().onSuccess(resUrl -> response.putHeader("location", resUrl)
|
IPanTool.typeMatching(type).parse(key, code).onSuccess(resUrl -> response.putHeader("location", resUrl)
|
||||||
.setStatusCode(302).end()).onFailure(t -> {
|
.setStatusCode(302).end()).onFailure(t -> {
|
||||||
response.putHeader(CONTENT_TYPE, "text/html;charset=utf-8");
|
response.putHeader(CONTENT_TYPE, "text/html;charset=utf-8");
|
||||||
response.end(t.getMessage());
|
response.end(t.getMessage());
|
||||||
@@ -80,13 +80,13 @@ public class ServerApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RouteMapping(value = "/json/:type/:key", method = RouteMethod.GET, order = 2)
|
@RouteMapping(value = "/json/:type/:key", method = RouteMethod.GET, order = 2)
|
||||||
public Future<String> parseKeyJson(String type, String key) {
|
public Future<String> parseKeyJson(HttpServerResponse response, String type, String key) {
|
||||||
String code = "";
|
String code = "";
|
||||||
if (key.contains("@")) {
|
if (key.contains("@")) {
|
||||||
String[] keys = key.split("@");
|
String[] keys = key.split("@");
|
||||||
key = keys[0];
|
key = keys[0];
|
||||||
code = keys[1];
|
code = keys[1];
|
||||||
}
|
}
|
||||||
return IPanTool.typeMatching(type, key, code).parse();
|
return IPanTool.typeMatching(type).parse(key, code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# 要激活的配置: dev--连接本地数据库; prod连接线上数据库
|
# 要激活的配置: dev--连接本地数据库; prod连接线上数据库
|
||||||
active: dev
|
active: dev
|
||||||
# 版本号
|
# 框架版本号 和主版本号
|
||||||
|
version_vertx: 4.4.1
|
||||||
version_app: 0.1.6
|
version_app: 0.1.6
|
||||||
# 公司名称 -> LOGO版权文字
|
# 公司名称 -> LOGO版权文字
|
||||||
copyright: QAIU
|
copyright: QAIU
|
||||||
|
|||||||
@@ -10,44 +10,25 @@ content-type: application/json
|
|||||||
{"pwd_id":"33197dd53ace4","passcode":"","share_for_transfer":true}
|
{"pwd_id":"33197dd53ace4","passcode":"","share_for_transfer":true}
|
||||||
|
|
||||||
### UCpan 第二步 获取fid,share_fid_token GET传参pwd_id,passcode,stoken
|
### UCpan 第二步 获取fid,share_fid_token GET传参pwd_id,passcode,stoken
|
||||||
https://pc-api.uc.cn/1/clouddrive/transfer_share/detail?pwd_id=33197dd53ace4&passcode=&stoken=4lXGIeQ6rdqjuOPW1MHJpqrQR3RWGFKSAAjpTibsR%2B8%3D
|
https://pc-api.uc.cn/1/clouddrive/transfer_share/detail?pwd_id=33197dd53ace4&passcode=&stoken=W5b1n2jeFld5RmIusaVOr3vA0vVSCWYQ7Mz8bT2coZM%3D
|
||||||
content-type: application/json
|
content-type: application/json
|
||||||
|
|
||||||
### UCpan 第二步获取下载链接 POST json传入fids(fid),pwd_id,stoken,fids_token(share_fid_token)
|
### UCpan 第二步获取下载链接 POST json传入fids(fid),pwd_id,stoken,fids_token(share_fid_token)
|
||||||
|
|
||||||
POST https://pc-api.uc.cn/1/clouddrive/file/download?entry=ft&fr=pc&pr=UCBrowser
|
POST https://pc-api.uc.cn/1/clouddrive/file/download?entry=ft&fr=pc&pr=UCBrowser
|
||||||
content-type: application/json
|
content-type: application/json
|
||||||
#Cookie: __pus=7576a6d3a511ad7b4c5649a1d89c29ffAAQ06zBxHWghrwEbKRdqBrhXssuYiMIwLLVzi1f2K6qnSL95A79GIxXDEPlYS3NaPjDWOcWVuvbQ3HqTfvqRKr29
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"fids": [
|
"fids": [
|
||||||
"54c3cd90ed3e45119bb96ed99a562d40"
|
"54c3cd90ed3e45119bb96ed99a562d40"
|
||||||
],
|
],
|
||||||
"pwd_id": "33197dd53ace4",
|
"pwd_id": "33197dd53ace4",
|
||||||
"stoken": "7P02U9tWJEkkMgbXaIJxAQyBiqcfPdkbDZ6XoiYsBiA=",
|
"stoken": "W5b1n2jeFld5RmIusaVOr3vA0vVSCWYQ7Mz8bT2coZM=",
|
||||||
"fids_token": [
|
"fids_token": [
|
||||||
"e8a52adcda41d9e218e732b5de549d2a"
|
"4cb5eabb0ce5a26d12ae5ab8acf68aec"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
###
|
###
|
||||||
# @no-redirect
|
# @no-redirect
|
||||||
https://dl-uf-zb.pds.uc.cn/l3PNAKfz/64623447/646b0de6e9f13000c9b14ba182b805312795a82a/646b0de6717e1bfa5bb44dd2a456f103c5177850?Expires=1691488145&OSSAccessKeyId=LTAIyYfxTqY7YZsg&Signature=MvUiIWszmMncqDrsLV%2BlL1HpuYw%3D&x-oss-traffic-limit=503316480&response-content-disposition=attachment%3B%20filename%3DC%23%20Shell%20%28C%23%20Offline%20Compiler%29_2.5.16.apks&callback-var=eyJ4OmF1IjoiLSIsIng6c3AiOiIxOTkiLCJ4OnRva2VuIjoiMi1iYzBhNTgxNTUwOGE0NmQwYmE4YzUxYjAyZGEwNjA5Yi01LTctNjE0NDAtZGFjYjM2NjViYmFhNGY1ZTlkMzc4MDBlYzY0MDMxNjAtNGZhNTliY2RkNzhlYTE0MDg0Mjc5OGVlNDMxZWFlMDciLCJ4OnR0bCI6IjEwODAwIn0%3D&callback=eyJjYWxsYmFja0JvZHlUeXBlIjoiYXBwbGljYXRpb24vanNvbiIsImNhbGxiYWNrU3RhZ2UiOiJiZWZvcmUtZXhlY3V0ZSIsImNhbGxiYWNrRmFpbHVyZUFjdGlvbiI6Imlnbm9yZSIsImNhbGxiYWNrVXJsIjoiaHR0cHM6Ly9hdXRoLWNkbi51Yy5jbi9vdXRlci9vc3MvY2hlY2twbGF5IiwiY2FsbGJhY2tCb2R5Ijoie1wiaG9zdFwiOiR7aHR0cEhlYWRlci5ob3N0fSxcInNpemVcIjoke3NpemV9LFwicmFuZ2VcIjoke2h0dHBIZWFkZXIucmFuZ2V9LFwicmVmZXJlclwiOiR7aHR0cEhlYWRlci5yZWZlcmVyfSxcImNvb2tpZVwiOiR7aHR0cEhlYWRlci5jb29raWV9LFwibWV0aG9kXCI6JHtodHRwSGVhZGVyLm1ldGhvZH0sXCJpcFwiOiR7Y2xpZW50SXB9LFwicG9ydFwiOiR7Y2xpZW50UG9ydH0sXCJvYmplY3RcIjoke29iamVjdH0sXCJzcFwiOiR7eDpzcH0sXCJ0b2tlblwiOiR7eDp0b2tlbn0sXCJhdVwiOiR7eDphdX0sXCJ0dGxcIjoke3g6dHRsfSxcImNsaWVudF90b2tlblwiOiR7cXVlcnlTdHJpbmcuY2xpZW50X3Rva2VufX0ifQ%3D%3D&ud=4-N-5-0-6-N-3-ft-0-2
|
https://dl-uf-zb.pds.uc.cn/l3PNAKfz/64623447/646b0de6e9f13000c9b14ba182b805312795a82a/646b0de6717e1bfa5bb44dd2a456f103c5177850?Expires=1690188688&OSSAccessKeyId=LTAIyYfxTqY7YZsg&Signature=gB3rN%2FxPal3ZpReRkB1M4cnvGF4%3D&x-oss-traffic-limit=503316480&response-content-disposition=attachment%3B%20filename%3DC%23%20Shell%20%28C%23%20Offline%20Compiler%29_2.5.16.apks&callback-var=eyJ4OmF1IjoiLSIsIng6c3AiOiIxOTkiLCJ4OnRva2VuIjoiMi0wNDBjYjFjMDNjNzU1YWY1NDc0NjkxNjNmOTYzYWY2NC0yLTctNjE0NDAtZGFjYjM2NjViYmFhNGY1ZTlkMzc4MDBlYzY0MDMxNjAtYTU2MGJiMmU1MzhlNzY0OTFkMDY1MjA2OGRiNmEzMzEiLCJ4OnR0bCI6IjEwODAwIn0%3D&callback=eyJjYWxsYmFja0JvZHlUeXBlIjoiYXBwbGljYXRpb24vanNvbiIsImNhbGxiYWNrU3RhZ2UiOiJiZWZvcmUtZXhlY3V0ZSIsImNhbGxiYWNrRmFpbHVyZUFjdGlvbiI6Imlnbm9yZSIsImNhbGxiYWNrVXJsIjoiaHR0cHM6Ly9hdXRoLWNkbi51Yy5jbi9vdXRlci9vc3MvY2hlY2twbGF5IiwiY2FsbGJhY2tCb2R5Ijoie1wiaG9zdFwiOiR7aHR0cEhlYWRlci5ob3N0fSxcInNpemVcIjoke3NpemV9LFwicmFuZ2VcIjoke2h0dHBIZWFkZXIucmFuZ2V9LFwicmVmZXJlclwiOiR7aHR0cEhlYWRlci5yZWZlcmVyfSxcImNvb2tpZVwiOiR7aHR0cEhlYWRlci5jb29raWV9LFwibWV0aG9kXCI6JHtodHRwSGVhZGVyLm1ldGhvZH0sXCJpcFwiOiR7Y2xpZW50SXB9LFwicG9ydFwiOiR7Y2xpZW50UG9ydH0sXCJvYmplY3RcIjoke29iamVjdH0sXCJzcFwiOiR7eDpzcH0sXCJ0b2tlblwiOiR7eDp0b2tlbn0sXCJhdVwiOiR7eDphdX0sXCJ0dGxcIjoke3g6dHRsfSxcImNsaWVudF90b2tlblwiOiR7cXVlcnlTdHJpbmcuY2xpZW50X3Rva2VufX0ifQ%3D%3D&ud=4-0-5-0-6-N-3-ft-0-2&__pus=7576a6d3a511ad7b4c5649a1d89c29ffAAQ06zBxHWghrwEbKRdqBrhXssuYiMIwLLVzi1f2K6qnSL95A79GIxXDEPlYS3NaPjDWOcWVuvbQ3HqTfvqRKr29
|
||||||
#Cookie: __pus=7576a6d3a511ad7b4c5649a1d89c29ffAAQ06zBxHWghrwEbKRdqBrhXssuYiMIwLLVzi1f2K6qnSL95A79GIxXDEPlYS3NaPjDWOcWVuvbQ3HqTfvqRKr29
|
#Cookie: __pus=7576a6d3a511ad7b4c5649a1d89c29ffAAQ06zBxHWghrwEbKRdqBrhXssuYiMIwLLVzi1f2K6qnSL95A79GIxXDEPlYS3NaPjDWOcWVuvbQ3HqTfvqRKr29
|
||||||
|
|
||||||
###
|
|
||||||
https://dl-uf-zb.pds.uc.cn/l3PNAKfz/64623447/646b0de6e9f13000c9b14ba182b805312795a82a/646b0de6717e1bfa5bb44dd2a456f103c5177850?Expires=1691488387&OSSAccessKeyId=LTAIyYfxTqY7YZsg&Signature=WIy4UGCwd9eNdUnSexRVFUCFZcM%3D&x-oss-traffic-limit=503316480&response-content-disposition=attachment%3B%20filename%3DC%23%20Shell%20%28C%23%20Offline%20Compiler%29_2.5.16.apks&callback-var=eyJ4OmF1IjoiLSIsIng6c3AiOiIxOTkiLCJ4OnRva2VuIjoiMi0wNDBjYjFjMDNjNzU1YWY1NDc0NjkxNjNmOTYzYWY2NC0yLTctNjE0NDAtZGFjYjM2NjViYmFhNGY1ZTlkMzc4MDBlYzY0MDMxNjAtYTU2MGJiMmU1MzhlNzY0OTFkMDY1MjA2OGRiNmEzMzEiLCJ4OnR0bCI6IjEwODAwIn0%3D&callback=eyJjYWxsYmFja0JvZHlUeXBlIjoiYXBwbGljYXRpb24vanNvbiIsImNhbGxiYWNrU3RhZ2UiOiJiZWZvcmUtZXhlY3V0ZSIsImNhbGxiYWNrRmFpbHVyZUFjdGlvbiI6Imlnbm9yZSIsImNhbGxiYWNrVXJsIjoiaHR0cHM6Ly9hdXRoLWNkbi51Yy5jbi9vdXRlci9vc3MvY2hlY2twbGF5IiwiY2FsbGJhY2tCb2R5Ijoie1wiaG9zdFwiOiR7aHR0cEhlYWRlci5ob3N0fSxcInNpemVcIjoke3NpemV9LFwicmFuZ2VcIjoke2h0dHBIZWFkZXIucmFuZ2V9LFwicmVmZXJlclwiOiR7aHR0cEhlYWRlci5yZWZlcmVyfSxcImNvb2tpZVwiOiR7aHR0cEhlYWRlci5jb29raWV9LFwibWV0aG9kXCI6JHtodHRwSGVhZGVyLm1ldGhvZH0sXCJpcFwiOiR7Y2xpZW50SXB9LFwicG9ydFwiOiR7Y2xpZW50UG9ydH0sXCJvYmplY3RcIjoke29iamVjdH0sXCJzcFwiOiR7eDpzcH0sXCJ0b2tlblwiOiR7eDp0b2tlbn0sXCJhdVwiOiR7eDphdX0sXCJ0dGxcIjoke3g6dHRsfSxcImNsaWVudF90b2tlblwiOiR7cXVlcnlTdHJpbmcuY2xpZW50X3Rva2VufX0ifQ%3D%3D&ud=4-0-5-0-6-N-3-ft-0-2
|
|
||||||
|
|
||||||
###
|
|
||||||
#@no-cookie-jar
|
|
||||||
https://dl-uf-zb.pds.uc.cn/l3PNAKfz/64623447/646b0de6e9f13000c9b14ba182b805312795a82a/646b0de6717e1bfa5bb44dd2a456f103c5177850?Expires=1691488539&OSSAccessKeyId=LTAIyYfxTqY7YZsg&Signature=rhD0OQTq2CuMUvp0ZphStKiyyw8%3D&x-oss-traffic-limit=503316480&response-content-disposition=attachment%3B%20filename%3DC%23%20Shell%20%28C%23%20Offline%20Compiler%29_2.5.16.apks&callback-var=eyJ4OmF1IjoiLSIsIng6c3AiOiIxOTkiLCJ4OnRva2VuIjoiMi02YTU3OGNkNjYyMTQzZWI4ODFjZTE0ZGYyNjk5OTQ4OS01LTctNjE0NDAtZGFjYjM2NjViYmFhNGY1ZTlkMzc4MDBlYzY0MDMxNjAtYzlhYWI1YjA5ZDNhYTA5MWU4NTJjNTJlNGRjYWJkZDYiLCJ4OnR0bCI6IjEwODAwIn0%3D&callback=eyJjYWxsYmFja0JvZHlUeXBlIjoiYXBwbGljYXRpb24vanNvbiIsImNhbGxiYWNrU3RhZ2UiOiJiZWZvcmUtZXhlY3V0ZSIsImNhbGxiYWNrRmFpbHVyZUFjdGlvbiI6Imlnbm9yZSIsImNhbGxiYWNrVXJsIjoiaHR0cHM6Ly9hdXRoLWNkbi51Yy5jbi9vdXRlci9vc3MvY2hlY2twbGF5IiwiY2FsbGJhY2tCb2R5Ijoie1wiaG9zdFwiOiR7aHR0cEhlYWRlci5ob3N0fSxcInNpemVcIjoke3NpemV9LFwicmFuZ2VcIjoke2h0dHBIZWFkZXIucmFuZ2V9LFwicmVmZXJlclwiOiR7aHR0cEhlYWRlci5yZWZlcmVyfSxcImNvb2tpZVwiOiR7aHR0cEhlYWRlci5jb29raWV9LFwibWV0aG9kXCI6JHtodHRwSGVhZGVyLm1ldGhvZH0sXCJpcFwiOiR7Y2xpZW50SXB9LFwicG9ydFwiOiR7Y2xpZW50UG9ydH0sXCJvYmplY3RcIjoke29iamVjdH0sXCJzcFwiOiR7eDpzcH0sXCJ0b2tlblwiOiR7eDp0b2tlbn0sXCJhdVwiOiR7eDphdX0sXCJ0dGxcIjoke3g6dHRsfSxcImNsaWVudF90b2tlblwiOiR7cXVlcnlTdHJpbmcuY2xpZW50X3Rva2VufX0ifQ%3D%3D&ud=4-N-5-0-6-N-3-ft-0-2
|
|
||||||
Cookie: __pugs=efc5f3f9c041af5dc62eea4481901cbbAAT912628i+uT/WMwOFWBjJ1TjbKGC1j6cyGHSLVzwuPQP74d+rZXO4xJgdG93MC5DUDdgRJcg5y93waA/KPWDSeDY8LPgjB2Ha2tQ3sQ/MXMoRUi/LRdY3psAyC3YOlUDeFwLtkLAXABRgJhKTw6W0v
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###
|
|
||||||
#@no-cookie-jar
|
|
||||||
|
|
||||||
https://dl-uf-zb.pds.uc.cn/l3PNAKfz/64623447/646b0de6e9f13000c9b14ba182b805312795a82a/646b0de6717e1bfa5bb44dd2a456f103c5177850?Expires=1691489999&OSSAccessKeyId=LTAIyYfxTqY7YZsg&Signature=NbQLAEUCkvJxmSsRoIynZ%2BuPMvY%3D&x-oss-traffic-limit=503316480&response-content-disposition=attachment%3B%20filename%3DC%23%20Shell%20%28C%23%20Offline%20Compiler%29_2.5.16.apks&callback-var=eyJ4OmF1IjoiLSIsIng6c3AiOiIxOTkiLCJ4OnRva2VuIjoiMi0wNDBjYjFjMDNjNzU1YWY1NDc0NjkxNjNmOTYzYWY2NC0yLTctNjE0NDAtZGFjYjM2NjViYmFhNGY1ZTlkMzc4MDBlYzY0MDMxNjAtYTU2MGJiMmU1MzhlNzY0OTFkMDY1MjA2OGRiNmEzMzEiLCJ4OnR0bCI6IjEwODAwIn0%3D&callback=eyJjYWxsYmFja0JvZHlUeXBlIjoiYXBwbGljYXRpb24vanNvbiIsImNhbGxiYWNrU3RhZ2UiOiJiZWZvcmUtZXhlY3V0ZSIsImNhbGxiYWNrRmFpbHVyZUFjdGlvbiI6Imlnbm9yZSIsImNhbGxiYWNrVXJsIjoiaHR0cHM6Ly9hdXRoLWNkbi51Yy5jbi9vdXRlci9vc3MvY2hlY2twbGF5IiwiY2FsbGJhY2tCb2R5Ijoie1wiaG9zdFwiOiR7aHR0cEhlYWRlci5ob3N0fSxcInNpemVcIjoke3NpemV9LFwicmFuZ2VcIjoke2h0dHBIZWFkZXIucmFuZ2V9LFwicmVmZXJlclwiOiR7aHR0cEhlYWRlci5yZWZlcmVyfSxcImNvb2tpZVwiOiR7aHR0cEhlYWRlci5jb29raWV9LFwibWV0aG9kXCI6JHtodHRwSGVhZGVyLm1ldGhvZH0sXCJpcFwiOiR7Y2xpZW50SXB9LFwicG9ydFwiOiR7Y2xpZW50UG9ydH0sXCJvYmplY3RcIjoke29iamVjdH0sXCJzcFwiOiR7eDpzcH0sXCJ0b2tlblwiOiR7eDp0b2tlbn0sXCJhdVwiOiR7eDphdX0sXCJ0dGxcIjoke3g6dHRsfSxcImNsaWVudF90b2tlblwiOiR7cXVlcnlTdHJpbmcuY2xpZW50X3Rva2VufX0ifQ%3D%3D&ud=4-0-5-0-6-N-3-ft-0-2
|
|
||||||
Cookie: __puus=dc48cb12577eb3df6fe84fdea250ad6fAAOF0LBv/M4HTtkYfuUNdcVLXHZl1x2mw8NQSdxo5abymS+irugphlPNv5kwQZkDI+pXaeOD22v/whNQT5AwUULF0q1nSNXmHqxr20AJjXlEhvbIZNgUfwmw8aOCyarrLi7o7w6w0Rod4DLCSeYGwlTF3P9jMcqCM+WqWHnxKY6i8gaXZkHLObatSHkwivB7Xpc=
|
|
||||||
Referer: https://fast.uc.cn/
|
|
||||||
|
|||||||
@@ -119,3 +119,8 @@ Platform:web
|
|||||||
{"ShareKey":"iaKtVv-6OECd","behavior":1}
|
{"ShareKey":"iaKtVv-6OECd","behavior":1}
|
||||||
|
|
||||||
### eaefamemdead
|
### eaefamemdead
|
||||||
|
POST https://www.123pan.com/a/api/share/download/info?598392083=1691599441-4130548-2079498810
|
||||||
|
App-Version:3
|
||||||
|
Platform:web
|
||||||
|
|
||||||
|
{"ShareKey":"iaKtVv-ICECd","FileID":2169781,"S3keyFlag":"1815268665-0","Size":163708684,"Etag":"e7f288198505ae4481d638f1f42f1477"}
|
||||||
|
|||||||
@@ -65,10 +65,10 @@ GET http://127.0.0.1:6400/fj/tIfhRqH
|
|||||||
|
|
||||||
### 360亿方云
|
### 360亿方云
|
||||||
# @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/share/2f238f7714cf61cdc631d23d18
|
||||||
|
|
||||||
### 360亿方云
|
### 360亿方云
|
||||||
GET http://127.0.0.1:6400/json/fc/fb54bdf03c66c04334fe3687a3
|
GET http://127.0.0.1:6400/json/fc/30646fefc8bf936a4766ab8a5e
|
||||||
|
|
||||||
### 360亿方云
|
### 360亿方云
|
||||||
# @no-redirect
|
# @no-redirect
|
||||||
|
|||||||
@@ -38,7 +38,18 @@ function _0x1b5d95(_0x278d1a) {
|
|||||||
function _0x4f141a(_0x4075b1) {
|
function _0x4f141a(_0x4075b1) {
|
||||||
|
|
||||||
for (var _0x4eddcb = arguments['length'] > 0x1 && void 0x0 !== arguments[0x1] ? arguments[0x1] : 0xa,
|
for (var _0x4eddcb = arguments['length'] > 0x1 && void 0x0 !== arguments[0x1] ? arguments[0x1] : 0xa,
|
||||||
_0x2fc680 = function() {
|
|
||||||
|
_0x4ee01e = function(_0x3bb99e) {
|
||||||
|
var _0x3bb99e = _0x3bb99e['replace'](/\\r\\n/g, '\x5cn');
|
||||||
|
for (var _0x585459 = '', _0x15c988 = 0x0; _0x15c988 < _0x3bb99e['length']; _0x15c988++) {
|
||||||
|
var _0x36bb3e = _0x3bb99e['charCodeAt'](_0x15c988);
|
||||||
|
_0x36bb3e < 0x80 ? _0x585459 += String['fromCharCode'](_0x36bb3e) : _0x36bb3e > 0x7f && _0x36bb3e < 0x800 ? (_0x585459 += String['fromCharCode'](_0x36bb3e >> 0x6 | 0xc0),
|
||||||
|
_0x585459 += String['fromCharCode'](0x3f & _0x36bb3e | 0x80)) : (_0x585459 += String['fromCharCode'](_0x36bb3e >> 0xc | 0xe0),
|
||||||
|
_0x585459 += String['fromCharCode'](_0x36bb3e >> 0x6 & 0x3f | 0x80),
|
||||||
|
_0x585459 += String['fromCharCode'](0x3f & _0x36bb3e | 0x80));
|
||||||
|
}
|
||||||
|
return _0x585459;
|
||||||
|
}, _0x2fc680 = function() {
|
||||||
for (var _0x515c63, _0x361314 = [], _0x4cbdba = 0x0; _0x4cbdba < 0x100; _0x4cbdba++) {
|
for (var _0x515c63, _0x361314 = [], _0x4cbdba = 0x0; _0x4cbdba < 0x100; _0x4cbdba++) {
|
||||||
_0x515c63 = _0x4cbdba;
|
_0x515c63 = _0x4cbdba;
|
||||||
for (var _0x460960 = 0x0; _0x460960 < 0x8; _0x460960++)
|
for (var _0x460960 = 0x0; _0x460960 < 0x8; _0x460960++)
|
||||||
@@ -48,7 +59,7 @@ function _0x4f141a(_0x4075b1) {
|
|||||||
return _0x361314;
|
return _0x361314;
|
||||||
},
|
},
|
||||||
_0x4aed86 = _0x2fc680(),
|
_0x4aed86 = _0x2fc680(),
|
||||||
_0x5880f0 = _0x4075b1,
|
_0x5880f0 = _0x4ee01e(_0x4075b1),
|
||||||
_0x492393 = -0x1, _0x25d82c = 0x0;
|
_0x492393 = -0x1, _0x25d82c = 0x0;
|
||||||
_0x25d82c < _0x5880f0['length'];
|
_0x25d82c < _0x5880f0['length'];
|
||||||
_0x25d82c++)
|
_0x25d82c++)
|
||||||
|
|||||||
@@ -65,8 +65,8 @@ public class TestAESUtil {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testKeyAuth(){
|
public void testKeyAuth(){
|
||||||
System.out.println(AESUtils.getAuthKey("/b/api/share/download/info"));
|
System.out.println(AESUtils.getAuthKey("/a/api/share/download/info"));
|
||||||
System.out.println(AESUtils.getAuthKey("/b/api/share/download/info"));
|
System.out.println(AESUtils.getAuthKey("/a/api/share/download/info"));
|
||||||
System.out.println(AESUtils.getAuthKey("/b/api/share/get"));
|
System.out.println(AESUtils.getAuthKey("/b/api/share/get"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user