Skip to content

Commit

Permalink
国庆快乐 ^ ^ #59
Browse files Browse the repository at this point in the history
  • Loading branch information
qaiu committed Sep 30, 2024
1 parent 209e9c2 commit d8666ac
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
7 changes: 0 additions & 7 deletions parser/src/main/java/cn/qaiu/parser/PanBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
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;
Expand Down Expand Up @@ -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;

/**
Expand Down
8 changes: 1 addition & 7 deletions parser/src/main/java/cn/qaiu/parser/impl/LeTool.java
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -29,7 +24,6 @@ public Future<String> parse() {
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 -> {
Expand Down Expand Up @@ -85,7 +79,7 @@ private void getDownURL(String key, String fileId) {
return;
}
// 获取重定向链接跳转链接
client.getAbs(downloadUrl).send()
clientNoRedirects.getAbs(downloadUrl).send()
.onSuccess(res2 -> promise.complete(res2.headers().get("Location")))
.onFailure(handleFail(downloadUrl));
} else {
Expand Down

0 comments on commit d8666ac

Please sign in to comment.