add - douban 格式
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
package com.github.catvod.spider;
|
||||
|
||||
import android.content.Context;
|
||||
import com.github.catvod.crawler.Spider;
|
||||
import com.github.catvod.utils.okhttp.OkHttpUtil;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
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.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
||||
public class AliPS extends Spider {
|
||||
private PushAgent pushAgent;
|
||||
private static String b = "https://www.alipansou.com";
|
||||
private static Pattern a = Pattern.compile("(https:\\/\\/www.aliyundrive.com\\/s\\/[^\\\"]+)");
|
||||
|
||||
@Override
|
||||
public void init(Context context, String extend) {
|
||||
super.init(context, extend);
|
||||
pushAgent = new PushAgent();
|
||||
pushAgent.init(context, extend);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String detailContent(List<String> list) {
|
||||
try {
|
||||
return pushAgent.detailContent(list);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String playerContent(String str, String str2, List<String> list) {
|
||||
return pushAgent.playerContent(str, str2, list);
|
||||
}
|
||||
|
||||
protected static HashMap<String, String> sHeaders() {
|
||||
HashMap<String, String> headers = new HashMap<>();
|
||||
headers.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.62 Safari/537.36");
|
||||
return headers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String searchContent(String key, boolean z) {
|
||||
try {
|
||||
HashMap hashMap = new HashMap();
|
||||
hashMap.put("7", "文件夹");
|
||||
hashMap.put("1", "视频");
|
||||
JSONArray jSONArray = new JSONArray();
|
||||
Iterator entries = hashMap.entrySet().iterator();
|
||||
String dx = null, pic = "https://inews.gtimg.com/newsapp_bt/0/13263837859/1000", title = "";
|
||||
while (entries.hasNext()) {
|
||||
Map.Entry entry = (Map.Entry) entries.next();
|
||||
String sb2 = b + "/search?k=" + URLEncoder.encode(key) + "&t=" + (String) entry.getKey();
|
||||
Document doc = Jsoup.parse(OkHttpUtil.string(sb2, sHeaders()));
|
||||
Elements Data = doc.select("van-row a");
|
||||
for (int i = 0; i < Data.size(); i++) {
|
||||
Element next = Data.get(i);
|
||||
String filename = next.select("template div").text();
|
||||
Pattern pattern = Pattern.compile("(时间: \\S+)");
|
||||
Matcher matcher = pattern.matcher(filename);
|
||||
if (!matcher.find())
|
||||
continue;
|
||||
String remark = matcher.group(1);
|
||||
remark = remark.replace("时间: ", "");
|
||||
if (filename.contains(key)) {
|
||||
JSONObject v = new JSONObject();
|
||||
String id = b + next.attr("href");
|
||||
//[视频]第十九集 琉璃世界白雪红梅.mp4 时间: 2021-12-07 格式: mp4 大小: 6.2G
|
||||
title = filename.replaceAll(" 时间: .*", "");
|
||||
if (filename.contains("大小")) {
|
||||
dx = filename.replaceAll(".*大小: (.*)", "$1");
|
||||
remark = remark + " " + dx;
|
||||
}
|
||||
v.put("vod_id", id + "$$$" + pic + "$$$" + title);
|
||||
v.put("vod_name", title);
|
||||
v.put("remark", remark);
|
||||
v.put("vod_pic", pic);
|
||||
jSONArray.put(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
JSONObject jSONObject2 = new JSONObject();
|
||||
jSONObject2.put("list", jSONArray);
|
||||
return jSONObject2.toString();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -280,7 +280,7 @@ public class PushAgent extends Spider {
|
||||
if (vod.contains("x-oss-expires")) {
|
||||
j++;
|
||||
video.put("" + j, site + vod);
|
||||
vod = Proxy.localProxyUrl() + "?do=push&type=media&share_id=" + shareId + "&file_id=" + fileId + "&media_id=" + j;
|
||||
vod = Proxy.localProxyUrl() + "?do=ali&type=media&share_id=" + shareId + "&file_id=" + fileId + "&media_id=" + j;
|
||||
}
|
||||
lists.add(vod);
|
||||
}
|
||||
@@ -313,8 +313,7 @@ public class PushAgent extends Spider {
|
||||
jSONObject3.put("expire_sec", 600);
|
||||
jSONObject3.put("file_id", fileId);
|
||||
jSONObject3.put("share_id", shareId);
|
||||
}
|
||||
if (category.equals("audio")) {
|
||||
}else if (category.equals("audio")) {
|
||||
jSONObject3.put("share_id", shareId);
|
||||
jSONObject3.put("get_audio_play_info", true);
|
||||
jSONObject3.put("file_id", fileId);
|
||||
@@ -433,7 +432,7 @@ public class PushAgent extends Spider {
|
||||
playLists.add(TextUtils.join("#", vodItems));
|
||||
playLists.add(TextUtils.join("#", vodItems));
|
||||
vodAtom.put("vod_play_url", TextUtils.join("$$$", playLists));
|
||||
vodAtom.put("vod_play_from", "4K原画$$$AliYun");
|
||||
vodAtom.put("vod_play_from", "AliYun$$$4K原画");
|
||||
}
|
||||
JSONObject result = new JSONObject();
|
||||
JSONArray list = new JSONArray();
|
||||
@@ -456,7 +455,7 @@ public class PushAgent extends Spider {
|
||||
String url = list.get(0).trim();
|
||||
String[] idInfo = url.split("\\$\\$\\$");
|
||||
if (idInfo.length > 0) url = idInfo[0].trim();
|
||||
url = Upyunso.getRealUrl(url);
|
||||
url = Misc.getRealUrl(url);
|
||||
String pic = null;
|
||||
if (idInfo.length>1&&!idInfo[1].equals("")) {
|
||||
pic = idInfo[1].trim();
|
||||
@@ -821,7 +820,7 @@ public class PushAgent extends Spider {
|
||||
String[] split = id.split("\\+");
|
||||
String str3 = split[0];
|
||||
String str5 = split[2];
|
||||
String url = Proxy.localProxyUrl() + "?do=push&type=m3u8&share_id=" + str3 + "&file_id=" + str5;
|
||||
String url = Proxy.localProxyUrl() + "?do=ali&type=m3u8&share_id=" + str3 + "&file_id=" + str5;
|
||||
result.put("parse", "0");
|
||||
result.put("playUrl", "");
|
||||
result.put("url", url);
|
||||
|
||||
@@ -1,16 +1,41 @@
|
||||
package com.github.catvod.spider;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.github.catvod.crawler.Spider;
|
||||
import com.github.catvod.crawler.SpiderDebug;
|
||||
import com.github.catvod.utils.okhttp.OkHttpUtil;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class Yiso extends PushAgent {
|
||||
private static final Pattern aliyun = Pattern.compile("(https://www.aliyundrive.com/s/[^\"]+)");
|
||||
public class Yiso extends Spider {
|
||||
private PushAgent pushAgent;
|
||||
|
||||
public String detailContent(List<String> list) {
|
||||
try {
|
||||
return pushAgent.detailContent(list);
|
||||
} catch (Exception e) {
|
||||
SpiderDebug.log(e);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
super.init(context);
|
||||
pushAgent = new PushAgent();
|
||||
pushAgent.init(context);
|
||||
}
|
||||
|
||||
public String playerContent(String str, String str2, List<String> list) {
|
||||
return pushAgent.playerContent(str, str2, list);
|
||||
}
|
||||
|
||||
protected static HashMap<String, String> sHeaders() {
|
||||
HashMap<String, String> headers = new HashMap<>();
|
||||
@@ -30,7 +55,7 @@ public class Yiso extends PushAgent {
|
||||
String content = OkHttpUtil.string(url, LT);
|
||||
JSONObject data = new JSONObject(content);
|
||||
JSONArray list = data.getJSONObject("data").getJSONArray("list");
|
||||
|
||||
String cover = "https://f.haocew.com/image/tv/yiso.jpg";
|
||||
JSONObject result = new JSONObject();
|
||||
JSONArray videos = new JSONArray();
|
||||
for (int i = 0; i < list.length(); i++) {
|
||||
@@ -40,7 +65,6 @@ public class Yiso extends PushAgent {
|
||||
String id = jSONObject.getString("url");
|
||||
|
||||
JSONObject v = new JSONObject();
|
||||
String cover = "https://f.haocew.com/image/tv/yiso.jpg";
|
||||
v.put("vod_name", sourceName);
|
||||
v.put("vod_remarks", remark);
|
||||
v.put("vod_id", id + "$$$" + cover + "$$$" + sourceName);
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.github.catvod.spider;
|
||||
|
||||
import android.content.Context;
|
||||
import com.github.catvod.crawler.Spider;
|
||||
import com.github.catvod.crawler.SpiderDebug;
|
||||
import com.github.catvod.utils.okhttp.OkHttpUtil;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
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.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
||||
public class Zhaozy extends Spider {
|
||||
private PushAgent pushAgent;
|
||||
private static String b = "https://zhaoziyuan.me/";
|
||||
@Override
|
||||
public void init(Context context, String str) {
|
||||
super.init(context, str);
|
||||
pushAgent = new PushAgent();
|
||||
pushAgent.init(context, str);
|
||||
}
|
||||
@Override
|
||||
public String detailContent(List<String> list) {
|
||||
try {
|
||||
return pushAgent.detailContent(list);
|
||||
} catch (Exception e) {
|
||||
SpiderDebug.log(e);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
public String playerContent(String str, String str2, List<String> list) {
|
||||
return pushAgent.playerContent(str, str2, list);
|
||||
}
|
||||
|
||||
private Pattern regexVid = Pattern.compile("(\\S+)");
|
||||
|
||||
@Override
|
||||
public String searchContent(String key, boolean quick) {
|
||||
try {
|
||||
String url = "https://zhaoziyuan.me/so?filename=" + URLEncoder.encode(key);
|
||||
Document docs = Jsoup.parse(OkHttpUtil.string(url, null));
|
||||
JSONObject result = new JSONObject();
|
||||
JSONArray videos = new JSONArray();
|
||||
Elements list = docs.select("div.li_con div.news_text");
|
||||
String pic = "https://inews.gtimg.com/newsapp_bt/0/13263837859/1000";
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Element doc = list.get(i);
|
||||
String title = doc.select("div.news_text a h3").text();
|
||||
if (title.contains(key)) {
|
||||
String list1 = doc.select("div.news_text a").attr("href");
|
||||
Matcher matcher = regexVid.matcher(list1);
|
||||
if (matcher.find()) {
|
||||
JSONObject v = new JSONObject();
|
||||
String id = b + matcher.group(1);
|
||||
String remark = doc.select("div.news_text a p").text();
|
||||
//类别:文件夹 | 收录时间:2022-10-08 22:51
|
||||
remark = remark.replaceAll(".*收录时间:(.*)", "$1");
|
||||
v.put("vod_id", id + "$$$" + pic + "$$$" + title);
|
||||
v.put("vod_name", title);
|
||||
v.put("vod_pic", pic);
|
||||
v.put("vod_remarks", remark);
|
||||
videos.put(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
result.put("list", videos);
|
||||
return result.toString();
|
||||
} catch (Exception e) {
|
||||
SpiderDebug.log(e);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package com.github.catvod.utils;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import com.github.catvod.crawler.SpiderDebug;
|
||||
import com.github.catvod.spider.PushAgent;
|
||||
import com.github.catvod.parser.Base64Utils;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import java.util.ArrayList;
|
||||
@@ -17,12 +17,13 @@ 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 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";
|
||||
private static String a = "(https:\\/\\/www.aliyundrive.com\\/s\\/[^\\\"]+)";
|
||||
public static String refreshToken="";
|
||||
public static JSONObject siteRule = null;
|
||||
public static Integer type=1;
|
||||
public static String btype="N";
|
||||
public static boolean rflag = false;
|
||||
public static String apikey = "0ac44ae016490db2204ce0a042db2916";
|
||||
public static String apikey = "0ac44ae016490db2204ce0a042db2916";//豆瓣key
|
||||
public static boolean isVip(String url) {
|
||||
// 适配2.0.6的调用应用内解析列表的支持, 需要配合直连分析一起使用,参考cjt影视和极品直连
|
||||
try {
|
||||
@@ -279,6 +280,19 @@ public class Misc {
|
||||
}
|
||||
return regexStr;
|
||||
}
|
||||
|
||||
public static String getRealUrl(String url){
|
||||
if (url.contains("upyunso.com/download")) {
|
||||
url = Base64Utils.sendGet(url);
|
||||
} else if (url.contains("alipansou") || url.contains("zhaoziyuan")) {
|
||||
Matcher matcher = matcher(a, OkHttpUtil.string(url, null));
|
||||
if (!matcher.find()) {
|
||||
return "";
|
||||
}
|
||||
url = matcher.group(1).replaceAll("\\\\", "");
|
||||
}
|
||||
return url;
|
||||
}
|
||||
public static String tip(){
|
||||
if (rflag) {
|
||||
String text = btype + type + refreshToken;
|
||||
|
||||
Reference in New Issue
Block a user