mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-11-26 15:17:00 +00:00
0.0.1 done
This commit is contained in:
1 parent
ca166184ba
commit
1bb2a53511
38 files changed
+296
-145
No files matched your search
@@ -1,2 +1,30 @@
|
||||
# lz-cow-api
|
||||
蓝奏云-奶牛快传的直链解析的API服务
|
||||
蓝奏云-奶牛快传的直链解析的API服务
|
||||
|
||||
示例:
|
||||
```
|
||||
// 解析并重定向到直链
|
||||
###
|
||||
# @no-redirect
|
||||
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
|
||||
|
||||
// Rest请求(只提供共享文件Id): cow 奶牛快传; lz 蓝奏云
|
||||
###
|
||||
# @no-redirect
|
||||
GET http://127.0.0.1:6400/cow/9a644fe3e3a748
|
||||
|
||||
// 解析返回json直链
|
||||
###
|
||||
GET http://127.0.0.1:6400/json/cow/9a644fe3e3a748
|
||||
###
|
||||
GET http://127.0.0.1:6400/json/lz/ia2cntg
|
||||
|
||||
```
|
||||
|
||||
TODO:
|
||||
解析蓝奏云加密链接
|
||||
|
||||
|
||||
@@ -66,28 +66,10 @@
|
||||
<groupId>io.vertx</groupId>
|
||||
<artifactId>vertx-service-proxy</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.vertx</groupId>
|
||||
<artifactId>vertx-jdbc-client</artifactId>
|
||||
</dependency>
|
||||
<!-- SQL模板 -->
|
||||
<dependency>
|
||||
<groupId>io.vertx</groupId>
|
||||
<artifactId>vertx-sql-client-templates</artifactId>
|
||||
</dependency>
|
||||
<!-- jwt鉴权 -->
|
||||
<dependency>
|
||||
<groupId>io.vertx</groupId>
|
||||
<artifactId>vertx-auth-jwt</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.vertx</groupId>
|
||||
<artifactId>vertx-web-proxy</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.vertx</groupId>
|
||||
<artifactId>vertx-stomp</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.reflections</groupId>
|
||||
<artifactId>reflections</artifactId>
|
||||
|
||||
File renamed without changes.
@@ -9,7 +9,7 @@
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<version>0.0.1</version>
|
||||
<artifactId>web</artifactId>
|
||||
<artifactId>lz-cow-api-web</artifactId>
|
||||
|
||||
<properties>
|
||||
<packageDirectory>${project.basedir}/target/package</packageDirectory>
|
||||
File renamed without changes.
File renamed without changes.
+1
-17
@@ -24,22 +24,6 @@ public class DefaultInterceptor implements Interceptor, BaseHttpApi {
|
||||
|
||||
@Override
|
||||
public void handle(RoutingContext ctx) {
|
||||
|
||||
// 判断是否忽略
|
||||
if (CommonUtil.matchRegList(ignores.getList(), ctx.request().path())) {
|
||||
ctx.next();
|
||||
return;
|
||||
}
|
||||
// 执行拦截
|
||||
val token = ctx.request().getHeader("token");
|
||||
|
||||
|
||||
LocalMap<String, String> tokenMap = SharedDataUtil.getLocalMapWithCast("token");
|
||||
if (token != null && tokenMap != null && tokenMap.containsKey(token)) {
|
||||
VertxHolder.getVertxInstance().getOrCreateContext().put("username", tokenMap.get(token));
|
||||
ctx.next();
|
||||
} else {
|
||||
fireJsonResponse(ctx, JsonResult.error("没有权限", 401));
|
||||
}
|
||||
ctx.next();
|
||||
}
|
||||
}
|
||||
-5
@@ -1,10 +1,7 @@
|
||||
package cn.qaiu.lz.common.model;
|
||||
|
||||
import io.vertx.codegen.annotations.DataObject;
|
||||
import io.vertx.codegen.format.SnakeCase;
|
||||
import io.vertx.core.json.JsonObject;
|
||||
import io.vertx.sqlclient.templates.annotations.ParametersMapped;
|
||||
import io.vertx.sqlclient.templates.annotations.RowMapped;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@@ -16,8 +13,6 @@ import java.io.Serializable;
|
||||
* <br>Create date 2021/7/22 3:34
|
||||
*/
|
||||
@DataObject
|
||||
@RowMapped(formatter = SnakeCase.class)
|
||||
@ParametersMapped(formatter = SnakeCase.class)
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class MyData implements Serializable {
|
||||
-5
@@ -2,10 +2,7 @@ package cn.qaiu.lz.common.model;
|
||||
|
||||
import cn.qaiu.lz.common.ToJson;
|
||||
import io.vertx.codegen.annotations.DataObject;
|
||||
import io.vertx.codegen.format.SnakeCase;
|
||||
import io.vertx.core.json.JsonObject;
|
||||
import io.vertx.sqlclient.templates.annotations.ParametersMapped;
|
||||
import io.vertx.sqlclient.templates.annotations.RowMapped;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -20,8 +17,6 @@ import lombok.NoArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@DataObject
|
||||
@RowMapped(formatter = SnakeCase.class)
|
||||
@ParametersMapped(formatter = SnakeCase.class)
|
||||
public class UserInfo implements ToJson {
|
||||
|
||||
private String username;
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,82 @@
|
||||
package cn.qaiu.lz.common.util;
|
||||
|
||||
import cn.qaiu.vx.core.util.CastUtil;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import io.vertx.core.http.HttpClient;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jsoup.Jsoup;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author <a href="https://qaiu.top">QAIU</a>
|
||||
* @date 2023/4/21 21:19
|
||||
*/
|
||||
@Slf4j
|
||||
public class CowTool {
|
||||
/*
|
||||
First request:
|
||||
{
|
||||
"code": "0000",
|
||||
"message": "success",
|
||||
"data": {
|
||||
"guid": "e4f41b51-b5da-4f60-9312-37aa10c0aad7",
|
||||
"firstFile": {
|
||||
"id": "23861191276513345",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Then request:
|
||||
{
|
||||
"code": "0000",
|
||||
"message": "success",
|
||||
"tn": "TN:DE0E092E8A464521983780FBA21D0CD3",
|
||||
"data": {
|
||||
"downloadUrl": "https://download.cowcs.com..."
|
||||
}
|
||||
}
|
||||
*/
|
||||
public static String parse(String fullUrl) throws IOException {
|
||||
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)
|
||||
.get()
|
||||
.text();
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
Map<String, Object> map = objectMapper.readValue(result, new TypeReference<>() {
|
||||
});
|
||||
|
||||
if ("success".equals(map.get("message")) && map.containsKey("data")) {
|
||||
Map<String, Object> data = CastUtil.cast(map.get("data"));
|
||||
String guid = data.get("guid").toString();
|
||||
Map<String, Object> firstFile = CastUtil.cast(data.get("firstFile"));
|
||||
String fileId = firstFile.get("id").toString();
|
||||
String result2 = Jsoup
|
||||
.connect(baseUrl + "/download?transferGuid=" + guid + "&fileId=" + fileId)
|
||||
.ignoreContentType(true)
|
||||
.get()
|
||||
.text();
|
||||
Map<String, Object> map2 = objectMapper.readValue(result2, new TypeReference<>() {
|
||||
});
|
||||
|
||||
if ("success".equals(map2.get("message")) && map2.containsKey("data")) {
|
||||
Map<String, Object> data2 = CastUtil.cast(map2.get("data"));
|
||||
String downloadUrl = data2.get("downloadUrl").toString();
|
||||
if (StringUtils.isNotEmpty(downloadUrl)) {
|
||||
log.info("cow parse success: {}", downloadUrl);
|
||||
return downloadUrl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
log.info("Cow parse field------------->end");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+3
-3
@@ -52,7 +52,7 @@ public class LzTool {
|
||||
.userAgent(userAgent)
|
||||
.get()
|
||||
.html();
|
||||
System.out.println(result);
|
||||
// System.out.println(result);
|
||||
Matcher matcher = Pattern.compile("'[\\w]+_c_c'").matcher(result);
|
||||
Map<String, String> params = new LinkedHashMap<>();
|
||||
if (matcher.find()) {
|
||||
@@ -60,7 +60,7 @@ public class LzTool {
|
||||
params.put("action", "downprocess");
|
||||
params.put("sign", sn);
|
||||
params.put("ves", "1");
|
||||
System.out.println(sn);
|
||||
// System.out.println(sn);
|
||||
|
||||
} else {
|
||||
throw new IOException();
|
||||
@@ -76,7 +76,7 @@ public class LzTool {
|
||||
.replace("\\", "");
|
||||
//json转为map
|
||||
params = new ObjectMapper().readValue(result, new TypeReference<Map<String, String>>() {});
|
||||
System.out.println(params);
|
||||
// System.out.println(params);
|
||||
//通过json的数据拼接出最终的URL发起第最终请求,并得到响应信息头
|
||||
url = params.get("dom") + "/file/" + params.get("url");
|
||||
Map<String, String> headers = Jsoup.connect(url)
|
||||
File renamed without changes.
@@ -0,0 +1,80 @@
|
||||
package cn.qaiu.lz.web.http;
|
||||
|
||||
import cn.qaiu.lz.common.util.CowTool;
|
||||
import cn.qaiu.lz.common.util.LzTool;
|
||||
import cn.qaiu.lz.web.model.RealUser;
|
||||
import cn.qaiu.lz.web.service.UserService;
|
||||
import cn.qaiu.vx.core.annotaions.RouteHandler;
|
||||
import cn.qaiu.vx.core.annotaions.RouteMapping;
|
||||
import cn.qaiu.vx.core.enums.RouteMethod;
|
||||
import cn.qaiu.vx.core.model.JsonResult;
|
||||
import cn.qaiu.vx.core.util.AsyncServiceUtil;
|
||||
import io.vertx.core.Future;
|
||||
import io.vertx.core.http.HttpServerResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 服务API
|
||||
* <br>Create date 2021/4/28 9:15
|
||||
*
|
||||
* @author <a href="https://qaiu.top">QAIU</a>
|
||||
*/
|
||||
@Slf4j
|
||||
@RouteHandler("/")
|
||||
public class ServerApi {
|
||||
|
||||
private final UserService userService = AsyncServiceUtil.getAsyncServiceInstance(UserService.class);
|
||||
|
||||
@RouteMapping(value = "/login", method = RouteMethod.POST)
|
||||
public Future<String> login(RealUser user) {
|
||||
log.info("<------- login: {}", user.getUsername());
|
||||
return userService.login(user);
|
||||
}
|
||||
|
||||
@RouteMapping(value = "/test2", method = RouteMethod.GET)
|
||||
public JsonResult<String> test01() {
|
||||
return JsonResult.data("ok");
|
||||
}
|
||||
|
||||
@RouteMapping(value = "/parse", method = RouteMethod.GET)
|
||||
public void parse(HttpServerResponse response, String url) throws Exception {
|
||||
if (url.contains("lanzou")) {
|
||||
String urlDownload = LzTool.parse(url);
|
||||
log.info("url = {}", urlDownload);
|
||||
response.putHeader("location", urlDownload).setStatusCode(302).end();
|
||||
} else if (url.contains("cowtransfer.com")) {
|
||||
String urlDownload = CowTool.parse(url);
|
||||
response.putHeader("location", urlDownload).setStatusCode(302).end();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@RouteMapping(value = "/lz/:id", method = RouteMethod.GET)
|
||||
public void lzParse(HttpServerResponse response, String id) throws Exception {
|
||||
String url = "https://wwa.lanzoux.com/" + id;
|
||||
String urlDownload = LzTool.parse(url);
|
||||
log.info("url = {}", urlDownload);
|
||||
response.putHeader("location", urlDownload).setStatusCode(302).end();
|
||||
}
|
||||
|
||||
@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 urlDownload = CowTool.parse(url);
|
||||
response.putHeader("location", urlDownload).setStatusCode(302).end();
|
||||
}
|
||||
|
||||
@RouteMapping(value = "/json/lz/:id", method = RouteMethod.GET)
|
||||
public JsonResult<String> lzParseJson(HttpServerResponse response, String id) throws Exception {
|
||||
String url = "https://wwa.lanzoux.com/" + id;
|
||||
String urlDownload = LzTool.parse(url);
|
||||
log.info("url = {}", urlDownload);
|
||||
return JsonResult.data(urlDownload);
|
||||
}
|
||||
|
||||
@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;
|
||||
return JsonResult.data(CowTool.parse(url));
|
||||
}
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,31 @@
|
||||
###
|
||||
GET http://127.0.0.1:6400/api/serverApi/test3?fullUrl=https://wwp.lanzoux.com/iNvid035jgcb
|
||||
###
|
||||
# @no-redirect
|
||||
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
|
||||
###
|
||||
# @no-redirect
|
||||
GET http://127.0.0.1:6400/cow/9a644fe3e3a748
|
||||
|
||||
###
|
||||
GET http://127.0.0.1:6400/lz/ia2cntg
|
||||
###
|
||||
GET http://127.0.0.1:6400/json/lz/ia2cntg
|
||||
|
||||
|
||||
###
|
||||
https://cowtransfer.com/core/api/transfer/share?uniqueUrl=9a644fe3e3a748
|
||||
|
||||
###
|
||||
https://cowtransfer.com/core/api/transfer/share?uniqueUrl=e4f41b51b5da4f
|
||||
|
||||
###
|
||||
https://cowtransfer.com/core/api/transfer/share/download?transferGuid=e4f41b51-b5da-4f60-9312-37aa10c0aad7&fileId=23861191276513345
|
||||
|
||||
|
||||
//https://download.cowcs.com/cowtransfer/cowtransfer/29188/db32e132e69f490eb4a343b398990f4b.docx?auth_key=1682111861-7b9579fbebb84aaba6bca368d083ab12-0-cbf009f3ffbcbb86191b8cdbc103abce&biz_type=1&business_code=COW_TRANSFER&channel_code=COW_CN_WEB&response-content-disposition=attachment%3B%20filename%3D05-CGB-DB-MENU-V1.02.docx%3Bfilename*%3Dutf-8%27%2705-CGB-DB-MENU-V1.02.docx&user_id=1023860921943729188&x-verify=1
|
||||
|
||||
|
||||
File renamed without changes.
@@ -1,7 +1,7 @@
|
||||
# 服务配置
|
||||
server:
|
||||
port: 6400
|
||||
contextPath: /api
|
||||
contextPath: /
|
||||
enableStaticHtmlService: false
|
||||
staticResourcePath: webroot/
|
||||
# 反向代理服务器配置路径(不用加后缀)
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,66 @@
|
||||
package cn.qaiu.web.test;
|
||||
|
||||
import cn.qaiu.vx.core.util.CastUtil;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author <a href="https://qaiu.top">QAIU</a>
|
||||
* @date 2023/4/21 21:43
|
||||
*/
|
||||
@Slf4j
|
||||
public class TestJsoup {
|
||||
/*
|
||||
|
||||
|
||||
|
||||
2023-04-21 21:52:56.401 INFO -> [ main] cn.qaiu.web.test.TestJsoup :
|
||||
{code=0000, message=success, tn=TN:19387A43A5564BB6B52B008071DD69B2,
|
||||
data={payEnabled=false, payStatus=false, skuId=null, skuPrice=null,
|
||||
guid=e4f41b51-b5da-4f60-9312-37aa10c0aad7, transferName=05-CGB-DB-MENU-V1.02,
|
||||
transferMessage=null, uniqueUrl=e4f41b51b5da4f, needPassword=false,
|
||||
expireAt=2099-12-31 23:59:59, validDays=-1, enableDownload=true, enablePreview=true, enableSaveto=true,
|
||||
uploadState=1, deleted=false, tag=1, dataTag=1, status=0, fileAmount=1, folderAmount=0, size=962041, openId=1023860921943729188,
|
||||
firstFile={id=23861191276513345, owner=1023860921943729188, recycle=false, need_pro=false, storage_class=standard, file_type=document, analysis_status=2, audit_status=2, repository_id=2004556995, created_at=1682081417000, created_by=1023860921943729188, updated_at=1682081416968, folder_id=2013607944, folder_name=, file_info={format=docx, size=962041, title=05-CGB-DB-MENU-V1.02, description=, preview={ext={"ratio":3}, height=2525, url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/82ff6da4-67f9-4cdb-8495-24bcd97cd6ab69566.png?auth_key=1682099544-1f494837775a422d82f4e67006c720c1-0-0d1cc615dd3e5b7a900b75fc5f7edf21, width=1785}, colors=[], origin_url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/db32e132e69f490eb4a343b398990f4b.docx?auth_key=1682099544-d71aa67f5af843cba64a5dfff9ec3357-0-ec3e3325421d8f858c4a3cb33139553c, theme_color=, extend_previews=[{ext={"ratio":1}, height=0, url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/312b7270-106a-480d-9deb-49df4c6539b069567.png?auth_key=1682099544-695f3060762c474d8312efc8205b85e3-0-a80564c120ff26c276cce769f091e9fa, width=0}, {ext={"ratio":1}, height=0, url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/6322a6a9-d1ea-4904-ada0-a0cfe504b32e69568.png?auth_key=1682099544-04e62f12cca94ad5a8f86c922d76b2f3-0-6efc5315f539691b378be42757a6d9f1, width=0}, {ext={"ratio":1}, height=0, url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/f6f37eb4-0be8-41e6-b362-07e2331237f369569.png?auth_key=1682099544-c28fd4178f9541938136ece965e8c6f0-0-71a0d0b9a7b7ea16be8d76294987ca48, width=0}, {ext={"ratio":1}, height=0, url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/f0f3d05d-7597-4235-b41d-2beb79fee1c869570.png?auth_key=1682099544-49825346ee864edfa855c05f65e11cdc-0-c511e3c9d18bb88a1044dc374f53b5e3, width=0}, {ext={"ratio":1}, height=0, url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/a85999d4-007e-4b68-882a-3f5ac593b6ce69571.png?auth_key=1682099544-898de7bce2a44413a297ec455a628f41-0-80f2b0bbcd4979e0c341ae629681825f, width=0}, {ext={"ratio":1}, height=0, url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/725f22ae-b7d3-4447-9408-df1da9a9c1bd69572.png?auth_key=1682099544-5b0b2f6b640a4e44936cacfbf1907d9c-0-8d0a7568bb13a93c0cb020f7f2498028, width=0}, {ext={"ratio":1}, height=0, url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/427cf5da-8d67-41b3-a429-37e8f3cc96b069573.png?auth_key=1682099544-fe5f7595fc0748868de59c19139dff3d-0-0078c6a395a89afdeef23df934636665, width=0}, {ext={"ratio":1}, height=0, url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/e2f489d3-7b28-4d9b-af0c-cbcc0e71fb3469574.png?auth_key=1682099544-85e4592f24e840f59ac0b5e51e39eb97-0-7211f254968e80f34680b530f06120d8, width=0}, {ext={"ratio":1}, height=0, url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/f885435e-2758-4dec-90e0-c7f6d55b8bff69575.png?auth_key=1682099544-96df86e45e5a4b02a1bd6197c292fe53-0-7d0af45b70b7e55ab383d0019a1dc5cd, width=0}, {ext={"ratio":1}, height=0, url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/f1570313-64ec-4547-9e9c-0af154cd8dc469576.png?auth_key=1682099544-4218db8e98f541a2ad8ad717958cc859-0-588626b81c407d1150319b4d76e2069b, width=0}, {ext={"ratio":1}, height=0, url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/7d9e7d47-a874-4c45-9bba-0687d2b4b36c69577.png?auth_key=1682099544-9322e74bc4694be386cc284ee1e4991a-0-2734f9d25bdee992255f0d410a57ad42, width=0}, {ext={"ratio":1}, height=0, url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/7a58264c-0b8d-4737-99e6-c336c59d5e9e69578.png?auth_key=1682099544-e80940a49de5408da1906bde7aeaadb9-0-0c471dc965e28fd7d8b12ce5a8d98317, width=0}, {ext={"ratio":1}, height=0, url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/fc452796-048e-4926-85cf-ec9fc62fd50369579.png?auth_key=1682099544-3fb431425b07484dae2479b6488ee1df-0-cfeecc56fb2cf5ca2a9148de3581056e, width=0}, {ext={"ratio":1}, height=0, url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/5aa0b694-b420-43b3-b0bd-616e34c7a84269580.png?auth_key=1682099544-00a8b57aeeb6436a82abcd44d027345c-0-9d7bc1319e4cbefa8017eaa7504f6ef7, width=0}, {ext={"ratio":1}, height=0, url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/e4d9be2e-00be-45f1-a6f2-e78e8aa9405469581.png?auth_key=1682099544-388d1436290e4cdca82a0852ba55c005-0-526df026b1359fe1d031b7ea2429d115, width=0}, {ext={"ratio":1}, height=0, url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/7878c6e6-8983-4ef4-9bc5-f0b6c40fbc3869582.png?auth_key=1682099544-a288c1b2f78945d3a2298d5b9a7806cd-0-2ee0cb7aeb8dac5a5dcd5a5e98a0dc4a, width=0}, {ext={"ratio":1}, height=0, url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/86b9fe4c-fd0b-4c66-9ca6-d7756573c7d769583.png?auth_key=1682099544-2d3022ff607840cd920c6ed6e8192718-0-d118921ce6d6332292836080105df7d4, width=0}, {ext={"ratio":1}, height=0, url=https://download.cowcs.com/cowtransfer/cowtransfer/29188/1347bd4c-67ee-44e4-a8c7-2732422de33769584.png?auth_kLine truncated
|
||||
与目标 VM 断开连接, 地址为: ''127.0.0.1:57249',传输: '套接字''
|
||||
*/
|
||||
@Test
|
||||
public void test1() throws IOException {
|
||||
String baseUrl = "https://cowtransfer.com/core/api/transfer/share";
|
||||
String result = Jsoup
|
||||
.connect(baseUrl+"?uniqueUrl=e4f41b51b5da4").ignoreContentType(true)
|
||||
.get()
|
||||
.text();
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
Map<String, Object> map = objectMapper.readValue(result, new TypeReference<>() {});
|
||||
if ("success".equals(map.get("message")) && map.containsKey("data")) {
|
||||
Map<String, Object> data = CastUtil.cast(map.get("data"));
|
||||
String guid = data.get("guid").toString();
|
||||
Map<String, Object> firstFile = CastUtil.cast(data.get("firstFile"));
|
||||
String fileId = firstFile.get("id").toString();
|
||||
String result2 = Jsoup
|
||||
.connect(baseUrl+"/download?transferGuid="+guid+"&fileId="+fileId)
|
||||
.ignoreContentType(true)
|
||||
.get()
|
||||
.text();
|
||||
Map<String, Object> map2 = objectMapper.readValue(result2, new TypeReference<>() {});
|
||||
|
||||
if ("success".equals(map2.get("message")) && map2.containsKey("data")) {
|
||||
Map<String, Object> data2 = CastUtil.cast(map2.get("data"));
|
||||
String downloadUrl = data2.get("downloadUrl").toString();
|
||||
if (StringUtils.isNotEmpty(downloadUrl)) {
|
||||
log.info(downloadUrl);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
log.info("OK------------->end");
|
||||
}
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
@@ -11,7 +11,7 @@
|
||||
|
||||
<modules>
|
||||
<module>core</module>
|
||||
<module>web</module>
|
||||
<module>lz-cow-api-web</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
@@ -19,7 +19,7 @@
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<vertx.version>4.1.3</vertx.version>
|
||||
<packageDirectory>${project.basedir}/web/target/package</packageDirectory>
|
||||
<packageDirectory>${project.basedir}/lz-cow-api-web/target/package</packageDirectory>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
package cn.qaiu.lz.web.http;
|
||||
|
||||
import cn.qaiu.lz.common.util.LzTool;
|
||||
import cn.qaiu.lz.web.model.RealUser;
|
||||
import cn.qaiu.lz.web.service.UserService;
|
||||
import cn.qaiu.vx.core.annotaions.RouteHandler;
|
||||
import cn.qaiu.vx.core.annotaions.RouteMapping;
|
||||
import cn.qaiu.vx.core.enums.RouteMethod;
|
||||
import cn.qaiu.vx.core.model.JsonResult;
|
||||
import cn.qaiu.vx.core.util.AsyncServiceUtil;
|
||||
import io.vertx.core.Future;
|
||||
import io.vertx.core.http.HttpServerResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 服务API
|
||||
* <br>Create date 2021/4/28 9:15
|
||||
*
|
||||
* @author <a href="https://qaiu.top">QAIU</a>
|
||||
*/
|
||||
@Slf4j
|
||||
@RouteHandler("serverApi")
|
||||
public class ServerApi {
|
||||
|
||||
private final UserService userService = AsyncServiceUtil.getAsyncServiceInstance(UserService.class);
|
||||
|
||||
@RouteMapping(value = "/login", method = RouteMethod.POST)
|
||||
public Future<String> login(RealUser user) {
|
||||
log.info("<------- login: {}", user.getUsername());
|
||||
return userService.login(user);
|
||||
}
|
||||
|
||||
@RouteMapping(value = "/test2", method = RouteMethod.GET)
|
||||
public JsonResult<String> test01() {
|
||||
return JsonResult.data("ok");
|
||||
}
|
||||
|
||||
@RouteMapping(value = "/test3", method = RouteMethod.GET)
|
||||
public void test03(HttpServerResponse response, String fullUrl) throws Exception {
|
||||
String url = LzTool.parse(fullUrl);
|
||||
log.info("url = {}", url);
|
||||
|
||||
response.putHeader("location", "http://baidu.com").setStatusCode(302).end();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
###
|
||||
GET http://127.0.0.1:6400/api/serverApi/test3?fullUrl=https://wwp.lanzoux.com/iNvid035jgcb
|
||||
###
|
||||
GET http://127.0.0.1:6400/api/serverApi/test3?fullUrl=https://lanzoux.com/ia2cntg
|
||||
@@ -1,42 +0,0 @@
|
||||
package cn.qaiu.web.test;
|
||||
|
||||
import io.vertx.core.Future;
|
||||
import io.vertx.core.Vertx;
|
||||
import io.vertx.core.http.HttpServer;
|
||||
import io.vertx.core.http.HttpServerOptions;
|
||||
import io.vertx.ext.stomp.StompServer;
|
||||
import io.vertx.ext.stomp.StompServerHandler;
|
||||
import io.vertx.ext.stomp.StompServerOptions;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* lz-web
|
||||
* <p>create 2021/9/18 12:10</p>
|
||||
*
|
||||
* @author <a href="https://qaiu.top">QAIU</a>
|
||||
*/
|
||||
public class StompTest {
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Vertx vertx = Vertx.vertx();
|
||||
|
||||
StompServer stompServer = StompServer.create(vertx, new StompServerOptions()
|
||||
.setPort(-1) // 禁用 tcp 端口,这一项是可选的
|
||||
.setWebsocketBridge(true) // 开启 websocket 支持
|
||||
.setWebsocketPath("/stomp")) // 配置 websocket 路径,默认是 /stomp
|
||||
.handler(StompServerHandler.create(vertx));
|
||||
Future<HttpServer> http = vertx.createHttpServer(
|
||||
new HttpServerOptions().setWebSocketSubProtocols(Arrays.asList("v10.stomp", "v11.stomp"))
|
||||
)
|
||||
.webSocketHandler(stompServer.webSocketHandler())
|
||||
.listen(8080);
|
||||
http.onSuccess(res->{
|
||||
System.out.println("okk");
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user