add - PushAgent XBiubiu1

This commit is contained in:
yangqiang3504
2022-08-19 16:36:49 +08:00
parent d287047af5
commit d3873b9c65
2 changed files with 15 additions and 19 deletions
@@ -453,17 +453,15 @@ public class PushAgent extends Spider {
Matcher matcher2 = pattern2.matcher(url); Matcher matcher2 = pattern2.matcher(url);
Matcher matcher = pattern.matcher(url); Matcher matcher = pattern.matcher(url);
if (Misc.isVip(url) && !url.contains("qq.com") && !url.contains("mgtv.com")) { if (Misc.isVip(url) && !url.contains("qq.com") && !url.contains("mgtv.com")) {
String typeName = "官源";
Document doc = Jsoup.parse(OkHttpUtil.string(url, null)); Document doc = Jsoup.parse(OkHttpUtil.string(url, null));
String VodName = doc.select("head > title").text(); String VodName = doc.select("head > title").text();
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
JSONArray lists = new JSONArray(); JSONArray lists = new JSONArray();
JSONObject vodAtom = new JSONObject(); JSONObject vodAtom = new JSONObject();
if(url.contains("iqiyi")) typeName = "爱奇艺";
vodAtom.put("vod_id", url); vodAtom.put("vod_id", url);
vodAtom.put("vod_name", VodName); vodAtom.put("vod_name", VodName);
vodAtom.put("vod_pic", "https://img.zcool.cn/community/0123545c74c5aea801213f261297df.png"); vodAtom.put("vod_pic", "https://img.zcool.cn/community/0123545c74c5aea801213f261297df.png");
vodAtom.put("type_name", typeName); vodAtom.put("type_name", "官源");
vodAtom.put("vod_year", ""); vodAtom.put("vod_year", "");
vodAtom.put("vod_area", ""); vodAtom.put("vod_area", "");
vodAtom.put("vod_remarks", ""); vodAtom.put("vod_remarks", "");
@@ -486,16 +484,13 @@ public class PushAgent extends Spider {
if (!playListA.isEmpty()) { if (!playListA.isEmpty()) {
for (int j = 0; j < playListA.size(); j++) { for (int j = 0; j < playListA.size(); j++) {
Element vod = playListA.get(j); Element vod = playListA.get(j);
String img = vod.select("img").attr("src"); String a = vod.select("div").attr("data-vid");
if(img.equals("")||!img.contains("trailerlite")){ String b = vod.select("div").attr("data-cid");
String a = vod.select("div").attr("data-vid"); String id = "https://v.qq.com/x/cover/" + b + "/" + a;
String b = vod.select("div").attr("data-cid"); String name = vod.select("div span").text();
String id = "https://v.qq.com/x/cover/" + b + "/" + a + ".html"; vodItems.add(name + "$" + id);
String name = vod.select("div span").text();
vodItems.add(name + "$" + id);
}
} }
String playList = com.github.catvod.utils.TextUtils.join("#", vodItems); String playList = TextUtils.join("#", vodItems);
vodAtom.put("vod_play_url", playList); vodAtom.put("vod_play_url", playList);
} else { } else {
vodAtom.put("vod_play_url", "立即播放$" + url); vodAtom.put("vod_play_url", "立即播放$" + url);
@@ -530,9 +525,7 @@ public class PushAgent extends Spider {
if (a.length() > 0) { if (a.length() > 0) {
for (int i = 0; i < a.length(); i++) { for (int i = 0; i < a.length(); i++) {
JSONObject jObj = a.getJSONObject(i); JSONObject jObj = a.getJSONObject(i);
String isnew = jObj.getString("isnew"); if (jObj.getString("isIntact").equals("1")) {
String isvip = jObj.getString("isvip");
if (!(isnew.equals("2")&&isvip.equals("0"))) {
String VodName = jObj.getString("t4"); String VodName = jObj.getString("t4");
String id = jObj.getString("video_id"); String id = jObj.getString("video_id");
String VodId = "https://www.mgtv.com/b/" + mgtv1.group(1) + "/" + id + ".html"; String VodId = "https://www.mgtv.com/b/" + mgtv1.group(1) + "/" + id + ".html";
@@ -13,9 +13,9 @@ import java.security.NoSuchAlgorithmException;
import java.util.regex.Pattern; import java.util.regex.Pattern;
public class Misc { public class Misc {
public static final String MoAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36"; public static final String UaWinChrome = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36";
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 UaWinChrome = "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 boolean isVip(String url) { public static boolean isVip(String url) {
// 适配2.0.6的调用应用内解析列表的支持, 需要配合直连分析一起使用,参考cjt影视和极品直连 // 适配2.0.6的调用应用内解析列表的支持, 需要配合直连分析一起使用,参考cjt影视和极品直连
@@ -43,9 +43,12 @@ public class Misc {
return false; return false;
} }
public HashMap<String, String> Headers() { public static HashMap<String, String> Headers(int type) {
HashMap<String, String> headers = new HashMap<>(); HashMap<String, String> headers = new HashMap<>();
headers.put("User-Agent", MoAgent); if(type==0){
headers.put("User-Agent", UaWinChrome);
}else headers.put("User-Agent", MoAgent);
headers.put("Connection", " Keep-Alive"); headers.put("Connection", " Keep-Alive");
return headers; return headers;
} }