国庆快乐 ^ ^ #59

This commit is contained in:
QAIU
2024-09-30 17:42:38 +08:00
parent 209e9c2866
commit d8666acfe8
2 changed files with 1 additions and 14 deletions

View File

@@ -6,8 +6,6 @@ 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;
@@ -40,11 +38,6 @@ 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

@@ -1,16 +1,11 @@
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;
@@ -29,7 +24,6 @@ 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 -> {
@@ -85,7 +79,7 @@ public class LeTool extends PanBase implements IPanTool {
return;
}
// 获取重定向链接跳转链接
client.getAbs(downloadUrl).send()
clientNoRedirects.getAbs(downloadUrl).send()
.onSuccess(res2 -> promise.complete(res2.headers().get("Location")))
.onFailure(handleFail(downloadUrl));
} else {