0.0.1 fixed done

This commit is contained in:
qaiu
2023-04-21 23:42:22 +08:00
parent 1bb2a53511
commit e36e644394
4 changed files with 12 additions and 5 deletions

View File

@@ -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 蓝奏云
###

View File

@@ -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)

View File

@@ -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<String> 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));
}
}

View File

@@ -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
###