diff --git a/README.md b/README.md index 482a816..6e64616 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ GET http://127.0.0.1:6400/parse?url=https://lanzoux.com/ia2cntg ### # @no-redirect -GET http://127.0.0.1:6400/parse?url=https://cowtransfer.com/core/api/transfer/share?uniqueUrl=9a644fe3e3a748 +GET http://127.0.0.1:6400/parse?url=https://cowtransfer.com/s/9a644fe3e3a748 // Rest请求(只提供共享文件Id): cow 奶牛快传; lz 蓝奏云 ### diff --git a/lz-cow-api-web/src/main/java/cn/qaiu/lz/common/util/CowTool.java b/lz-cow-api-web/src/main/java/cn/qaiu/lz/common/util/CowTool.java index 10234fa..3585386 100644 --- a/lz-cow-api-web/src/main/java/cn/qaiu/lz/common/util/CowTool.java +++ b/lz-cow-api-web/src/main/java/cn/qaiu/lz/common/util/CowTool.java @@ -41,7 +41,7 @@ public class CowTool { } */ public static String parse(String fullUrl) throws IOException { - String uniqueUrl = fullUrl.substring(fullUrl.lastIndexOf('=') + 1); + String uniqueUrl = fullUrl.substring(fullUrl.lastIndexOf('/') + 1); String baseUrl = "https://cowtransfer.com/core/api/transfer/share"; String result = Jsoup .connect(baseUrl + "?uniqueUrl=" + uniqueUrl).ignoreContentType(true) diff --git a/lz-cow-api-web/src/main/java/cn/qaiu/lz/web/http/ServerApi.java b/lz-cow-api-web/src/main/java/cn/qaiu/lz/web/http/ServerApi.java index ade96fe..12c07cc 100644 --- a/lz-cow-api-web/src/main/java/cn/qaiu/lz/web/http/ServerApi.java +++ b/lz-cow-api-web/src/main/java/cn/qaiu/lz/web/http/ServerApi.java @@ -59,7 +59,7 @@ public class ServerApi { @RouteMapping(value = "/cow/:id", method = RouteMethod.GET) public void cowParse(HttpServerResponse response, String id) throws Exception { - String url = "https://cowtransfer.com/core/api/transfer/share?uniqueUrl=" + id; + String url = "https://cowtransfer.com/s/" + id; String urlDownload = CowTool.parse(url); response.putHeader("location", urlDownload).setStatusCode(302).end(); } @@ -74,7 +74,7 @@ public class ServerApi { @RouteMapping(value = "/json/cow/:id", method = RouteMethod.GET) public JsonResult cowParseJson(HttpServerResponse response, String id) throws Exception { - String url = "https://cowtransfer.com/core/api/transfer/share?uniqueUrl=" + id; + String url = "https://cowtransfer.com/s/" + id; return JsonResult.data(CowTool.parse(url)); } } diff --git a/lz-cow-api-web/src/main/resources/1.http b/lz-cow-api-web/src/main/resources/1.http index 3465131..93d5962 100644 --- a/lz-cow-api-web/src/main/resources/1.http +++ b/lz-cow-api-web/src/main/resources/1.http @@ -5,18 +5,25 @@ GET http://127.0.0.1:6400/api/serverApi/test3?fullUrl=https://wwp.lanzoux.com/iN GET http://127.0.0.1:6400/parse?url=https://lanzoux.com/ia2cntg ### # @no-redirect -GET http://127.0.0.1:6400/parse?url=https://cowtransfer.com/core/api/transfer/share?uniqueUrl=9a644fe3e3a748 +GET http://127.0.0.1:6400/parse?url=https://cowtransfer.com/s/9a644fe3e3a748 ### # @no-redirect GET http://127.0.0.1:6400/cow/9a644fe3e3a748 ### +# @no-redirect GET http://127.0.0.1:6400/lz/ia2cntg + ### GET http://127.0.0.1:6400/json/lz/ia2cntg +### +GET http://127.0.0.1:6400/json/cow/9a644fe3e3a748 + ### +//https://cowtransfer.com/s/9a644fe3e3a748 + https://cowtransfer.com/core/api/transfer/share?uniqueUrl=9a644fe3e3a748 ###