mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2025-12-16 04:13:03 +00:00
115pan分享识别优化
This commit is contained in:
@@ -117,7 +117,7 @@ public enum PanDomainTemplate {
|
||||
"https://www.dropbox.com/scl/fi/{shareKey}/?rlkey={pwd}&dl=0",
|
||||
PdbTool.class),
|
||||
P115("115网盘",
|
||||
compile("https://(115|anxia).com/s/(?<KEY>\\w+)(\\?password=(?<PWD>\\w+))?"),
|
||||
compile("https://(115|anxia).com/s/(?<KEY>\\w+)(\\?password=(?<PWD>\\w+))?(&.+)?"),
|
||||
"https://115.com/s/{shareKey}?password={pwd}",
|
||||
P115Tool.class),
|
||||
// =====================音乐类解析 分享链接标志->MxxS (单歌曲/普通音质)==========================
|
||||
|
||||
@@ -2,7 +2,9 @@ package cn.qaiu.parser.impl;
|
||||
|
||||
import cn.qaiu.entity.ShareLinkInfo;
|
||||
import cn.qaiu.parser.PanBase;
|
||||
import cn.qaiu.util.HeaderUtils;
|
||||
import io.vertx.core.Future;
|
||||
import io.vertx.core.MultiMap;
|
||||
import io.vertx.uritemplate.UriTemplate;
|
||||
|
||||
/**
|
||||
@@ -12,6 +14,24 @@ public class PvyyTool extends PanBase {
|
||||
private static final String API_URL_PREFIX1 = "https://www.vyuyun.com/apiv1/share/file/{key}?password={pwd}";
|
||||
private static final String API_URL_PREFIX2 = "https://www.vyuyun.com/apiv1/share/getShareDownUrl/{key}/{id}?password={pwd}";
|
||||
|
||||
|
||||
private static final MultiMap header = HeaderUtils.parseHeaders("""
|
||||
accept-language: zh-CN,zh;q=0.9,en;q=0.8
|
||||
cache-control: no-cache
|
||||
dnt: 1
|
||||
origin: https://www.vyuyun.com
|
||||
pragma: no-cache
|
||||
priority: u=1, i
|
||||
referer: https://www.vyuyun.com/
|
||||
sec-ch-ua: "Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"
|
||||
sec-ch-ua-mobile: ?0
|
||||
sec-ch-ua-platform: "Windows"
|
||||
sec-fetch-dest: empty
|
||||
sec-fetch-mode: cors
|
||||
sec-fetch-site: same-site
|
||||
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
|
||||
""");
|
||||
|
||||
public PvyyTool(ShareLinkInfo shareLinkInfo) {
|
||||
super(shareLinkInfo);
|
||||
}
|
||||
@@ -21,7 +41,7 @@ public class PvyyTool extends PanBase {
|
||||
client.getAbs(UriTemplate.of(API_URL_PREFIX1))
|
||||
.setTemplateParam("key", shareLinkInfo.getShareKey())
|
||||
.setTemplateParam("pwd", shareLinkInfo.getSharePassword())
|
||||
.putHeader("referer", "https://www.vyuyun.com")
|
||||
.putHeaders(header)
|
||||
.send().onSuccess(res -> {
|
||||
try {
|
||||
String id = asJson(res).getJsonObject("data").getJsonObject("data").getString("id");
|
||||
@@ -30,8 +50,7 @@ public class PvyyTool extends PanBase {
|
||||
.setTemplateParam("key", shareLinkInfo.getShareKey())
|
||||
.setTemplateParam("pwd", shareLinkInfo.getSharePassword())
|
||||
.setTemplateParam("id", id)
|
||||
.putHeader("referer", "https://www.vyuyun.com")
|
||||
.send().onSuccess(res2 -> {
|
||||
.putHeaders(header).send().onSuccess(res2 -> {
|
||||
try {
|
||||
// data->downInfo->url
|
||||
String url =
|
||||
|
||||
35
parser/src/main/java/cn/qaiu/util/HeaderUtils.java
Normal file
35
parser/src/main/java/cn/qaiu/util/HeaderUtils.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package cn.qaiu.util;
|
||||
|
||||
import io.vertx.core.MultiMap;
|
||||
|
||||
public class HeaderUtils {
|
||||
|
||||
/**
|
||||
* 将请求头字符串转换为Vert.x的MultiMap对象
|
||||
*
|
||||
* @param headerString 请求头字符串
|
||||
* @return MultiMap对象
|
||||
*/
|
||||
public static MultiMap parseHeaders(String headerString) {
|
||||
MultiMap headers = MultiMap.caseInsensitiveMultiMap();
|
||||
|
||||
if (headerString == null || headerString.isEmpty()) {
|
||||
return headers;
|
||||
}
|
||||
|
||||
// 按行分割字符串
|
||||
String[] lines = headerString.split("\n");
|
||||
|
||||
for (String line : lines) {
|
||||
// 按冒号分割键值对
|
||||
String[] parts = line.split(":", 2);
|
||||
if (parts.length == 2) {
|
||||
String key = parts[0].trim();
|
||||
String value = parts[1].trim();
|
||||
headers.add(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
return headers;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user