厂长影视bug
This commit is contained in:
parent
5a831250ca
commit
3a86b82cf7
|
|
@ -199,19 +199,53 @@ public class ChangZhang extends Spider {
|
||||||
String content = OkHttp.string(id, getHeader());
|
String content = OkHttp.string(id, getHeader());
|
||||||
Document document = Jsoup.parse(content);
|
Document document = Jsoup.parse(content);
|
||||||
Elements iframe = document.select("iframe");
|
Elements iframe = document.select("iframe");
|
||||||
String videoContent = OkHttp.string(iframe.get(0).attr("src"), getIframeHeader(iframe.get(0).attr("src")));
|
if (!iframe.isEmpty()) {
|
||||||
|
String videoContent = OkHttp.string(iframe.get(0).attr("src"), getIframeHeader(iframe.get(0).attr("src")));
|
||||||
|
|
||||||
|
|
||||||
Matcher matcher2 = Pattern.compile("result_v2 =(.*?);").matcher(videoContent);
|
Matcher matcher2 = Pattern.compile("result_v2 =(.*?);").matcher(videoContent);
|
||||||
String json2 = matcher2.find() ? matcher2.group(1) : "";
|
String json2 = matcher2.find() ? matcher2.group(1) : "";
|
||||||
org.json.JSONObject jsonObject = new JSONObject(json2);
|
org.json.JSONObject jsonObject = new JSONObject(json2);
|
||||||
String encodedStr = jsonObject.getString("data");
|
String encodedStr = jsonObject.getString("data");
|
||||||
String realUrl = new String(new BigInteger(StringUtils.reverse(encodedStr), 16).toByteArray());
|
String realUrl = new String(new BigInteger(StringUtils.reverse(encodedStr), 16).toByteArray());
|
||||||
Map<String, String> header = getVideoHeader();
|
Map<String, String> header = getVideoHeader();
|
||||||
String temp = decodeStr(realUrl);
|
String temp = decodeStr(realUrl);
|
||||||
return Result.get().url(temp).string();
|
return Result.get().url(temp).string();
|
||||||
|
} else {
|
||||||
|
for (Element script : document.select("script")) {
|
||||||
|
String scriptText = script.html();
|
||||||
|
if (scriptText.contains("wp_nonce")) {
|
||||||
|
String reg = "var(.*?)=\"(.*?)\"";
|
||||||
|
Pattern pattern = Pattern.compile(reg);
|
||||||
|
Matcher matcher = pattern.matcher(scriptText);
|
||||||
|
|
||||||
|
if (matcher.find()) {
|
||||||
|
String data = matcher.group(2);
|
||||||
|
String result = dncry(data);
|
||||||
|
String regex = "url:.*?['\"](.*?)['\"]";
|
||||||
|
Pattern pattern1 = Pattern.compile(regex);
|
||||||
|
Matcher matcher1 = pattern1.matcher(result);
|
||||||
|
if (matcher1.find()) {
|
||||||
|
String playUrl = matcher1.group(0).replace("\"", "").replace("url:", "").trim();
|
||||||
|
return Result.get().url(playUrl).string();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String dncry(String data) {
|
||||||
|
String kc8a64 = "336460fdcb76a597";
|
||||||
|
String iv = "1234567890983456";
|
||||||
|
|
||||||
|
return AESEncryption.decrypt(data, kc8a64, iv);
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
String decodeStr(String _0x267828) {
|
String decodeStr(String _0x267828) {
|
||||||
int _0x5cd2b5 = (_0x267828.length() - 7) / 2;
|
int _0x5cd2b5 = (_0x267828.length() - 7) / 2;
|
||||||
String _0x2191ed = _0x267828.substring(0, _0x5cd2b5);
|
String _0x2191ed = _0x267828.substring(0, _0x5cd2b5);
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ import android.util.Base64;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import javax.crypto.Cipher;
|
import javax.crypto.Cipher;
|
||||||
import javax.crypto.spec.IvParameterSpec;
|
import javax.crypto.spec.IvParameterSpec;
|
||||||
|
|
@ -55,6 +57,27 @@ public class AESEncryption {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String decrypt(String word,String key,String iv) {
|
||||||
|
try {
|
||||||
|
byte[] keyBytes = key.getBytes("UTF-8");
|
||||||
|
SecretKeySpec keySpec = new SecretKeySpec(keyBytes, "AES");
|
||||||
|
|
||||||
|
byte[] ivBytes = iv.getBytes("UTF-8");
|
||||||
|
IvParameterSpec ivSpec = new IvParameterSpec(ivBytes);
|
||||||
|
|
||||||
|
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding");
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec);
|
||||||
|
|
||||||
|
byte[] decoded = Base64.decode(word, Base64.DEFAULT);
|
||||||
|
byte[] decrypted = cipher.doFinal(decoded);
|
||||||
|
|
||||||
|
return new String(decrypted, Charset.defaultCharset());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static byte[] hexStringToByteArray(String hexString) {
|
private static byte[] hexStringToByteArray(String hexString) {
|
||||||
int len = hexString.length();
|
int len = hexString.length();
|
||||||
byte[] data = new byte[len / 2];
|
byte[] data = new byte[len / 2];
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ public class ChangZhangTest {
|
||||||
@org.junit.Test
|
@org.junit.Test
|
||||||
public void playerContent() throws Exception {
|
public void playerContent() throws Exception {
|
||||||
String froms = "厂长$$$";
|
String froms = "厂长$$$";
|
||||||
String urls = "立即播放 (周处除三害)$https://www.czys.pro/v_play/bXZfMTc1ODAtbm1fMQ==.html$$$";
|
String urls = "立即播放 (周处除三害)$https://www.czys.pro/v_play/bXZfMTg2MjEtbm1fMQ==.html$$$";
|
||||||
for (int i = 0; i < urls.split("\\$\\$\\$").length; i++) {
|
for (int i = 0; i < urls.split("\\$\\$\\$").length; i++) {
|
||||||
String content = spider.playerContent(froms.split("\\$\\$\\$")[i], urls.split("\\$\\$\\$")[i].split("\\$")[1], new ArrayList<>());
|
String content = spider.playerContent(froms.split("\\$\\$\\$")[i], urls.split("\\$\\$\\$")[i].split("\\$")[1], new ArrayList<>());
|
||||||
JsonObject map = Json.safeObject(content);
|
JsonObject map = Json.safeObject(content);
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
a2dc46da2b4b48c7111366fa3e02897e
|
fdccfbf91a5b725dcade07fe35e444c9
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "../jar/custom_spider.jar;md5;a2dc46da2b4b48c7111366fa3e02897e",
|
"spider": "../jar/custom_spider.jar;md5;fdccfbf91a5b725dcade07fe35e444c9",
|
||||||
"lives": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "直播ipv6",
|
"name": "直播ipv6",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue