移动云盘and panta
This commit is contained in:
parent
68a38cdb38
commit
2bac7cdedf
|
|
@ -233,7 +233,7 @@ public class TianyiApi {
|
||||||
private String getUserBriefInfo() throws Exception {
|
private String getUserBriefInfo() throws Exception {
|
||||||
OkResult result = OkHttpWithCookie.get("https://cloud.189.cn/api/portal/v2/getUserBriefInfo.action", new HashMap<>(), getHeaders(), cookieJar);
|
OkResult result = OkHttpWithCookie.get("https://cloud.189.cn/api/portal/v2/getUserBriefInfo.action", new HashMap<>(), getHeaders(), cookieJar);
|
||||||
JsonObject obj = Json.safeObject(result.getBody());
|
JsonObject obj = Json.safeObject(result.getBody());
|
||||||
return obj.get("sessionKey").getAsString();
|
return obj.get("sessionKey")==null?"":obj.get("sessionKey").getAsString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getUserSizeInfo() throws Exception {
|
private String getUserSizeInfo() throws Exception {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,190 @@
|
||||||
|
package com.github.catvod.api;
|
||||||
|
|
||||||
|
import com.github.catvod.net.OkHttp;
|
||||||
|
import com.github.catvod.net.OkResult;
|
||||||
|
import com.github.catvod.utils.Json;
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import org.apache.commons.codec.binary.Base64;
|
||||||
|
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.crypto.spec.IvParameterSpec;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
import java.security.GeneralSecurityException;
|
||||||
|
import java.security.SecureRandom;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public class YunDrive {
|
||||||
|
private final Pattern regex = Pattern.compile("https://yun\\.139\\.com/shareweb/#/w/i/([^&]+)");
|
||||||
|
private final SecretKeySpec secretKey;
|
||||||
|
private final String baseUrl = "https://share-kd-njs.yun.139.com/yun-share/richlifeApp/devapp/IOutLink/";
|
||||||
|
private final Map<String, String> baseHeaders = new HashMap<>();
|
||||||
|
|
||||||
|
private final Map<String, JsonObject> cache = new HashMap<>();
|
||||||
|
|
||||||
|
private static class Loader {
|
||||||
|
static volatile YunDrive INSTANCE = new YunDrive();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static YunDrive get() {
|
||||||
|
return Loader.INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public YunDrive() {
|
||||||
|
|
||||||
|
this.secretKey = new SecretKeySpec("PVGDwmcvfs1uV3d1".getBytes(Charset.defaultCharset()), "AES");
|
||||||
|
baseHeaders.put("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");
|
||||||
|
baseHeaders.put("Content-Type", "application/json");
|
||||||
|
baseHeaders.put("hcy-cool-flag", "1");
|
||||||
|
baseHeaders.put("x-deviceinfo", "||3|12.27.0|chrome|131.0.0.0|5c7c68368f048245e1ce47f1c0f8f2d0||windows 10|1536X695|zh-CN|||");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private String encrypt(String data) throws GeneralSecurityException {
|
||||||
|
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding");
|
||||||
|
byte[] ivBytes = new byte[16];
|
||||||
|
new SecureRandom().nextBytes(ivBytes);
|
||||||
|
cipher.init(Cipher.ENCRYPT_MODE, secretKey, new IvParameterSpec(ivBytes));
|
||||||
|
byte[] encrypted = cipher.doFinal(data.getBytes(Charset.defaultCharset()));
|
||||||
|
byte[] combined = new byte[ivBytes.length + encrypted.length];
|
||||||
|
System.arraycopy(ivBytes, 0, combined, 0, ivBytes.length);
|
||||||
|
System.arraycopy(encrypted, 0, combined, ivBytes.length, encrypted.length);
|
||||||
|
return Base64.encodeBase64String(combined);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private String decrypt(String data) throws GeneralSecurityException {
|
||||||
|
byte[] combined = Base64.decodeBase64(data);
|
||||||
|
byte[] ivBytes = Arrays.copyOfRange(combined, 0, 16);
|
||||||
|
byte[] encrypted = Arrays.copyOfRange(combined, 16, combined.length);
|
||||||
|
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding");
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE, secretKey, new IvParameterSpec(ivBytes));
|
||||||
|
return new String(cipher.doFinal(encrypted), Charset.defaultCharset());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String extractLinkID(String url) {
|
||||||
|
String linkID = "";
|
||||||
|
Matcher matcher = regex.matcher(url);
|
||||||
|
boolean finded = matcher.find();
|
||||||
|
if (!finded) {
|
||||||
|
matcher = Pattern.compile("https://caiyun\\.139\\.com/m/i\\?([^&]+)").matcher(url);
|
||||||
|
finded = matcher.find();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (finded) linkID = matcher.group(1);
|
||||||
|
return linkID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JsonObject fetchShareInfo(String pCaID, String linkID) throws IOException, GeneralSecurityException {
|
||||||
|
if (linkID.isEmpty()) throw new IllegalStateException("linkID not initialized");
|
||||||
|
|
||||||
|
String cacheKey = linkID + "-" + pCaID;
|
||||||
|
if (cache.containsKey(cacheKey)) return cache.get(cacheKey);
|
||||||
|
|
||||||
|
Map<String, Object> requestBody = Map.of("getOutLinkInfoReq", Map.of("account", "", "linkID", linkID, "passwd", "", "caSrt", 0, "coSrt", 0, "srtDr", 1, "bNum", 1, "pCaID", pCaID, "eNum", 200), "commonAccountInfo", Map.of("account", "", "accountType", 1));
|
||||||
|
|
||||||
|
|
||||||
|
OkResult okResult = OkHttp.post(baseUrl + "getOutLinkInfoV6", encrypt(Json.toJson(requestBody)), baseHeaders);
|
||||||
|
JsonObject result = Json.safeObject(decrypt(okResult.getBody())).getAsJsonObject("data");
|
||||||
|
cache.put(cacheKey, result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, List<Map<String, String>>> processShareData(String url) throws Exception {
|
||||||
|
if (url == null || url.isEmpty()) return Collections.emptyMap();
|
||||||
|
|
||||||
|
boolean isUrl = url.startsWith("http");
|
||||||
|
String pCaID = isUrl ? "root" : url;
|
||||||
|
String linkID = "";
|
||||||
|
if (isUrl) linkID = extractLinkID(url);
|
||||||
|
|
||||||
|
List<Map<String, String>> fileList = fetchFileList(pCaID, linkID);
|
||||||
|
Map<String, List<Map<String, String>>> result = new LinkedHashMap<>();
|
||||||
|
|
||||||
|
for (Map<String, String> item : fileList) {
|
||||||
|
String name = item.get("name");
|
||||||
|
List<Map<String, String>> subItems = fetchUrlList(item.get("path"), linkID);
|
||||||
|
if (!subItems.isEmpty()) {
|
||||||
|
|
||||||
|
List<Map<String, String>> list = result.get(name);
|
||||||
|
if (list == null) {
|
||||||
|
list = new ArrayList<>();
|
||||||
|
result.put(name, list);
|
||||||
|
}
|
||||||
|
list.addAll(subItems);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result.isEmpty()) {
|
||||||
|
List<Map<String, String>> rootItems = fetchFileList(url, linkID);
|
||||||
|
List<Map<String, String>> filteredList = new ArrayList<>();
|
||||||
|
for (Map<String, String> m : rootItems) {
|
||||||
|
if (!m.isEmpty()) {
|
||||||
|
filteredList.add(m);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result.put("root", filteredList);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Map<String, String>> fetchFileList(String pCaID, String linkID) throws Exception {
|
||||||
|
if (pCaID == null) return Collections.emptyList();
|
||||||
|
|
||||||
|
String actualID = pCaID.startsWith("http") ? "root" : pCaID;
|
||||||
|
JsonObject response = fetchShareInfo(actualID, linkID);
|
||||||
|
if (!response.has("caLst")) return Collections.emptyList();
|
||||||
|
|
||||||
|
List<Map<String, String>> items = new ArrayList<>();
|
||||||
|
Pattern filter = Pattern.compile("App|活动中心|免费|1T空间|免流");
|
||||||
|
JsonElement array = response.get("caLst");
|
||||||
|
if (!array.isJsonNull()) {
|
||||||
|
for (JsonElement element : array.getAsJsonArray()) {
|
||||||
|
JsonObject entry = element.getAsJsonObject();
|
||||||
|
String name = entry.get("caName").getAsString();
|
||||||
|
String path = entry.get("path").getAsString();
|
||||||
|
|
||||||
|
if (!filter.matcher(name).find()) {
|
||||||
|
items.add(Map.of("name", name, "path", path));
|
||||||
|
items.addAll(fetchFileList(path, linkID));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Map<String, String>> fetchUrlList(String pCaID, String linkID) throws Exception {
|
||||||
|
JsonObject response = fetchShareInfo(pCaID, linkID);
|
||||||
|
List<Map<String, String>> items = new ArrayList<>();
|
||||||
|
|
||||||
|
if (response.has("coLst")) {
|
||||||
|
for (JsonElement element : response.getAsJsonArray("coLst")) {
|
||||||
|
JsonObject entry = element.getAsJsonObject();
|
||||||
|
if (entry.get("coType").getAsInt() == 3) {
|
||||||
|
items.add(Map.of("name", entry.get("coName").getAsString(), "contentId", entry.get("coID").getAsString(), "linkID", linkID));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (response.has("caLst")) {
|
||||||
|
for (JsonElement element : response.getAsJsonArray("caLst")) {
|
||||||
|
items.addAll(fetchUrlList(element.getAsJsonObject().get("path").getAsString(), linkID));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String fetchPlayUrl(String contentId, String linkID) throws Exception {
|
||||||
|
Map<String, Object> requestBody = Map.of("getContentInfoFromOutLinkReq", Map.of("contentId", contentId, "linkID", linkID, "account", ""), "commonAccountInfo", Map.of("account", "", "accountType", 1));
|
||||||
|
|
||||||
|
|
||||||
|
OkResult okResult = OkHttp.post(baseUrl + "getContentInfoFromOutLink", Json.toJson(requestBody), Map.of("Accept-Encoding", "gzip, deflate, br, zstd", "User-Agent", baseHeaders.get("User-Agent")));
|
||||||
|
return Json.safeObject(okResult.getBody()).getAsJsonObject("data").getAsJsonObject("contentInfo").get("presentURL").getAsString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -22,6 +22,7 @@ public class Cloud extends Spider {
|
||||||
private Ali ali = null;
|
private Ali ali = null;
|
||||||
private UC uc = null;
|
private UC uc = null;
|
||||||
private TianYi tianYi = null;
|
private TianYi tianYi = null;
|
||||||
|
private YiDongYun yiDongYun = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Context context, String extend) throws Exception {
|
public void init(Context context, String extend) throws Exception {
|
||||||
|
|
@ -30,11 +31,13 @@ public class Cloud extends Spider {
|
||||||
uc = new UC();
|
uc = new UC();
|
||||||
ali = new Ali();
|
ali = new Ali();
|
||||||
tianYi = new TianYi();
|
tianYi = new TianYi();
|
||||||
if(Objects.nonNull(ext)){
|
yiDongYun = new YiDongYun();
|
||||||
|
if (Objects.nonNull(ext)) {
|
||||||
quark.init(context, ext.has("cookie") ? ext.get("cookie").getAsString() : "");
|
quark.init(context, ext.has("cookie") ? ext.get("cookie").getAsString() : "");
|
||||||
uc.init(context, ext.has("uccookie") ? ext.get("uccookie").getAsString() : "");
|
uc.init(context, ext.has("uccookie") ? ext.get("uccookie").getAsString() : "");
|
||||||
ali.init(context, ext.has("token") ? ext.get("token").getAsString() : "");
|
ali.init(context, ext.has("token") ? ext.get("token").getAsString() : "");
|
||||||
tianYi.init(context, ext.has("tianyicookie") ? ext.get("tianyicookie").getAsString() : "");
|
tianYi.init(context, ext.has("tianyicookie") ? ext.get("tianyicookie").getAsString() : "");
|
||||||
|
yiDongYun.init(context, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -49,6 +52,8 @@ public class Cloud extends Spider {
|
||||||
return uc.detailContent(shareUrl);
|
return uc.detailContent(shareUrl);
|
||||||
} else if (shareUrl.get(0).startsWith(TianyiApi.URL_START)) {
|
} else if (shareUrl.get(0).startsWith(TianyiApi.URL_START)) {
|
||||||
return tianYi.detailContent(shareUrl);
|
return tianYi.detailContent(shareUrl);
|
||||||
|
} else if (shareUrl.get(0).contains(YiDongYun.URL_START)) {
|
||||||
|
return yiDongYun.detailContent(shareUrl);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -61,6 +66,8 @@ public class Cloud extends Spider {
|
||||||
return uc.playerContent(flag, id, vipFlags);
|
return uc.playerContent(flag, id, vipFlags);
|
||||||
} else if (flag.contains("天意")) {
|
} else if (flag.contains("天意")) {
|
||||||
return tianYi.playerContent(flag, id, vipFlags);
|
return tianYi.playerContent(flag, id, vipFlags);
|
||||||
|
} else if (flag.contains("移动")) {
|
||||||
|
return yiDongYun.playerContent(flag, id, vipFlags);
|
||||||
} else {
|
} else {
|
||||||
return ali.playerContent(flag, id, vipFlags);
|
return ali.playerContent(flag, id, vipFlags);
|
||||||
}
|
}
|
||||||
|
|
@ -79,6 +86,8 @@ public class Cloud extends Spider {
|
||||||
from.add(ali.detailContentVodPlayFrom(List.of(shareLink), i));
|
from.add(ali.detailContentVodPlayFrom(List.of(shareLink), i));
|
||||||
} else if (shareLink.startsWith(URL_START)) {
|
} else if (shareLink.startsWith(URL_START)) {
|
||||||
from.add(tianYi.detailContentVodPlayFrom(List.of(shareLink), i));
|
from.add(tianYi.detailContentVodPlayFrom(List.of(shareLink), i));
|
||||||
|
} else if (shareLink.contains(YiDongYun.URL_START)) {
|
||||||
|
from.add(yiDongYun.detailContentVodPlayFrom(List.of(shareLink), i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,6 +105,8 @@ public class Cloud extends Spider {
|
||||||
urls.add(ali.detailContentVodPlayUrl(List.of(shareLink)));
|
urls.add(ali.detailContentVodPlayUrl(List.of(shareLink)));
|
||||||
} else if (shareLink.startsWith(URL_START)) {
|
} else if (shareLink.startsWith(URL_START)) {
|
||||||
urls.add(tianYi.detailContentVodPlayUrl(List.of(shareLink)));
|
urls.add(tianYi.detailContentVodPlayUrl(List.of(shareLink)));
|
||||||
|
} else if (shareLink.contains(YiDongYun.URL_START)) {
|
||||||
|
urls.add(yiDongYun.detailContentVodPlayUrl(List.of(shareLink)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TextUtils.join("$$$", urls);
|
return TextUtils.join("$$$", urls);
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ public class Introduce extends Spider {
|
||||||
String name2 = "本接口不收费,请不要付费,谢谢!";
|
String name2 = "本接口不收费,请不要付费,谢谢!";
|
||||||
list.add(new Vod("https://androidcatvodspider.netlify.app/wechat.png", name2, pic2));
|
list.add(new Vod("https://androidcatvodspider.netlify.app/wechat.png", name2, pic2));
|
||||||
String pic3 = "https://androidcatvodspider.netlify.app/wechat.png";
|
String pic3 = "https://androidcatvodspider.netlify.app/wechat.png";
|
||||||
String name3 = "2025-04-08 13:52";
|
String name3 = "2025-04-11 10:53";
|
||||||
list.add(new Vod("https://androidcatvodspider.netlify.app/wechat.png", name3, pic3));
|
list.add(new Vod("https://androidcatvodspider.netlify.app/wechat.png", name3, pic3));
|
||||||
return Result.string(classes, list);
|
return Result.string(classes, list);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,155 @@
|
||||||
|
package com.github.catvod.spider;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import com.github.catvod.bean.Class;
|
||||||
|
import com.github.catvod.bean.Result;
|
||||||
|
import com.github.catvod.bean.Vod;
|
||||||
|
import com.github.catvod.net.OkHttp;
|
||||||
|
import com.github.catvod.utils.Util;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.jsoup.Jsoup;
|
||||||
|
import org.jsoup.nodes.Document;
|
||||||
|
import org.jsoup.nodes.Element;
|
||||||
|
import org.jsoup.select.Elements;
|
||||||
|
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public class PanTa extends Cloud {
|
||||||
|
private static final String HOST = "https://www.91panta.cn/";
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(Context context, String extend) throws Exception {
|
||||||
|
// JsonObject ext = Json.safeObject(extend);
|
||||||
|
super.init(context, extend);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String homeContent(boolean filter) {
|
||||||
|
|
||||||
|
|
||||||
|
List<Class> classes = new ArrayList<>();
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(HOST));
|
||||||
|
Elements elements = doc.select("#tabNavigation > a.tab");
|
||||||
|
for (Element element : elements) {
|
||||||
|
|
||||||
|
classes.add(new Class(element.attr("href"), element.text().trim()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return Result.string(classes, parseVodListFromDoc(doc));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) {
|
||||||
|
String url = HOST + tid + "&page=" + pg;
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(url));
|
||||||
|
int page = Integer.parseInt(pg), limit = 30, total = Integer.MAX_VALUE;
|
||||||
|
return Result.get().vod(parseVodListFromDoc(doc)).page(page, 99999, limit, total).string();
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Vod> parseVodListFromDoc(Document doc) {
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
Elements elements = doc.select(".topicList > .topicItem");
|
||||||
|
for (Element e : elements) {
|
||||||
|
String pic = e.selectFirst("a.avatarLink img").attr("src");
|
||||||
|
pic = StringUtils.isAllBlank(pic) ? e.selectFirst(".tm-m-photos-thumb li").attr("data-src") : pic;
|
||||||
|
Element content = e.selectFirst(".content > h2 > a");
|
||||||
|
String vodId = content.attr("href");
|
||||||
|
String vodPic = HOST + pic;
|
||||||
|
String vodName = content.text();
|
||||||
|
|
||||||
|
list.add(new Vod(vodId, vodName, vodPic));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
// 获取视频信息
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String detailContent(List<String> ids) throws Exception {
|
||||||
|
String vodId = ids.get(0);
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(HOST + vodId));
|
||||||
|
|
||||||
|
Vod item = new Vod();
|
||||||
|
|
||||||
|
Element titleElement = doc.selectFirst(".title");
|
||||||
|
if (titleElement != null) {
|
||||||
|
item.setVodName(titleElement.text().trim());
|
||||||
|
}
|
||||||
|
item.setVodId("/" + vodId);
|
||||||
|
|
||||||
|
|
||||||
|
// 解析链接
|
||||||
|
String contentHtml = doc.selectFirst(".topicContent").html();
|
||||||
|
String link = null;
|
||||||
|
|
||||||
|
// 第一种匹配模式:<a href>
|
||||||
|
Pattern aPattern = Pattern.compile("<a\\s+(?:[^>]*?\\s+)?href=[\"'](https://caiyun\\.139\\.com/[^\"']*)[\"'][^>]*>", Pattern.CASE_INSENSITIVE);
|
||||||
|
Matcher aMatcher = aPattern.matcher(contentHtml);
|
||||||
|
if (aMatcher.find()) {
|
||||||
|
link = aMatcher.group(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 第二种匹配模式:<span>中的文本
|
||||||
|
if (StringUtils.isAllBlank(link)) {
|
||||||
|
Pattern spanPattern = Pattern.compile("<span\\s+style=\"color:\\s*#0070C0;\\s*\">(https://caiyun\\.139\\.com/[^<]*)</span>", Pattern.CASE_INSENSITIVE);
|
||||||
|
Matcher spanMatcher = spanPattern.matcher(contentHtml);
|
||||||
|
if (spanMatcher.find()) {
|
||||||
|
link = spanMatcher.group(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 第三种匹配模式:纯文本
|
||||||
|
if (StringUtils.isAllBlank(link)) {
|
||||||
|
Pattern textPattern = Pattern.compile("https://caiyun\\.139\\.com/[^<]*");
|
||||||
|
Matcher textMatcher = textPattern.matcher(contentHtml);
|
||||||
|
if (textMatcher.find()) {
|
||||||
|
link = textMatcher.group();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
item.setVodPlayUrl(super.detailContentVodPlayUrl(List.of(link)));
|
||||||
|
item.setVodPlayFrom(super.detailContentVodPlayFrom(List.of(link)));
|
||||||
|
|
||||||
|
String text = doc.select("div.topicContent > p").text().trim();
|
||||||
|
|
||||||
|
String director = Util.findByRegex("导演:(.*)主演", text, 1);
|
||||||
|
String actor = Util.findByRegex("主演:(.*)类型", text, 1);
|
||||||
|
String cat = Util.findByRegex("类型:(.*)制片", text, 1);
|
||||||
|
String area = Util.findByRegex("地区:(.*)语言", text, 1);
|
||||||
|
String year = Util.findByRegex("上映日期:(.*)片长", text, 1);
|
||||||
|
String remark = Util.findByRegex("简介:(.*)", text, 1);
|
||||||
|
item.setVodDirector(director);
|
||||||
|
item.setVodActor(actor);
|
||||||
|
item.setTypeName(cat);
|
||||||
|
item.setVodArea(area);
|
||||||
|
item.setVodYear(year);
|
||||||
|
item.setVodContent(remark);
|
||||||
|
return Result.string(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String searchContent(String key, boolean quick, String pg) throws Exception {
|
||||||
|
return searchContent(key, pg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String searchContent(String key, boolean quick) throws Exception {
|
||||||
|
return searchContent(key, "1");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private String searchContent(String key, String pg) {
|
||||||
|
String searchURL = HOST + String.format("search?keyword=%s&page=%s", URLEncoder.encode(key), pg);
|
||||||
|
String html = OkHttp.string(searchURL);
|
||||||
|
return Result.string(parseVodListFromDoc(Jsoup.parse(html)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,108 @@
|
||||||
|
package com.github.catvod.spider;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import com.github.catvod.api.YunDrive;
|
||||||
|
import com.github.catvod.bean.Result;
|
||||||
|
import com.github.catvod.bean.Vod;
|
||||||
|
import com.github.catvod.crawler.Spider;
|
||||||
|
import com.github.catvod.crawler.SpiderDebug;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ColaMint & Adam & FongMi
|
||||||
|
*/
|
||||||
|
public class YiDongYun extends Spider {
|
||||||
|
|
||||||
|
|
||||||
|
public static final CharSequence URL_START = "yun.139";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(Context context, String extend) throws Exception {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String detailContent(List<String> ids) throws Exception {
|
||||||
|
Vod vod = getVod(ids);
|
||||||
|
|
||||||
|
return Result.string(vod);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static @NotNull Vod getVod(List<String> ids) throws Exception {
|
||||||
|
Vod.VodPlayBuilder builder = new Vod.VodPlayBuilder();
|
||||||
|
String vodName = "";
|
||||||
|
Map<String, List<Map<String, String>>> result = YunDrive.get().processShareData(ids.get(0));
|
||||||
|
List<Vod.VodPlayBuilder.PlayUrl> list = new ArrayList<>();
|
||||||
|
for (String s : result.keySet()) {
|
||||||
|
vodName = s;
|
||||||
|
for (Map<String, String> stringStringMap : result.get(s)) {
|
||||||
|
Vod.VodPlayBuilder.PlayUrl playUrl = new Vod.VodPlayBuilder.PlayUrl();
|
||||||
|
playUrl.url = stringStringMap.get("contentId") + "++" + stringStringMap.get("linkID");
|
||||||
|
playUrl.name = stringStringMap.get("name");
|
||||||
|
list.add(playUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
builder.append("移动", list);
|
||||||
|
Vod.VodPlayBuilder.BuildResult buildResult = builder.build();
|
||||||
|
Vod vod = new Vod();
|
||||||
|
vod.setVodId(ids.get(0));
|
||||||
|
vod.setVodPic("");
|
||||||
|
vod.setVodYear("");
|
||||||
|
vod.setVodName(vodName);
|
||||||
|
vod.setVodContent("");
|
||||||
|
vod.setVodPlayFrom(buildResult.vodPlayFrom);
|
||||||
|
vod.setVodPlayUrl(buildResult.vodPlayUrl);
|
||||||
|
return vod;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
|
||||||
|
String contentId = id.split("\\+\\+")[0];
|
||||||
|
String linkID = id.split("\\+\\+")[1];
|
||||||
|
String playContent = YunDrive.get().fetchPlayUrl(contentId, linkID);
|
||||||
|
SpiderDebug.log("playContent:" + playContent);
|
||||||
|
return Result.get().url(playContent).octet().string();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 獲取詳情內容視頻播放來源(多 shared_link)
|
||||||
|
*
|
||||||
|
* @param ids share_link 集合
|
||||||
|
* @param i
|
||||||
|
* @return 詳情內容視頻播放來源
|
||||||
|
*/
|
||||||
|
public String detailContentVodPlayFrom(List<String> ids, int index) {
|
||||||
|
List<String> playFrom = new ArrayList<>();
|
||||||
|
int i = 0;
|
||||||
|
for (String id : ids) {
|
||||||
|
playFrom.add("移动" + i++);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return TextUtils.join("$$$", playFrom);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 獲取詳情內容視頻播放地址(多 share_link)
|
||||||
|
*
|
||||||
|
* @param ids share_link 集合
|
||||||
|
* @return 詳情內容視頻播放地址
|
||||||
|
*/
|
||||||
|
public String detailContentVodPlayUrl(List<String> ids) throws Exception {
|
||||||
|
List<String> playUrl = new ArrayList<>();
|
||||||
|
for (String id : ids) {
|
||||||
|
playUrl.add(getVod(List.of(id)).getVodPlayUrl());
|
||||||
|
}
|
||||||
|
return TextUtils.join("$$$", playUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,17 +1,12 @@
|
||||||
package com.github.catvod.utils;
|
package com.github.catvod.utils;
|
||||||
|
|
||||||
import android.util.Base64;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
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;
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
|
||||||
public class AESEncryption {
|
public class AESEncryption {
|
||||||
|
|
||||||
|
|
@ -19,7 +14,7 @@ public class AESEncryption {
|
||||||
public static final String CBC_PKCS_7_PADDING = "AES/CBC/PKCS7Padding";
|
public static final String CBC_PKCS_7_PADDING = "AES/CBC/PKCS7Padding";
|
||||||
public static final String ECB_PKCS_7_PADDING = "AES/ECB/PKCS5Padding";
|
public static final String ECB_PKCS_7_PADDING = "AES/ECB/PKCS5Padding";
|
||||||
|
|
||||||
public static String encrypt(String word, String keyString, String ivString,String trans) {
|
public static String encrypt(String word, String keyString, String ivString, String trans) {
|
||||||
try {
|
try {
|
||||||
byte[] keyBytes = keyString.getBytes("UTF-8");
|
byte[] keyBytes = keyString.getBytes("UTF-8");
|
||||||
SecretKeySpec keySpec = new SecretKeySpec(keyBytes, "AES");
|
SecretKeySpec keySpec = new SecretKeySpec(keyBytes, "AES");
|
||||||
|
|
@ -28,10 +23,10 @@ public class AESEncryption {
|
||||||
IvParameterSpec ivSpec = new IvParameterSpec(ivBytes);
|
IvParameterSpec ivSpec = new IvParameterSpec(ivBytes);
|
||||||
|
|
||||||
Cipher cipher = Cipher.getInstance(trans);
|
Cipher cipher = Cipher.getInstance(trans);
|
||||||
if(StringUtils.isAllBlank(ivString)){
|
if (StringUtils.isAllBlank(ivString)) {
|
||||||
cipher.init(Cipher.ENCRYPT_MODE, keySpec);
|
cipher.init(Cipher.ENCRYPT_MODE, keySpec);
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivSpec);
|
cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivSpec);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -45,7 +40,7 @@ public class AESEncryption {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String decrypt(String word,String keyString,String ivString,String trans) {
|
public static String decrypt(String word, String keyString, String ivString, String trans) {
|
||||||
try {
|
try {
|
||||||
byte[] keyBytes = keyString.getBytes("UTF-8");
|
byte[] keyBytes = keyString.getBytes("UTF-8");
|
||||||
SecretKeySpec keySpec = new SecretKeySpec(keyBytes, "AES");
|
SecretKeySpec keySpec = new SecretKeySpec(keyBytes, "AES");
|
||||||
|
|
@ -54,10 +49,10 @@ public class AESEncryption {
|
||||||
IvParameterSpec ivSpec = new IvParameterSpec(ivBytes);
|
IvParameterSpec ivSpec = new IvParameterSpec(ivBytes);
|
||||||
|
|
||||||
Cipher cipher = Cipher.getInstance(trans);
|
Cipher cipher = Cipher.getInstance(trans);
|
||||||
if(StringUtils.isAllBlank(ivString)){
|
if (StringUtils.isAllBlank(ivString)) {
|
||||||
cipher.init(Cipher.DECRYPT_MODE, keySpec);
|
cipher.init(Cipher.DECRYPT_MODE, keySpec);
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec);
|
cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -72,7 +67,6 @@ public class AESEncryption {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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];
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,98 @@
|
||||||
|
import android.app.Application;
|
||||||
|
import com.github.catvod.server.Server;
|
||||||
|
import com.github.catvod.spider.Init;
|
||||||
|
import com.github.catvod.spider.PanTa;
|
||||||
|
import com.github.catvod.utils.Json;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.GsonBuilder;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.robolectric.RobolectricTestRunner;
|
||||||
|
import org.robolectric.RuntimeEnvironment;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
@RunWith(RobolectricTestRunner.class)
|
||||||
|
public class PanTaTest {
|
||||||
|
|
||||||
|
private Application mockContext;
|
||||||
|
|
||||||
|
private PanTa spider;
|
||||||
|
|
||||||
|
@org.junit.Before
|
||||||
|
public void setUp() throws Exception {
|
||||||
|
mockContext = RuntimeEnvironment.application;
|
||||||
|
Init.init(mockContext);
|
||||||
|
spider = new PanTa();
|
||||||
|
Server.get().start();
|
||||||
|
spider.init(mockContext,"");
|
||||||
|
// spider.init(mockContext, "{\"cookie\":\"b-user-id=89ede34e-0efc-e1dd-c997-f16aaa792d0c; _UP_A4A_11_=wb9661c6dfb642f88f73d8e0c7edd398; b-user-id=89ede34e-0efc-e1dd-c997-f16aaa792d0c; ctoken=wla6p3EUOLyn1FSB8IKp1SEW; grey-id=5583e32b-39df-4bf0-f39f-1adf83f604a2; grey-id.sig=p8ReBIMG2BeZu1sYvsuOAZxYbx-MVrsfKEiCv87MsTM; isQuark=true; isQuark.sig=hUgqObykqFom5Y09bll94T1sS9abT1X-4Df_lzgl8nM; _UP_F7E_8D_=ZkyvVHnrBLp1A1NFJIjWi0PwKLOVbxJPcg0RzQPI6KmBtV6ZMgPh38l93pgubgHDQqhaZ2Sfc0qv%2BRantbfg1mWGAUpRMP4RqXP78Wvu%2FCfvkWWGc5NhCTV71tGOIGgDBR3%2Bu6%2Fjj44KlE5biSNDOWW7Bigcz27lvOTidzNw8s%2FWtKAIxWbnCzZn4%2FJMBUub1SIMcW89g57k4mfPmDlCgpZKzxwl6beSfdtZ4RUWXmZOn5v5NkxVKhU4wR0Pq7NklczEGdRq2nIAcu7v22Uw2o%2FxMY0xBdeC9Korm5%2FNHnxl6K%2Bd6FXSoT9a3XIMQO359auZPiZWzrNlZe%2BqnOahXcx7KAhQIRqSOapSmL4ygJor4r5isJhRuDoXy7vJAVuH%2FRDtEJJ8rZTq0BdC23Bz%2B0MrsdgbK%2BiW; _UP_D_=pc; __wpkreporterwid_=3d3f74a7-99b7-4916-3f78-911fc2eb9d87; tfstk=fIoZNxjnbhKwPOu0TWZ4LsaRqirTcudSSmNbnxD0C5VgClMm8xMyB-GsnSu4tjpOflAOmSD-9PNiGl120XrgkVNb1SrqHbJBN3tSBAEYoQOWVUUg9qZ8n1bGGkD3CqGYINKSBABhjnXgp3_Vywz6gSc0Syj3BWf0mr2DLW24eZfiiovEKWefj1q0swq3E82iNEMinMy7SLrcpA4Fh3z_ZAViCfih3PbtdW5N_DuU77AaTijmYRkL2Wq54ENoy5a7ZXxCbok33XzS7QSZgxD-oyoVsdGotql0p2dVu7umC4nLStbiLmParc4FELHrI-c0u2dPVRrs8zoZWKCnIbNZrlHfUCMUz2z8KyXVSlgSFmUojh58OzeqTzgwaGll4YCYKwctDV5coP2LL79eKHxpNTXHmre1kZU32JPWCR_AkP2LL79eLZQY-WeUNdw1.; __pus=2051c82285199d8be553be41dd5a2100AAQ+mmv35G4FDDZ5x+3Mhe2OMbNgweQ1ODbW8zDt9YuP1LQVqHUuAAz9KWLsPjpNtim0AVGHusN4MCosTmbq/khM; __kp=e6604120-6051-11ef-bfe4-c31b6cdd0766; __kps=AATcZArVgS76EPn0FMaV4HEj; __ktd=sii/iz4ePzEaoVirXul7QQ==; __uid=AATcZArVgS76EPn0FMaV4HEj; __itrace_wid=5829b95d-dac1-48d3-bfd5-f60cd9462786; __puus=7da0b96cb710fa1b376934485f977e05AATp/q8/QupT7IiBR1GWqZhxlIRT677smMvoHlLxQA0Lk6CkP0YJBOTl+p9DZgzlMz6w4hPXPgWsokukk8PW7ZfhFfPmv8tKMgLpCGLW+tk57luhNghmSdTeVPkAF59STtyCPBEtiNzNAd/zZJ6qILJDi5ywEBAAAg+gOyWHoLHNUR+QxeHRuQa8g5WWA95J8jebIlrr8rCvI1vjTbtiYktT\",\"token\":\"26fc6787afff43e78b78992e782502f1\"}");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@org.junit.Test
|
||||||
|
public void homeContent() throws Exception {
|
||||||
|
String content = spider.homeContent(true);
|
||||||
|
JsonObject map = Json.safeObject(content);
|
||||||
|
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||||
|
|
||||||
|
System.out.println("homeContent--" + gson.toJson(map));
|
||||||
|
|
||||||
|
//Assert.assertFalse(map.getAsJsonArray("list").isEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
|
@org.junit.Test
|
||||||
|
public void homeVideoContent() throws Exception {
|
||||||
|
String content = spider.homeVideoContent();
|
||||||
|
JsonObject map = Json.safeObject(content);
|
||||||
|
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||||
|
|
||||||
|
System.out.println("homeVideoContent--" + gson.toJson(map));
|
||||||
|
|
||||||
|
// Assert.assertFalse(map.getAsJsonArray("list").isEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
|
@org.junit.Test
|
||||||
|
public void categoryContent() throws Exception {
|
||||||
|
String content = spider.categoryContent("?tagId=39765285016165", "2", true, null);
|
||||||
|
JsonObject map = Json.safeObject(content);
|
||||||
|
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||||
|
System.out.println("categoryContent--" + gson.toJson(map));
|
||||||
|
Assert.assertFalse(map.getAsJsonArray("list").isEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
|
@org.junit.Test
|
||||||
|
public void detailContent() throws Exception {
|
||||||
|
|
||||||
|
String content = spider.detailContent(Arrays.asList("thread?topicId=147669"));
|
||||||
|
System.out.println("detailContent--" + content);
|
||||||
|
|
||||||
|
JsonObject map = Json.safeObject(content);
|
||||||
|
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||||
|
System.out.println("detailContent--" + gson.toJson(map));
|
||||||
|
Assert.assertFalse(map.getAsJsonArray("list").isEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
|
@org.junit.Test
|
||||||
|
public void playerContent() throws Exception {
|
||||||
|
String content = spider.playerContent("移动0", "FqijauTCWHB5yHIgvTglMzr-0MoIhFgie++2mknZaFTuu0p6", new ArrayList<>());
|
||||||
|
System.out.println("playerContent--" + content);
|
||||||
|
JsonObject map = Json.safeObject(content);
|
||||||
|
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||||
|
System.out.println("playerContent--" + gson.toJson(map));
|
||||||
|
Assert.assertFalse(map.getAsJsonPrimitive("url").getAsString().isEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
|
@org.junit.Test
|
||||||
|
public void searchContent() throws Exception {
|
||||||
|
String content = spider.searchContent("红", false);
|
||||||
|
JsonObject map = Json.safeObject(content);
|
||||||
|
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||||
|
System.out.println("searchContent--" + gson.toJson(map));
|
||||||
|
Assert.assertFalse(map.getAsJsonArray("list").isEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
import android.app.Application;
|
||||||
|
import com.github.catvod.server.Server;
|
||||||
|
import com.github.catvod.spider.Init;
|
||||||
|
import com.github.catvod.spider.YiDongYun;
|
||||||
|
import com.github.catvod.spider.Wogg;
|
||||||
|
import com.github.catvod.utils.Json;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.GsonBuilder;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.robolectric.RobolectricTestRunner;
|
||||||
|
import org.robolectric.RuntimeEnvironment;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
@RunWith(RobolectricTestRunner.class)
|
||||||
|
public class YiDongYunTest {
|
||||||
|
|
||||||
|
private Application mockContext;
|
||||||
|
|
||||||
|
private YiDongYun spider;
|
||||||
|
|
||||||
|
@org.junit.Before
|
||||||
|
public void setUp() throws Exception {
|
||||||
|
mockContext = RuntimeEnvironment.application;
|
||||||
|
Init.init(mockContext);
|
||||||
|
spider = new YiDongYun();
|
||||||
|
// spider.init(mockContext, "b-user-id=89ede34e-0efc-e1dd-c997-f16aaa792d0c; _UP_A4A_11_=wb9661c6dfb642f88f73d8e0c7edd398; b-user-id=89ede34e-0efc-e1dd-c997-f16aaa792d0c; ctoken=wla6p3EUOLyn1FSB8IKp1SEW; grey-id=5583e32b-39df-4bf0-f39f-1adf83f604a2; grey-id.sig=p8ReBIMG2BeZu1sYvsuOAZxYbx-MVrsfKEiCv87MsTM; isYiDongYun=true; isYiDongYun.sig=hUgqObykqFom5Y09bll94T1sS9abT1X-4Df_lzgl8nM; _UP_F7E_8D_=ZkyvVHnrBLp1A1NFJIjWi0PwKLOVbxJPcg0RzQPI6KmBtV6ZMgPh38l93pgubgHDQqhaZ2Sfc0qv%2BRantbfg1mWGAUpRMP4RqXP78Wvu%2FCfvkWWGc5NhCTV71tGOIGgDBR3%2Bu6%2Fjj44KlE5biSNDOWW7Bigcz27lvOTidzNw8s%2FWtKAIxWbnCzZn4%2FJMBUub1SIMcW89g57k4mfPmDlCgpZKzxwl6beSfdtZ4RUWXmZOn5v5NkxVKhU4wR0Pq7NklczEGdRq2nIAcu7v22Uw2o%2FxMY0xBdeC9Korm5%2FNHnxl6K%2Bd6FXSoT9a3XIMQO359auZPiZWzrNlZe%2BqnOahXcx7KAhQIRqSOapSmL4ygJor4r5isJhRuDoXy7vJAVuH%2FRDtEJJ8rZTq0BdC23Bz%2B0MrsdgbK%2BiW; _UP_D_=pc; __wpkreporterwid_=3d3f74a7-99b7-4916-3f78-911fc2eb9d87; tfstk=fIoZNxjnbhKwPOu0TWZ4LsaRqirTcudSSmNbnxD0C5VgClMm8xMyB-GsnSu4tjpOflAOmSD-9PNiGl120XrgkVNb1SrqHbJBN3tSBAEYoQOWVUUg9qZ8n1bGGkD3CqGYINKSBABhjnXgp3_Vywz6gSc0Syj3BWf0mr2DLW24eZfiiovEKWefj1q0swq3E82iNEMinMy7SLrcpA4Fh3z_ZAViCfih3PbtdW5N_DuU77AaTijmYRkL2Wq54ENoy5a7ZXxCbok33XzS7QSZgxD-oyoVsdGotql0p2dVu7umC4nLStbiLmParc4FELHrI-c0u2dPVRrs8zoZWKCnIbNZrlHfUCMUz2z8KyXVSlgSFmUojh58OzeqTzgwaGll4YCYKwctDV5coP2LL79eKHxpNTXHmre1kZU32JPWCR_AkP2LL79eLZQY-WeUNdw1.; __pus=2051c82285199d8be553be41dd5a2100AAQ+mmv35G4FDDZ5x+3Mhe2OMbNgweQ1ODbW8zDt9YuP1LQVqHUuAAz9KWLsPjpNtim0AVGHusN4MCosTmbq/khM; __kp=e6604120-6051-11ef-bfe4-c31b6cdd0766; __kps=AATcZArVgS76EPn0FMaV4HEj; __ktd=sii/iz4ePzEaoVirXul7QQ==; __uid=AATcZArVgS76EPn0FMaV4HEj; __itrace_wid=5829b95d-dac1-48d3-bfd5-f60cd9462786; __puus=7da0b96cb710fa1b376934485f977e05AATp/q8/QupT7IiBR1GWqZhxlIRT677smMvoHlLxQA0Lk6CkP0YJBOTl+p9DZgzlMz6w4hPXPgWsokukk8PW7ZfhFfPmv8tKMgLpCGLW+tk57luhNghmSdTeVPkAF59STtyCPBEtiNzNAd/zZJ6qILJDi5ywEBAAAg+gOyWHoLHNUR+QxeHRuQa8g5WWA95J8jebIlrr8rCvI1vjTbtiYktT");
|
||||||
|
// spider.init(mockContext, "_UP_A4A_11_=wb9681fbaed6454a8112f31e53b5c0be; __pus=45beefa93e8775c9211487d0c8ddd2b1AASCmV5S7LY0dfX90N3p4wU/G4f/oS0gZK6cpxZMZiDtXt9s7KiSs3tVZOXnIDel69C9KaQ61IQlnLYH2rS4NGjO; __kp=fe663a90-68d5-11ef-8b23-e77b0eaa352c; __kps=AAT32Fob+vq66znO5UHSHAPi; __ktd=39oXE+BT53YlFgUfFVq9kw==; __uid=AAT32Fob+vq66znO5UHSHAPi; xlly_s=1; b-user-id=91d551ad-db9e-f092-2b42-aa4db35b8ed0; isg=BNXVFRgkH_dXwTuJ8PizGl2W5NGP0onkjXrhLld60cybrvegHyMutYcsfLIYrqGc; tfstk=fNlSqGqmrgj57RpyCwL4hfk8bfFCODOw9waKS2CPJ7F-JWib0zWyEJ-IhDn42_P82ZEQ7caRpHf8M9aTxuFEUuzKc2nJry8uwiCY7PzLvzeLHsUUP6Ud9WQoncuOabJuT6NutWKwbCRZz4V39rUtZ-SukyUWT_U8JbtmmvxwbCR2eZFBVhkeml_RcyqYyzEdwENYSyFdv_nLD-UT7gFKvWLbHy4G2aCLJoUYJoEL9WnKkjXR5y97q4TY2O9qutVEyo1soja-eT0zc6CKGxw7XBrf96hbPqfsiZf6LlHg4RrtDI57OqUIcRkWf_iIJVDLhXsJzcnxdDUmnH6Qfv3rIj2RJT3jOuwtw-_9SVg8JDeInh1aP7kbCbMk-i3-buMTZ2764qwshR4YHw68aAuZtRhJNGq4IyibQYt1NcIzH1r_KcBClRfQll8Xl9Xh_6YQJFIaDQy8ozw2lEs-K8U0ll8Xl9X3er477ETf2vf..; __puus=514ad4334da84f912529719d557085b2AASV1aKJKLRXGjvHRfwQJ5gupjOzlxgeAImozKKYdppZduMrKS7Q5+3hUZZ0f6zk7YpAGu7p0GVPYojTpZdhvnamXzCBLryM3ULhlqkw9yR6oVeTr3b1MituYgqfeFM4jHi4ASNiLk22pCNKteAtD6aowAM0K1ZFVc7j7xlpxLEgS1CoNSttupAb56Zf+ruuTkDPsjZPiRW1S4yM/kduA247");
|
||||||
|
Server.get().start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@org.junit.Test
|
||||||
|
public void init() throws Exception {
|
||||||
|
// spider.init(mockContext, "b-user-id=89ede34e-0efc-e1dd-c997-f16aaa792d0c; _UP_A4A_11_=wb9661c6dfb642f88f73d8e0c7edd398; b-user-id=89ede34e-0efc-e1dd-c997-f16aaa792d0c; ctoken=wla6p3EUOLyn1FSB8IKp1SEW; grey-id=5583e32b-39df-4bf0-f39f-1adf83f604a2; grey-id.sig=p8ReBIMG2BeZu1sYvsuOAZxYbx-MVrsfKEiCv87MsTM; isYiDongYun=true; isYiDongYun.sig=hUgqObykqFom5Y09bll94T1sS9abT1X-4Df_lzgl8nM; _UP_F7E_8D_=ZkyvVHnrBLp1A1NFJIjWi0PwKLOVbxJPcg0RzQPI6KmBtV6ZMgPh38l93pgubgHDQqhaZ2Sfc0qv%2BRantbfg1mWGAUpRMP4RqXP78Wvu%2FCfvkWWGc5NhCTV71tGOIGgDBR3%2Bu6%2Fjj44KlE5biSNDOWW7Bigcz27lvOTidzNw8s%2FWtKAIxWbnCzZn4%2FJMBUub1SIMcW89g57k4mfPmDlCgpZKzxwl6beSfdtZ4RUWXmZOn5v5NkxVKhU4wR0Pq7NklczEGdRq2nIAcu7v22Uw2o%2FxMY0xBdeC9Korm5%2FNHnxl6K%2Bd6FXSoT9a3XIMQO359auZPiZWzrNlZe%2BqnOahXcx7KAhQIRqSOapSmL4ygJor4r5isJhRuDoXy7vJAVuH%2FRDtEJJ8rZTq0BdC23Bz%2B0MrsdgbK%2BiW; _UP_D_=pc; __wpkreporterwid_=3d3f74a7-99b7-4916-3f78-911fc2eb9d87; tfstk=fIoZNxjnbhKwPOu0TWZ4LsaRqirTcudSSmNbnxD0C5VgClMm8xMyB-GsnSu4tjpOflAOmSD-9PNiGl120XrgkVNb1SrqHbJBN3tSBAEYoQOWVUUg9qZ8n1bGGkD3CqGYINKSBABhjnXgp3_Vywz6gSc0Syj3BWf0mr2DLW24eZfiiovEKWefj1q0swq3E82iNEMinMy7SLrcpA4Fh3z_ZAViCfih3PbtdW5N_DuU77AaTijmYRkL2Wq54ENoy5a7ZXxCbok33XzS7QSZgxD-oyoVsdGotql0p2dVu7umC4nLStbiLmParc4FELHrI-c0u2dPVRrs8zoZWKCnIbNZrlHfUCMUz2z8KyXVSlgSFmUojh58OzeqTzgwaGll4YCYKwctDV5coP2LL79eKHxpNTXHmre1kZU32JPWCR_AkP2LL79eLZQY-WeUNdw1.; __pus=2051c82285199d8be553be41dd5a2100AAQ+mmv35G4FDDZ5x+3Mhe2OMbNgweQ1ODbW8zDt9YuP1LQVqHUuAAz9KWLsPjpNtim0AVGHusN4MCosTmbq/khM; __kp=e6604120-6051-11ef-bfe4-c31b6cdd0766; __kps=AATcZArVgS76EPn0FMaV4HEj; __ktd=sii/iz4ePzEaoVirXul7QQ==; __uid=AATcZArVgS76EPn0FMaV4HEj; __itrace_wid=5829b95d-dac1-48d3-bfd5-f60cd9462786; __puus=7da0b96cb710fa1b376934485f977e05AATp/q8/QupT7IiBR1GWqZhxlIRT677smMvoHlLxQA0Lk6CkP0YJBOTl+p9DZgzlMz6w4hPXPgWsokukk8PW7ZfhFfPmv8tKMgLpCGLW+tk57luhNghmSdTeVPkAF59STtyCPBEtiNzNAd/zZJ6qILJDi5ywEBAAAg+gOyWHoLHNUR+QxeHRuQa8g5WWA95J8jebIlrr8rCvI1vjTbtiYktT");
|
||||||
|
//Assert.assertFalse(map.getAsJsonArray("list").isEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
|
@org.junit.Test
|
||||||
|
public void detailContent() throws Exception {
|
||||||
|
|
||||||
|
String content = spider.detailContent(Arrays.asList("https://yun.139.com/shareweb/#/w/i/165CkRwb9G885"));
|
||||||
|
System.out.println("detailContent--" + content);
|
||||||
|
JsonObject map = Json.safeObject(content);
|
||||||
|
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||||
|
System.out.println("detailContent--" + gson.toJson(map));
|
||||||
|
Assert.assertFalse(map.getAsJsonArray("list").isEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
|
@org.junit.Test
|
||||||
|
public void playerContent() throws Exception {
|
||||||
|
|
||||||
|
String content = spider.playerContent("普画","41ea9a50cbdd4e50b019bcd78687ebc1++22fc6fa8350d22e0eaecc49035368e81++38c5e16d71f7++WFcYTmRhjJpKTui56aleYdzBZi9R203GERBVzYNxDxI=",new ArrayList<>());
|
||||||
|
System.out.println("playerContent--" + content);
|
||||||
|
JsonObject map = Json.safeObject(content);
|
||||||
|
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||||
|
System.out.println("playerContent--" + gson.toJson(map));
|
||||||
|
Assert.assertFalse(map.getAsJsonPrimitive("url").getAsString().isEmpty());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.github.catvod.api;
|
||||||
|
|
||||||
|
import com.github.catvod.bean.tianyi.ShareData;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.robolectric.RobolectricTestRunner;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RunWith(RobolectricTestRunner.class)
|
||||||
|
public class YunDriveTest {
|
||||||
|
YunDrive yunDrive;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp() {
|
||||||
|
yunDrive = new YunDrive();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void processShareData() throws Exception {
|
||||||
|
|
||||||
|
Map<String, List<Map<String, String>>> result = yunDrive.processShareData("https://yun.139.com/shareweb/#/w/i/165CkRwb9G885");
|
||||||
|
System.out.println(result);
|
||||||
|
for (String s : result.keySet()) {
|
||||||
|
for (Map<String, String> stringStringMap : result.get(s)) {
|
||||||
|
String playUrl = yunDrive.fetchPlayUrl(stringStringMap.get("contentId"),"");
|
||||||
|
System.out.println(stringStringMap.get("name")+":"+playUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getVod() throws Exception {
|
||||||
|
|
||||||
|
ShareData shareData1 = TianyiApi.get().getShareData("https://cloud.189.cn/web/share?code=qEVVjyqM7bY3(访问码:6iel)", "");
|
||||||
|
TianyiApi api = TianyiApi.get();
|
||||||
|
api.setCookie("{\"open.e.189.cn\":[{\"name\":\"SSON\",\"value\":\"dc466c8192e3109eaea837c1d136c1fd065253ce1c7d3a66ca1520d7d6d6307b10a1fe65c7becac73b95f24a6e681e654ec4f47c39533ebcc48bb78d6d6e63d1bbf3334e6e97eaa7092d34f87bf1209ee35f344871bc5a329eac34ae948d399d4a6b3b28a929c4f353ade0981657e9e0f09ce27cc1c15d8322c6e45a8ebb21eb431509f1dd7dc3a7856b32b0991d654d5ced73dd20b764ca8737600cbe699c37ccf59b3c610893fc42bdc08b477c5d394e290c14d175d1ca0ee9fa61a1a8dcac7007e9219fd0ae6ccd5dc760524213f85b6b8c6166af01a31336dab797d9118010b81a5a3c26e08e\",\"expiresAt\":253402300799999,\"domain\":\"e.189.cn\",\"path\":\"/\",\"secure\":true,\"httpOnly\":true,\"persistent\":true,\"hostOnly\":false},{\"name\":\"GUID\",\"value\":\"525d8874e53e46a7ba3ed8907e9fef1f\",\"expiresAt\":1775176321000,\"domain\":\"e.189.cn\",\"path\":\"/\",\"secure\":false,\"httpOnly\":false,\"persistent\":true,\"hostOnly\":false},{\"name\":\"pageOp\",\"value\":\"336b9ddc820212fa6c9b5a0cfd7bf5b3\",\"expiresAt\":253402300799999,\"domain\":\"e.189.cn\",\"path\":\"/\",\"secure\":false,\"httpOnly\":false,\"persistent\":false,\"hostOnly\":false},{\"name\":\"OPENINFO\",\"value\":\"33c28688ef52ce9e3a9ef87388047efbde5e3e2e4c7ef6ef267632468c7dfaf294ff59fa59d34801\",\"expiresAt\":253402300799999,\"domain\":\"e.189.cn\",\"path\":\"/\",\"secure\":false,\"httpOnly\":true,\"persistent\":false,\"hostOnly\":false},{\"name\":\"GRAYNUMBER\",\"value\":\"319DE3F68C8730862F3BEF66F3D635B7\",\"expiresAt\":1775177653000,\"domain\":\"e.189.cn\",\"path\":\"/\",\"secure\":false,\"httpOnly\":false,\"persistent\":true,\"hostOnly\":false}],\"cloud.189.cn\":[{\"name\":\"JSESSIONID\",\"value\":\"431787526C43DF21B6373E914FE597EC\",\"expiresAt\":253402300799999,\"domain\":\"cloud.189.cn\",\"path\":\"/\",\"secure\":false,\"httpOnly\":true,\"persistent\":false,\"hostOnly\":true},{\"name\":\"COOKIE_LOGIN_USER\",\"value\":\"0C7407F59A6E5896EB6B777056E160DB020BAE67B121B5930CCD4777073744055308F7E8CD03F2FC2399E4823F60ECDD74120CEE4C529017\",\"expiresAt\":253402300799999,\"domain\":\"cloud.189.cn\",\"path\":\"/\",\"secure\":false,\"httpOnly\":true,\"persistent\":false,\"hostOnly\":false}]}");
|
||||||
|
api.getVod(shareData1);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
f462c2e9c66246b7f7b47568724e20c7
|
5d9042b0b2af294ab9659fdd9c04faad
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://androidcatvodspider.netlify.app/jar/custom_spider.jar;md5;f462c2e9c66246b7f7b47568724e20c7",
|
"spider": "https://androidcatvodspider.netlify.app/jar/custom_spider.jar;md5;5d9042b0b2af294ab9659fdd9c04faad",
|
||||||
"lives": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "电视直播",
|
"name": "电视直播",
|
||||||
|
|
@ -129,6 +129,15 @@
|
||||||
"changeable": 1,
|
"changeable": 1,
|
||||||
"ext": "{\"site\": [\"https://mihdr.top/\"]}"
|
"ext": "{\"site\": [\"https://mihdr.top/\"]}"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"key": "PanTa",
|
||||||
|
"name": "盘他|Pan",
|
||||||
|
"type": 3,
|
||||||
|
"api": "csp_PanTa",
|
||||||
|
"searchable": 1,
|
||||||
|
"changeable": 1,
|
||||||
|
"ext": {}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"key": "KuaKeBa",
|
"key": "KuaKeBa",
|
||||||
"name": "夸克吧",
|
"name": "夸克吧",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://androidcatvodspider.netlify.app/jar/custom_spider.jar;md5;f462c2e9c66246b7f7b47568724e20c7",
|
"spider": "https://androidcatvodspider.netlify.app/jar/custom_spider.jar;md5;5d9042b0b2af294ab9659fdd9c04faad",
|
||||||
"lives": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "直播ipv6",
|
"name": "直播ipv6",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://androidcatvodspider.netlify.app/jar/custom_spider.jar;md5;f462c2e9c66246b7f7b47568724e20c7",
|
"spider": "https://androidcatvodspider.netlify.app/jar/custom_spider.jar;md5;5d9042b0b2af294ab9659fdd9c04faad",
|
||||||
"lives": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "直播ipv6",
|
"name": "直播ipv6",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://androidcatvodspider.netlify.app/jar/custom_spider.jar;md5;f462c2e9c66246b7f7b47568724e20c7",
|
"spider": "https://androidcatvodspider.netlify.app/jar/custom_spider.jar;md5;5d9042b0b2af294ab9659fdd9c04faad",
|
||||||
"lives": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "直播",
|
"name": "直播",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue