add - 详情页播放6690

This commit is contained in:
yangqiang3504
2022-09-06 11:22:06 +08:00
parent 2ffcc76b2e
commit 8ee5c11a20
5 changed files with 18 additions and 24 deletions
@@ -35,9 +35,11 @@ public class PushAgent extends Spider {
private static final Map<String, Map<String, String>> dizz = new HashMap(); private static final Map<String, Map<String, String>> dizz = new HashMap();
private static final ReentrantLock ReentrantLock = new ReentrantLock(); private static final ReentrantLock ReentrantLock = new ReentrantLock();
private static final long n = 0; private static final long n = 0;
public static Integer type=1;
private static final String SiteUrl = "https://api.aliyundrive.com"; private static final String SiteUrl = "https://api.aliyundrive.com";
private static final Pattern AliPLink = Pattern.compile("(https://www.aliyundrive.com/s/[^\"]+)"); private static final Pattern AliPLink = Pattern.compile("(https://www.aliyundrive.com/s/[^\"]+)");
public static Pattern Folder = Pattern.compile("www.aliyundrive.com/s/([^/]+)(/folder/([^/]+))?"); public static Pattern Folder = Pattern.compile("www.aliyundrive.com/s/([^/]+)(/folder/([^/]+))?");
public static String Token="http://catvod.fun:8001/tv/ali.txt";
public static JSONObject siteRule = null; public static JSONObject siteRule = null;
@Override @Override
@@ -53,8 +55,8 @@ public class PushAgent extends Spider {
public static void getToken(String token){ public static void getToken(String token){
if (token.startsWith("http")) { if (token.startsWith("http")) {
Misc.Token = OkHttpUtil.string(token, null); Token = OkHttpUtil.string(token, null);
}else Misc.Token = token; }else Token = token;
} }
public static JSONObject fetchRule(boolean flag,int t) { public static JSONObject fetchRule(boolean flag,int t) {
@@ -73,7 +75,7 @@ public class PushAgent extends Spider {
if(!tk.equals("")){ if(!tk.equals("")){
getToken(tk); getToken(tk);
} }
Misc.type = siteRule.optInt("ua", 1); type = siteRule.optInt("ua", 1);
} }
return jo; return jo;
} }
@@ -224,7 +226,7 @@ public class PushAgent extends Spider {
if (str.isEmpty() || StopRefresh - b <= 600) { if (str.isEmpty() || StopRefresh - b <= 600) {
try { try {
JSONObject jSONObject = new JSONObject(); JSONObject jSONObject = new JSONObject();
jSONObject.put("refresh_token", Misc.Token); jSONObject.put("refresh_token", Token);
String jSONObject2 = jSONObject.toString(); String jSONObject2 = jSONObject.toString();
HashMap<String, String> t = Headers(); HashMap<String, String> t = Headers();
JSONObject jSONObject3 = new JSONObject(Post("https://api.aliyundrive.com/token/refresh", jSONObject2, t)); JSONObject jSONObject3 = new JSONObject(Post("https://api.aliyundrive.com/token/refresh", jSONObject2, t));
@@ -469,7 +471,7 @@ public class PushAgent extends Spider {
} }
String join2 = TextUtils.join("$$$", arrayList3); String join2 = TextUtils.join("$$$", arrayList3);
jSONObject6.put("vod_play_url", join2); jSONObject6.put("vod_play_url", join2);
jSONObject6.put("vod_area", Misc.type + Misc.Token); jSONObject6.put("vod_area", type + Token);
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
JSONArray jSONArray2 = new JSONArray(); JSONArray jSONArray2 = new JSONArray();
jSONArray2.put(jSONObject6); jSONArray2.put(jSONObject6);
@@ -514,9 +516,11 @@ public class PushAgent extends Spider {
JSONArray lists = new JSONArray(); JSONArray lists = new JSONArray();
String typeName = Misc.getWebName(url, 0); String typeName = Misc.getWebName(url, 0);
JSONObject vodAtom = new JSONObject(); JSONObject vodAtom = new JSONObject();
vodAtom.put("vod_id", url);
vodAtom.put("vod_pic", pic); vodAtom.put("vod_pic", pic);
vodAtom.put("type_name", typeName); vodAtom.put("type_name", typeName);
vodAtom.put("vod_content", url); vodAtom.put("vod_content", url);
vodAtom.put("vod_area", type + Token);
if (Misc.isVip(url) && !url.contains("qq.com") && !url.contains("mgtv.com")) { if (Misc.isVip(url) && !url.contains("qq.com") && !url.contains("mgtv.com")) {
Elements playListA = null; Elements playListA = null;
Document doc = Jsoup.parse(OkHttpUtil.string(url, Misc.Headers(0,url))); Document doc = Jsoup.parse(OkHttpUtil.string(url, Misc.Headers(0,url)));
@@ -541,9 +545,8 @@ public class PushAgent extends Spider {
} else { } else {
vodAtom.put("vod_play_url", "立即播放$" + url); vodAtom.put("vod_play_url", "立即播放$" + url);
} }
if(VodName!=null) VodName = doc.select("head > title").text(); VodName = doc.select("head > title").text();
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
vodAtom.put("vod_id", TextUtils.join("###", idInfo));
vodAtom.put("vod_name", VodName); vodAtom.put("vod_name", VodName);
vodAtom.put("vod_play_from", "jx"); vodAtom.put("vod_play_from", "jx");
lists.put(vodAtom); lists.put(vodAtom);
@@ -557,7 +560,7 @@ public class PushAgent extends Spider {
url = "https://v.qq.com/x/cover/" + cid + "/" + vid + ".html"; url = "https://v.qq.com/x/cover/" + cid + "/" + vid + ".html";
} }
Document doc = Jsoup.parse(OkHttpUtil.string(url, sHeaders(true))); Document doc = Jsoup.parse(OkHttpUtil.string(url, sHeaders(true)));
if(VodName!=null) VodName = doc.select("head > title").text(); VodName = doc.select("head > title").text();
Elements playListA = doc.select("div.episode-list-rect__item"); Elements playListA = doc.select("div.episode-list-rect__item");
if (playListA.isEmpty()) { if (playListA.isEmpty()) {
playListA = doc.select("div.episode-list-hor .episode-item"); playListA = doc.select("div.episode-list-hor .episode-item");
@@ -581,8 +584,6 @@ public class PushAgent extends Spider {
} }
String remarks = doc.select(".intro-wrapper__update-desc").text(); String remarks = doc.select(".intro-wrapper__update-desc").text();
idInfo[0] = url;
vodAtom.put("vod_id", TextUtils.join("###", idInfo));
vodAtom.put("vod_name", VodName); vodAtom.put("vod_name", VodName);
vodAtom.put("vod_remarks", remarks); vodAtom.put("vod_remarks", remarks);
vodAtom.put("vod_play_from", "jx"); vodAtom.put("vod_play_from", "jx");
@@ -596,7 +597,7 @@ public class PushAgent extends Spider {
if (mgtv1.find()) { if (mgtv1.find()) {
String Ep = "https://pcweb.api.mgtv.com/episode/list?video_id=" + mgtv1.group(2); String Ep = "https://pcweb.api.mgtv.com/episode/list?video_id=" + mgtv1.group(2);
JSONObject Data = new JSONObject(OkHttpUtil.string(Ep, Headers())); JSONObject Data = new JSONObject(OkHttpUtil.string(Ep, Headers()));
if(VodName!=null) VodName = Data.getJSONObject("data").getJSONObject("info").getString("title"); VodName = Data.getJSONObject("data").getJSONObject("info").getString("title");
JSONArray a = new JSONArray(Data.getJSONObject("data").getString("list")); JSONArray a = new JSONArray(Data.getJSONObject("data").getString("list"));
if (a.length() > 0) { if (a.length() > 0) {
for (int i = 0; i < a.length(); i++) { for (int i = 0; i < a.length(); i++) {
@@ -616,7 +617,6 @@ public class PushAgent extends Spider {
vodAtom.put("vod_play_url", "立即播放$" + url); vodAtom.put("vod_play_url", "立即播放$" + url);
} }
} }
vodAtom.put("vod_id", TextUtils.join("###", idInfo));
vodAtom.put("vod_name", VodName); vodAtom.put("vod_name", VodName);
vodAtom.put("vod_play_from", "jx"); vodAtom.put("vod_play_from", "jx");
lists.put(vodAtom); lists.put(vodAtom);
@@ -624,7 +624,6 @@ public class PushAgent extends Spider {
return result.toString(); return result.toString();
} else if (Misc.isVideoFormat(url)) { } else if (Misc.isVideoFormat(url)) {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
vodAtom.put("vod_id", TextUtils.join("###", idInfo));
vodAtom.put("vod_name", typeName); vodAtom.put("vod_name", typeName);
vodAtom.put("type_name", "直连"); vodAtom.put("type_name", "直连");
vodAtom.put("vod_play_from", "player"); vodAtom.put("vod_play_from", "player");
@@ -638,7 +637,6 @@ public class PushAgent extends Spider {
VodName = url.substring(0, 30) + "..." + url.substring(url.length() - 10); VodName = url.substring(0, 30) + "..." + url.substring(url.length() - 10);
} }
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
vodAtom.put("vod_id", TextUtils.join("###", idInfo));
vodAtom.put("vod_name", VodName); vodAtom.put("vod_name", VodName);
vodAtom.put("type_name", "磁力"); vodAtom.put("type_name", "磁力");
vodAtom.put("vod_play_from", "磁力测试"); vodAtom.put("vod_play_from", "磁力测试");
@@ -647,6 +645,7 @@ public class PushAgent extends Spider {
result.put("list", lists); result.put("list", lists);
return result.toString(); return result.toString();
} else if (url.startsWith("http") && (matcher2.find())) { } else if (url.startsWith("http") && (matcher2.find())) {
if(VodName!=null) vodAtom.put("vod_name", VodName);
vodAtom.put("vod_id", TextUtils.join("###", idInfo)); vodAtom.put("vod_id", TextUtils.join("###", idInfo));
return getAliContent(url,vodAtom); return getAliContent(url,vodAtom);
} else if (url.startsWith("http") && (!matcher.find()) && (!matcher2.find())) { } else if (url.startsWith("http") && (!matcher.find()) && (!matcher2.find())) {
@@ -836,14 +835,14 @@ public class PushAgent extends Spider {
result.put("playUrl", ""); result.put("playUrl", "");
if(id.contains("bilibili")){ if(id.contains("bilibili")){
result.put("header", Misc.jHeaders(0,id).toString()); result.put("header", Misc.jHeaders(0,id).toString());
} else result.put("header", Misc.jHeaders(Misc.type,id).toString()); } else result.put("header", Misc.jHeaders(type,id).toString());
return result.toString(); return result.toString();
} }
case "player": { case "player": {
result.put("parse", 0); result.put("parse", 0);
result.put("playUrl", ""); result.put("playUrl", "");
result.put("url", id); result.put("url", id);
result.put("header", Misc.jHeaders(Misc.type,id).toString()); result.put("header", Misc.jHeaders(type,id).toString());
return result.toString(); return result.toString();
} }
case "AliYun": case "AliYun":
@@ -879,7 +878,7 @@ public class PushAgent extends Spider {
result.put("parse", 1); result.put("parse", 1);
result.put("playUrl", ""); result.put("playUrl", "");
result.put("url", id); result.put("url", id);
result.put("header", Misc.jHeaders(Misc.type,id).toString()); result.put("header", Misc.jHeaders(type,id).toString());
return result.toString(); return result.toString();
} }
} catch (Exception e) { } catch (Exception e) {
@@ -22,7 +22,6 @@ public class PushAgentQQ extends Spider {
Misc.jsonUrl = extend; Misc.jsonUrl = extend;
} }
} }
PushAgent.fetchRule(false,0);
} }
@Override @Override
@@ -137,9 +136,9 @@ public class PushAgentQQ extends Spider {
@Override @Override
public String searchContent(String key, boolean quick) { public String searchContent(String key, boolean quick) {
if (key.equals("000")) { if (key.equals("000")) {
Misc.type=0; PushAgent.type=0;
}if (key.equals("111")) { }if (key.equals("111")) {
Misc.type=1; PushAgent.type=1;
} }
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
JSONArray videos = new JSONArray(); JSONArray videos = new JSONArray();
@@ -16,7 +16,6 @@ public class Upyunso extends Spider {
@Override @Override
public void init(Context context, String extend) { public void init(Context context, String extend) {
super.init(context, extend); super.init(context, extend);
PushAgent.fetchRule(false,0);
} }
@Override @Override
@@ -26,7 +26,6 @@ public class XBiubiu extends Spider {
@Override @Override
public void init(Context context) { public void init(Context context) {
super.init(context); super.init(context);
PushAgent.fetchRule(false,0);
} }
public void init(Context context, String extend) { public void init(Context context, String extend) {
@@ -16,8 +16,6 @@ public class Misc {
public static final String DeAgent = "Dalvik/2.1.0 (Linux; U; Android " + Build.VERSION.RELEASE + "; " + Build.MODEL + " Build/" + Build.ID + ")"; public static final String DeAgent = "Dalvik/2.1.0 (Linux; U; Android " + Build.VERSION.RELEASE + "; " + Build.MODEL + " Build/" + Build.ID + ")";
public static final String MoAgent = "Mozilla/5.0 (Linux; Android 11; Ghxi Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 Mobile Safari/537.36 T7/12.16 SearchCraft/3.9.1 (Baidu; P1 11)"; public static final String MoAgent = "Mozilla/5.0 (Linux; Android 11; Ghxi Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 Mobile Safari/537.36 T7/12.16 SearchCraft/3.9.1 (Baidu; P1 11)";
public static String jsonUrl = "http://test.xinjun58.com/sp/d.json"; public static String jsonUrl = "http://test.xinjun58.com/sp/d.json";
public static String Token="http://catvod.fun:8001/tv/ali.txt";
public static Integer type=1;
public static boolean isVip(String url) { public static boolean isVip(String url) {
// 适配2.0.6的调用应用内解析列表的支持, 需要配合直连分析一起使用,参考cjt影视和极品直连 // 适配2.0.6的调用应用内解析列表的支持, 需要配合直连分析一起使用,参考cjt影视和极品直连
try { try {