mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2025-12-17 21:03:03 +00:00
国庆快乐 ^ ^ #59
This commit is contained in:
@@ -6,8 +6,6 @@ import io.vertx.core.Handler;
|
|||||||
import io.vertx.core.Promise;
|
import io.vertx.core.Promise;
|
||||||
import io.vertx.core.json.DecodeException;
|
import io.vertx.core.json.DecodeException;
|
||||||
import io.vertx.core.json.JsonObject;
|
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.HttpResponse;
|
||||||
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;
|
||||||
@@ -40,11 +38,6 @@ public abstract class PanBase {
|
|||||||
protected WebClient clientNoRedirects = WebClient.create(WebClientVertxInit.get(),
|
protected WebClient clientNoRedirects = WebClient.create(WebClientVertxInit.get(),
|
||||||
new WebClientOptions().setFollowRedirects(false));
|
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;
|
protected ShareLinkInfo shareLinkInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,16 +1,11 @@
|
|||||||
package cn.qaiu.parser.impl;
|
package cn.qaiu.parser.impl;
|
||||||
|
|
||||||
import cn.qaiu.WebClientVertxInit;
|
|
||||||
import cn.qaiu.entity.ShareLinkInfo;
|
import cn.qaiu.entity.ShareLinkInfo;
|
||||||
import cn.qaiu.parser.IPanTool;
|
import cn.qaiu.parser.IPanTool;
|
||||||
import cn.qaiu.parser.PanBase;
|
import cn.qaiu.parser.PanBase;
|
||||||
import io.vertx.core.Future;
|
import io.vertx.core.Future;
|
||||||
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.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;
|
import java.util.UUID;
|
||||||
|
|
||||||
@@ -29,7 +24,6 @@ public class LeTool extends PanBase implements IPanTool {
|
|||||||
final String pwd = shareLinkInfo.getSharePassword();
|
final String pwd = shareLinkInfo.getSharePassword();
|
||||||
// {"shareId":"xxx","password":"xxx","directoryId":"-1"}
|
// {"shareId":"xxx","password":"xxx","directoryId":"-1"}
|
||||||
String apiUrl1 = API_URL_PREFIX + "shareInfo";
|
String apiUrl1 = API_URL_PREFIX + "shareInfo";
|
||||||
|
|
||||||
client.postAbs(apiUrl1)
|
client.postAbs(apiUrl1)
|
||||||
.sendJsonObject(JsonObject.of("shareId", dataKey, "password", pwd, "directoryId", -1))
|
.sendJsonObject(JsonObject.of("shareId", dataKey, "password", pwd, "directoryId", -1))
|
||||||
.onSuccess(res -> {
|
.onSuccess(res -> {
|
||||||
@@ -85,7 +79,7 @@ public class LeTool extends PanBase implements IPanTool {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 获取重定向链接跳转链接
|
// 获取重定向链接跳转链接
|
||||||
client.getAbs(downloadUrl).send()
|
clientNoRedirects.getAbs(downloadUrl).send()
|
||||||
.onSuccess(res2 -> promise.complete(res2.headers().get("Location")))
|
.onSuccess(res2 -> promise.complete(res2.headers().get("Location")))
|
||||||
.onFailure(handleFail(downloadUrl));
|
.onFailure(handleFail(downloadUrl));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user