-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 添加Cloudreve - 蓝奏云优享和小飞机规则修改
- Loading branch information
Showing
16 changed files
with
246 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package cn.qaiu.parser.impl; | ||
|
||
import cn.qaiu.parser.IPanTool; | ||
import cn.qaiu.parser.PanBase; | ||
import io.vertx.core.Future; | ||
import io.vertx.core.buffer.Buffer; | ||
import io.vertx.core.json.JsonObject; | ||
import io.vertx.ext.web.client.HttpRequest; | ||
|
||
import java.net.MalformedURLException; | ||
import java.net.URL; | ||
|
||
/** | ||
* <a href="https://github.com/cloudreve/Cloudreve">Cloudreve网盘解析</a> <br> | ||
* <a href="https://pan.xiaomuxi.cn">暮希云盘</a> <br> | ||
* <a href="https://pan.huang1111.cn">huang1111</a> <br> | ||
*/ | ||
public class CeTool extends PanBase implements IPanTool { | ||
|
||
private static final String DOWNLOAD_API_PATH = "/api/v3/share/download/"; | ||
|
||
// api/v3/share/info/g31PcQ?password=qaiu | ||
private static final String SHARE_API_PATH = "/api/v3/share/info/"; | ||
|
||
public CeTool(String key, String pwd) { | ||
super(key, pwd); | ||
} | ||
|
||
public Future<String> parse() { | ||
// https://pan.huang1111.cn/s/wDz5TK | ||
// https://pan.huang1111.cn/s/y12bI6 -> https://pan.huang1111 | ||
// .cn/api/v3/share/download/y12bI6?path=undefined%2Fundefined; | ||
// 类型解析 -> /ce/https_pan.huang1111.cn_s_wDz5TK | ||
// parser接口 -> /parser?url=https://pan.huang1111.cn/s/wDz5TK | ||
try { | ||
if (key.startsWith("https_") || key.startsWith("http_")) { | ||
key = key.replace("https_", "https://") | ||
.replace("http_", "http://") | ||
.replace("_", "/"); | ||
} | ||
// 处理URL | ||
URL url = new URL(key); | ||
String path = url.getPath(); | ||
String shareKey = path.substring(3); | ||
String downloadApiUrl = url.getProtocol() + "://" + url.getHost() + DOWNLOAD_API_PATH + shareKey + "?path" + | ||
"=undefined/undefined;"; | ||
String shareApiUrl = url.getProtocol() + "://" + url.getHost() + SHARE_API_PATH + shareKey; | ||
|
||
// 设置cookie | ||
HttpRequest<Buffer> httpRequest = clientSession.getAbs(shareApiUrl); | ||
if (pwd != null) { | ||
httpRequest.addQueryParam("password", pwd); | ||
} | ||
// 获取下载链接 | ||
httpRequest.send().onSuccess(res -> getDownURL(downloadApiUrl)).onFailure(handleFail(shareApiUrl)); | ||
} catch (MalformedURLException e) { | ||
fail(e, "URL解析错误"); | ||
} | ||
return promise.future(); | ||
} | ||
|
||
private void getDownURL(String apiUrl) { | ||
clientSession.putAbs(apiUrl).send().onSuccess(res -> { | ||
JsonObject jsonObject = res.bodyAsJsonObject(); | ||
System.out.println(jsonObject.encodePrettily()); | ||
if (jsonObject.containsKey("code") && jsonObject.getInteger("code") == 0) { | ||
promise.complete(jsonObject.getString("data")); | ||
} else { | ||
fail("JSON解析失败: {}", jsonObject.encodePrettily()); | ||
} | ||
}).onFailure(handleFail(apiUrl)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
### | ||
https://5jmpj3-my.sharepoint.com/personal/pan2_xiaomuxi_cn/_layouts/15/download.aspx?UniqueId=cf123281-44cd-4745-b3c3-49a18934044d&Translate=false&tempauth=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAvNWptcGozLW15LnNoYXJlcG9pbnQuY29tQGY4MTk4OWJiLWViNDAtNGZhYi05NzA5LTQ0ODFhMDM0ZjNiNCIsImlzcyI6IjAwMDAwMDAzLTAwMDAtMGZmMS1jZTAwLTAwMDAwMDAwMDAwMCIsIm5iZiI6IjE3MDY0MzIyNDciLCJleHAiOiIxNzA2NDM1ODQ3IiwiZW5kcG9pbnR1cmwiOiJNMWVwZ3VjamFKU081MXB4WW5IKzZ6bzZBQlVyc0N1T3MwOVRGbnZJVlRvPSIsImVuZHBvaW50dXJsTGVuZ3RoIjoiMTQ2IiwiaXNsb29wYmFjayI6IlRydWUiLCJjaWQiOiJKM0JzNzloTy8wYW1GZGh1WUFjTjR3PT0iLCJ2ZXIiOiJoYXNoZWRwcm9vZnRva2VuIiwic2l0ZWlkIjoiWkRkaVptRTBNRFl0TXpWall5MDBZamMxTFRsbU16TXRNRGc0TlRCbVkyRmlPVE0yIiwiYXBwX2Rpc3BsYXluYW1lIjoiMuWPt-WtmOWCqOehrOebmCIsImdpdmVuX25hbWUiOiIy5Y-3IiwiZmFtaWx5X25hbWUiOiLnvZHnm5giLCJhcHBpZCI6ImJkZDRjOTA5LTA0ZjItNDU4NS04MjZlLTY0MDQzNDljN2JiZiIsInRpZCI6ImY4MTk4OWJiLWViNDAtNGZhYi05NzA5LTQ0ODFhMDM0ZjNiNCIsInVwbiI6InBhbjJAeGlhb211eGkuY24iLCJwdWlkIjoiMTAwMzIwMDJBRTUyNDMwRCIsImNhY2hla2V5IjoiMGguZnxtZW1iZXJzaGlwfDEwMDMyMDAyYWU1MjQzMGRAbGl2ZS5jb20iLCJzY3AiOiJhbGxmaWxlcy53cml0ZSIsInR0IjoiMiIsImlwYWRkciI6IjIwLjE5MC4xNDQuMTcxIn0.WY--gv_Ac1pwhj3XTOdIddaj643CHoOqBeFFpdSa4-w&ApiVersion=2.0 | ||
|
||
### | ||
#@no-redirect | ||
PUT https://pan.xiaomuxi.cn/api/v3/share/download/Ag4Uy | ||
|
||
### | ||
PUT https://pan.huang1111.cn/api/v3/share/download/m1Mlt1 | ||
|
||
|
||
### | ||
https://pan.huang1111.cn/api/v3/share/info/g31PcQ?password=qaiu | ||
|
||
### | ||
https://pan.huang1111.cn/api/v3/share/info/m1Mlt1?password= | ||
|
||
### | ||
PUT https://pan.huang1111.cn/api/v3/share/download/g31PcQ?path=undefined%2Fundefined |
Oops, something went wrong.