Skip to content

Commit 01d59e3

Browse files
committed
add 超星盘,360盘
1 parent fece279 commit 01d59e3

File tree

8 files changed

+182
-3
lines changed

8 files changed

+182
-3
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ main分支依赖JDK17, 提供了JDK11分支[main-jdk11](https://github.com/qaiu/
5050
- [QQ音乐分享链接-mqqs](https://y.qq.com)
5151
- 咪咕音乐分享链接(开发中)
5252
- [Cloudreve自建网盘-ce](https://github.com/cloudreve/Cloudreve)
53-
- [微雨云存储-pvvy](https://www.vyuyun.com/)
53+
- ~[微雨云存储-pvvy](https://www.vyuyun.com/)~
54+
- [超星云盘(需要referer: https://pan-yz.chaoxing.com)-pcx](https://pan-yz.chaoxing.com)
55+
- [360云盘(需要referer: https://link.yunpan.com/)-pcx](https://yunpan.com)
5456
- Google云盘-pgd
5557
- Onedrive-pod
5658
- Dropbox-pdp

core/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
<properties>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
<maven.build.timestamp.format>yyMMdd_HHmm</maven.build.timestamp.format>
1516
</properties>
1617

1718
<dependencies>

core/src/main/java/cn/qaiu/vx/core/util/CommonUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public static String getAppVersion() {
149149
try {
150150
properties.load(CommonUtil.class.getClassLoader().getResourceAsStream("app.properties"));
151151
if (!properties.isEmpty()) {
152-
appVersion = properties.getProperty("app.version");
152+
appVersion = properties.getProperty("app.version") + "build" + properties.getProperty("build");
153153
}
154154
} catch (IOException e) {
155155
e.printStackTrace();
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
app.version=${project.version}
2+
build=${maven.build.timestamp}

parser/src/main/java/cn/qaiu/parser/PanDomainTemplate.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,17 @@ public enum PanDomainTemplate {
127127
compile("https://(115|anxia).com/s/(?<KEY>\\w+)(\\?password=(?<PWD>\\w+))?([&#].*)?"),
128128
"https://115.com/s/{shareKey}?password={pwd}",
129129
P115Tool.class),
130+
// 链接:https://www.yunpan.com/surl_yD7wz4VgU9v(提取码:fc70)
131+
P360("360云盘(需要referer头)",
132+
compile("https://www\\.yunpan\\.com/(?<KEY>\\w+)"),
133+
"https://www.yunpan.com/{shareKey}",
134+
P360Tool.class),
135+
136+
// https://pan-yz.cldisk.com/external/m/file/953658049102462976
137+
Pcx("超星云盘(需要referer头)",
138+
compile("https://pan-yz\\.cldisk\\.com/external/m/file/(?<KEY>\\w+)"),
139+
"https://pan-yz.cldisk.com/external/m/file/{shareKey}",
140+
PcxTool.class),
130141
// =====================音乐类解析 分享链接标志->MxxS (单歌曲/普通音质)==========================
131142
// http://163cn.tv/xxx
132143
MNES("网易云音乐分享",
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
package cn.qaiu.parser.impl;
2+
3+
import cn.qaiu.entity.ShareLinkInfo;
4+
import cn.qaiu.parser.PanBase;
5+
import io.vertx.core.Future;
6+
import io.vertx.core.buffer.Buffer;
7+
import io.vertx.core.json.JsonObject;
8+
9+
import java.util.concurrent.atomic.AtomicReference;
10+
import java.util.regex.Matcher;
11+
import java.util.regex.Pattern;
12+
13+
/**
14+
* <a href="https://yunpan.360.cn">360AI云盘</a>
15+
* 360AI云盘解析
16+
* 下载链接需要Referer: https://link.yunpan.com/
17+
*/
18+
public class P360Tool extends PanBase {
19+
public P360Tool(ShareLinkInfo shareLinkInfo) {
20+
super(shareLinkInfo);
21+
}
22+
23+
public Future<String> parse() {
24+
// https://www.yunpan.com/surl_yD7jK9d4W6D 获取302跳转地址
25+
clientNoRedirects.getAbs(shareLinkInfo.getShareUrl()).send()
26+
.onSuccess(res -> {
27+
String location = res.getHeader("Location");
28+
if (location != null) {
29+
down302(location);
30+
} else {
31+
fail();
32+
}
33+
}).onFailure(handleFail(""));
34+
35+
36+
return future();
37+
}
38+
39+
private void down302(String url) {
40+
// 获取URL前缀 https://214004.link.yunpan.com/lk/surl_yD7ZU4WreR8 -> https://214004.link.yunpan.com/
41+
String urlPrefix = url.substring(0, url.indexOf("/", 8));
42+
43+
clientSession.getAbs(url)
44+
.send()
45+
.onSuccess(res -> {
46+
// find "nid": "17402043311959599"
47+
Pattern compile = Pattern.compile("\"nid\": \"([^\"]+)\"");
48+
Matcher matcher = compile.matcher(res.bodyAsString());
49+
AtomicReference<String> nid = new AtomicReference<>();
50+
if (matcher.find()) {
51+
nid.set(matcher.group(1));
52+
} else {
53+
// 需要验证密码
54+
/*
55+
* POST https://4aec17.link.yunpan.com/share/verifyPassword
56+
* Content-type: application/x-www-form-urlencoded UTF-8
57+
* Referer: https://4aec17.link.yunpan.com/lk/surl_yD7jK9d4W6D
58+
*
59+
* shorturl=surl_yD7jK9d4W6D&linkpassword=d969
60+
*/
61+
clientSession.postAbs(urlPrefix + "/share/verifyPassword")
62+
.putHeader("Content-Type", "application/x-www-form-urlencoded")
63+
.putHeader("Referer", urlPrefix)
64+
.sendBuffer(Buffer.buffer("shorturl=" + shareLinkInfo.getShareKey() + "&linkpassword" +
65+
"=" + shareLinkInfo.getSharePassword()))
66+
.onSuccess(res2 -> {
67+
JsonObject entries = asJson(res2);
68+
if (entries.getInteger("errno") == 0) {
69+
clientSession.getAbs(url)
70+
.send()
71+
.onSuccess(res3 -> {
72+
Matcher matcher1 = compile.matcher(res3.bodyAsString());
73+
if (matcher1.find()) {
74+
nid.set(matcher1.group(1));
75+
} else {
76+
fail();
77+
return;
78+
}
79+
down(urlPrefix, nid.get());
80+
}).onFailure(handleFail(""));
81+
} else {
82+
fail(entries.encode());
83+
}
84+
}).onFailure(handleFail(""));
85+
return;
86+
}
87+
down(urlPrefix, nid.get());
88+
}).onFailure(handleFail(""));
89+
}
90+
91+
private void down(String urlPrefix, String nid) {
92+
clientSession.postAbs(urlPrefix + "/share/downloadfile")
93+
.putHeader("Content-Type", "application/x-www-form-urlencoded")
94+
.putHeader("Referer", urlPrefix)
95+
.sendBuffer(Buffer.buffer("shorturl=" + shareLinkInfo.getShareKey() + "&nid=" + nid))
96+
.onSuccess(res2 -> {
97+
JsonObject entries = asJson(res2);
98+
String downloadurl = entries.getJsonObject("data").getString("downloadurl");
99+
complete(downloadurl);
100+
}).onFailure(handleFail(""));
101+
}
102+
103+
// public static void main(String[] args) {
104+
// String s = new P360Tool(ShareLinkInfo.newBuilder().shareUrl("https://www.yunpan.com/surl_yD7ZU4WreR8")
105+
// .shareKey("surl_yD7ZU4WreR8")
106+
// .build()).parseSync();
107+
// System.out.println(s);
108+
// }
109+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package cn.qaiu.parser.impl;
2+
3+
import cn.qaiu.entity.ShareLinkInfo;
4+
import cn.qaiu.parser.PanBase;
5+
import io.vertx.core.Future;
6+
import io.vertx.core.MultiMap;
7+
import io.vertx.core.json.JsonObject;
8+
import io.vertx.uritemplate.UriTemplate;
9+
10+
/**
11+
* <a href="https://passport2.chaoxing.com">超星云盘</a>
12+
*/
13+
public class PcxTool extends PanBase {
14+
15+
public PcxTool(ShareLinkInfo shareLinkInfo) {
16+
super(shareLinkInfo);
17+
}
18+
19+
public Future<String> parse() {
20+
client.getAbs(shareLinkInfo.getShareUrl())
21+
.send().onSuccess(res -> {
22+
// 'download': 'https://d0.ananas.chaoxing.com/download/de08dcf546e4dd88a17bead86ff6338d?at_=1740211698795&ak_=d62a3acbd5ce43e1e8565b67990691e4&ad_=8c4ef22e980ee0dd9532ec3757ab19f8&fn=33.c'
23+
String body = res.bodyAsString();
24+
// 获取download
25+
String str = "var fileinfo = {";
26+
String fileInfo = res.bodyAsString().substring(res.bodyAsString().indexOf(str) + str.length() - 1
27+
, res.bodyAsString().indexOf("};") + 1);
28+
fileInfo = fileInfo.replace("'", "\"");
29+
JsonObject jsonObject = new JsonObject(fileInfo);
30+
String download = jsonObject.getString("download");
31+
if (download.contains("fn=")) {
32+
complete(download);
33+
} else {
34+
fail("获取下载链接失败: 不支持的文件类型: {}", jsonObject.getString("suffix"));
35+
}
36+
}).onFailure(handleFail(shareLinkInfo.getShareUrl()));
37+
return promise.future();
38+
}
39+
40+
41+
// public static void main(String[] args) {
42+
// String s = new PcxTool(ShareLinkInfo.newBuilder().shareUrl("https://pan-yz.cldisk.com/external/m/file/953658049102462976")
43+
// .shareKey("953658049102462976")
44+
// .build()).parseSync();
45+
// System.out.println(s);
46+
// }
47+
}

web-service/src/main/resources/http-tools/pan-cx.http

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,18 @@
22

33
### 直链 Referer 有效期似乎是永久 at=1717958244333 => 2024/6/10 2:37:24
44
https://d0.ananas.chaoxing.com/download/8e8c9baca640d24680d974331390a158?at_=1717958244333&ak_=783925f9ba6eb2d0c711977b777a13e0&ad_=58ffecd38be494bea68f0cda68b18c0a&fn=testgles.c
5-
Referer: https://pan-yz.chaoxing.com/external/m/file/1006748113111711744
5+
Referer: https://pan-yz.chaoxing.com/
66

77

88

99
###
1010
https://d0.ananas.chaoxing.com/download/ecf45b6d85a7e9d9d5f5ef33978c6f74?at_=1731411454916&ak_=12108e79795e73c6df0a75f5ea60fe2c&ad_=b6c289da3c6f6734b2262e8577364213
1111
Referer: https://pan-yz.chaoxing.com/external/m/file/1006748113111711744
12+
13+
###
14+
https://d0.ananas.chaoxing.com/download/3fe3ba9f6f2d1e9926b924c8268ca67d?at_=1740211468281&ak_=cc853b465206569f98a257674f8595a4&ad_=b5c27a9d86c298abc11220290a7dfde9&fn=wx_camera_1705290447091.jpg
15+
Referer: https://pan-yz.chaoxing.com/
16+
17+
###
18+
https://d0.ananas.chaoxing.com/download/8664a0b97110b49ca9e3ad024544649e?at_=1740211468281&ak_=cc853b465206569f98a257674f8595a4&ad_=b5c27a9d86c298abc11220290a7dfde9&fn=jdk17-jre-win-amd64.zip
19+
Referer: https://pan-yz.chaoxing.com/

0 commit comments

Comments
 (0)