mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2025-12-17 04:43:02 +00:00
蓝奏云密码解析测试
This commit is contained in:
@@ -2,7 +2,6 @@ package cn.qaiu.lz.common.util;
|
|||||||
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.text.ParseException;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,12 @@ package cn.qaiu.lz.common.util;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import io.vertx.core.MultiMap;
|
||||||
|
import io.vertx.core.Vertx;
|
||||||
|
import io.vertx.core.buffer.Buffer;
|
||||||
|
import io.vertx.core.json.JsonObject;
|
||||||
|
import io.vertx.ext.web.client.HttpRequest;
|
||||||
|
import io.vertx.ext.web.client.WebClient;
|
||||||
import org.jsoup.Jsoup;
|
import org.jsoup.Jsoup;
|
||||||
import org.jsoup.nodes.Document;
|
import org.jsoup.nodes.Document;
|
||||||
|
|
||||||
@@ -21,7 +27,8 @@ import java.util.regex.Pattern;
|
|||||||
public class LzTool {
|
public class LzTool {
|
||||||
|
|
||||||
public static String parse(String fullUrl) throws Exception {
|
public static String parse(String fullUrl) throws Exception {
|
||||||
var userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.3";
|
var userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0" +
|
||||||
|
".3626.121 Safari/537.3";
|
||||||
var url = fullUrl.substring(0, fullUrl.lastIndexOf('/') + 1);
|
var url = fullUrl.substring(0, fullUrl.lastIndexOf('/') + 1);
|
||||||
var id = fullUrl.substring(fullUrl.lastIndexOf('/') + 1);
|
var id = fullUrl.substring(fullUrl.lastIndexOf('/') + 1);
|
||||||
Map<String, String> header = new HashMap<>();
|
Map<String, String> header = new HashMap<>();
|
||||||
@@ -34,7 +41,8 @@ public class LzTool {
|
|||||||
sec-ch-ua-mobile: ?1
|
sec-ch-ua-mobile: ?1
|
||||||
sec-ch-ua-platform: "Android"
|
sec-ch-ua-platform: "Android"
|
||||||
*/
|
*/
|
||||||
var userAgent2 = "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36";
|
var userAgent2 = "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like " +
|
||||||
|
"Gecko) Chrome/111.0.0.0 Mobile Safari/537.36";
|
||||||
Map<String, String> header2 = new HashMap<>();
|
Map<String, String> header2 = new HashMap<>();
|
||||||
header2.put("Accept-Language", "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2");
|
header2.put("Accept-Language", "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2");
|
||||||
header2.put("sec-ch-ua-mobile", "sec-ch-ua-mobile");
|
header2.put("sec-ch-ua-mobile", "sec-ch-ua-mobile");
|
||||||
@@ -55,7 +63,8 @@ public class LzTool {
|
|||||||
.get()
|
.get()
|
||||||
.html();
|
.html();
|
||||||
// System.out.println(result);
|
// System.out.println(result);
|
||||||
// 'sign':'AWcGOFprUGFWX1BvBTVXawdrBDZTOAU_bV2FTZFU7W2sBJ1t4DW0FYFIyBmgDZVJgUjAFNV41UGQFNg_c_c' 改下正则TMD 最近上传竟然没_c_c
|
// 'sign':'AWcGOFprUGFWX1BvBTVXawdrBDZTOAU_bV2FTZFU7W2sBJ1t4DW0FYFIyBmgDZVJgUjAFNV41UGQFNg_c_c' 改下正则TMD
|
||||||
|
// 最近上传竟然没_c_c
|
||||||
Matcher matcher = Pattern.compile("'sign'\s*:\s*'([0-9a-zA-Z_]+)'").matcher(result);
|
Matcher matcher = Pattern.compile("'sign'\s*:\s*'([0-9a-zA-Z_]+)'").matcher(result);
|
||||||
Map<String, String> params = new LinkedHashMap<>();
|
Map<String, String> params = new LinkedHashMap<>();
|
||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
@@ -78,7 +87,8 @@ public class LzTool {
|
|||||||
.text()
|
.text()
|
||||||
.replace("\\", "");
|
.replace("\\", "");
|
||||||
//json转为map
|
//json转为map
|
||||||
params = new ObjectMapper().readValue(result, new TypeReference<>() {});
|
params = new ObjectMapper().readValue(result, new TypeReference<>() {
|
||||||
|
});
|
||||||
// System.out.println(params);
|
// System.out.println(params);
|
||||||
//通过json的数据拼接出最终的URL发起第最终请求,并得到响应信息头
|
//通过json的数据拼接出最终的URL发起第最终请求,并得到响应信息头
|
||||||
url = params.get("dom") + "/file/" + params.get("url");
|
url = params.get("dom") + "/file/" + params.get("url");
|
||||||
@@ -94,4 +104,71 @@ public class LzTool {
|
|||||||
|
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// String key = "https://lanzoux.com/ia2cntg";
|
||||||
|
String key = "https://wwsd.lanzoue.com/icBp6qqj82b";
|
||||||
|
String urlPrefix = "https://lanzoux.com";
|
||||||
|
String code = "QAIU";
|
||||||
|
|
||||||
|
WebClient client = WebClient.create(Vertx.vertx());
|
||||||
|
client.getAbs(key).send().onSuccess(res -> {
|
||||||
|
String html = res.bodyAsString();
|
||||||
|
// 匹配iframe
|
||||||
|
Pattern compile = Pattern.compile("class=\"ifr2\" name=.+src=\"(/fn\\?[a-zA-Z0-9_+/=]{16,})\"");
|
||||||
|
Matcher matcher = compile.matcher(html);
|
||||||
|
if (!matcher.find()) {
|
||||||
|
// $.ajax({
|
||||||
|
// type : 'post',
|
||||||
|
// url : '/ajaxm.php',
|
||||||
|
// //data : 'action=downprocess&sign=VTMAPgs6UG&p='+pwd,
|
||||||
|
// data : 'action=downprocess&sign
|
||||||
|
// =VzEBPwAxBzYIAQo1BjYBPVA_bDj1fNgEwUWNTYFUwAzMJL1V2Xj5XMlMzVjhTMVFjUzEHOlM4AjEBNQ_c_c&p
|
||||||
|
// ='+pwd,
|
||||||
|
// //data : 'action=downprocess&sign=VTMAPgs6UG&p='+pwd,
|
||||||
|
// dataType : 'json',
|
||||||
|
// success:function(msg){
|
||||||
|
// var date = msg;
|
||||||
|
// if(date.zt == '1'){
|
||||||
|
// $("#downajax").html("<a href="+date.dom+"/file/"+ date.url +" target=_blank
|
||||||
|
// rel=noreferrer>下载</a>");
|
||||||
|
// }else{
|
||||||
|
// $("#info").text(date.inf);
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// },
|
||||||
|
// 匹配不到说明需要密码 直接解析并请求ajaxm.php
|
||||||
|
|
||||||
|
// 匹配sign
|
||||||
|
Pattern compile2 = Pattern.compile("sign=([0-9a-zA-Z_]{16,})");
|
||||||
|
Matcher matcher2 = compile2.matcher(html);
|
||||||
|
if (!matcher2.find()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String sign = matcher2.group(1);
|
||||||
|
|
||||||
|
var userAgent2 = "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like " +
|
||||||
|
"Gecko) Chrome/111.0.0.0 Mobile Safari/537.36";
|
||||||
|
|
||||||
|
HttpRequest<Buffer> bufferHttpRequest = client.postAbs(urlPrefix + "/ajaxm.php");
|
||||||
|
// bufferHttpRequest.putHeader("User-Agent", userAgent2);
|
||||||
|
bufferHttpRequest.putHeader("referer", key);
|
||||||
|
bufferHttpRequest.sendForm(MultiMap.caseInsensitiveMultiMap()
|
||||||
|
.set("action", "downprocess")
|
||||||
|
.set("sign", sign).set("p", code)).onSuccess(res2 -> {
|
||||||
|
JsonObject urlJson = res2.bodyAsJsonObject();
|
||||||
|
System.out.println(urlJson);
|
||||||
|
System.out.println(urlJson.getString("dom")+"/file/"+urlJson.getString("url"));
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String iframePath = matcher.group(1);
|
||||||
|
System.out.println(iframePath);
|
||||||
|
client.getAbs(urlPrefix + iframePath).send().onSuccess(res2 -> {
|
||||||
|
System.out.println(res2.bodyAsString());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user