add - douban yiso0-21
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
package com.github.catvod.spider;
|
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.crawler.SpiderDebug;
|
||||||
import com.github.catvod.utils.Misc;
|
import com.github.catvod.utils.Misc;
|
||||||
import com.github.catvod.utils.okhttp.OkHttpUtil;
|
import com.github.catvod.utils.okhttp.OkHttpUtil;
|
||||||
@@ -10,9 +8,8 @@ import org.json.JSONException;
|
|||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class PushAgentQQ extends Spider {
|
public class PushAgentQQ extends PushAgent {
|
||||||
private static String douban_api_host = "https://frodo.douban.com/api/v2";
|
private static String douban_api_host = "https://frodo.douban.com/api/v2";
|
||||||
public static JSONObject getUrls(){
|
public static JSONObject getUrls(){
|
||||||
String _urls = "{" +
|
String _urls = "{" +
|
||||||
@@ -124,19 +121,6 @@ public class PushAgentQQ extends Spider {
|
|||||||
return jSONArray;
|
return jSONArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected JSONObject rule = null;
|
|
||||||
@Override
|
|
||||||
public void init(Context context, String extend) {
|
|
||||||
super.init(context, extend);
|
|
||||||
if (extend != null && !extend.equals("")) {
|
|
||||||
if (extend.startsWith("http")) {
|
|
||||||
Misc.jsonUrl = extend;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PushAgent.fetchRule(false, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
protected static HashMap<String, String> getHeaderDB() {
|
protected static HashMap<String, String> getHeaderDB() {
|
||||||
HashMap<String, String> headers = new HashMap<>();
|
HashMap<String, String> headers = new HashMap<>();
|
||||||
headers.put("Host","frodo.douban.com");
|
headers.put("Host","frodo.douban.com");
|
||||||
@@ -150,10 +134,10 @@ public class PushAgentQQ extends Spider {
|
|||||||
@Override
|
@Override
|
||||||
public String homeContent(boolean filter) {
|
public String homeContent(boolean filter) {
|
||||||
try {
|
try {
|
||||||
fetchRule(true);
|
fetchRule(true,1);
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
JSONArray classes = new JSONArray();
|
JSONArray classes = new JSONArray();
|
||||||
String[] fenleis = PushAgent.getRuleVal(rule,"fenlei", "").split("#");
|
String[] fenleis = getRuleVal(Misc.siteRule,"fenlei", "").split("#");
|
||||||
for (String fenlei : fenleis) {
|
for (String fenlei : fenleis) {
|
||||||
String[] info = fenlei.split("\\$");
|
String[] info = fenlei.split("\\$");
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
@@ -169,16 +153,12 @@ public class PushAgentQQ extends Spider {
|
|||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
protected JSONObject fetchRule(boolean flag) {
|
|
||||||
rule = PushAgent.fetchRule(flag, 0);
|
|
||||||
return rule;
|
|
||||||
}
|
|
||||||
@Override
|
@Override
|
||||||
public String homeVideoContent() {
|
public String homeVideoContent() {
|
||||||
try {
|
try {
|
||||||
JSONObject jo = PushAgent.fetchRule(true,1);
|
JSONObject jo = fetchRule(true,1);
|
||||||
JSONArray videos = new JSONArray();
|
JSONArray videos = new JSONArray();
|
||||||
String[] fenleis = PushAgent.getRuleVal(jo, "fenlei", "").split("#");
|
String[] fenleis = getRuleVal(jo, "fenlei", "").split("#");
|
||||||
for (String fenlei : fenleis) {
|
for (String fenlei : fenleis) {
|
||||||
String[] info = fenlei.split("\\$");
|
String[] info = fenlei.split("\\$");
|
||||||
JSONObject data = category(info[1], "1", false, new HashMap<>(),jo);
|
JSONObject data = category(info[1], "1", false, new HashMap<>(),jo);
|
||||||
@@ -233,13 +213,13 @@ public class PushAgentQQ extends Spider {
|
|||||||
if(arr.length>3)count = Integer.parseInt(arr[3]);
|
if(arr.length>3)count = Integer.parseInt(arr[3]);
|
||||||
videos = getDouban(key, sort, count);
|
videos = getDouban(key, sort, count);
|
||||||
}else{
|
}else{
|
||||||
if (jo == null) jo = PushAgent.fetchRule(true,1);
|
if (jo == null) jo = fetchRule(true,1);
|
||||||
JSONArray array = jo.getJSONArray(tid);
|
JSONArray array = jo.getJSONArray(tid);
|
||||||
for (int i = 0; i < array.length(); i++) {
|
for (int i = 0; i < array.length(); i++) {
|
||||||
jsonObject = array.getJSONObject(i);
|
jsonObject = array.getJSONObject(i);
|
||||||
url = PushAgent.getRuleVal(jsonObject, "url");
|
url = getRuleVal(jsonObject, "url");
|
||||||
name = PushAgent.getRuleVal(jsonObject, "name");
|
name = getRuleVal(jsonObject, "name");
|
||||||
pic = PushAgent.getRuleVal(jsonObject, "pic");
|
pic = getRuleVal(jsonObject, "pic");
|
||||||
if(pic.equals("")) pic = Misc.getWebName(url, 1);
|
if(pic.equals("")) pic = Misc.getWebName(url, 1);
|
||||||
v = new JSONObject();
|
v = new JSONObject();
|
||||||
v.put("vod_id", url + "$$$" + pic + "$$$" + name);
|
v.put("vod_id", url + "$$$" + pic + "$$$" + name);
|
||||||
@@ -268,25 +248,14 @@ public class PushAgentQQ extends Spider {
|
|||||||
return obj != null ? obj.toString() : "";
|
return obj != null ? obj.toString() : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String detailContent(List<String> list) {
|
|
||||||
return PushAgent.getDetail(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String playerContent(String str, String str2, List<String> list) {
|
|
||||||
return PushAgent.player(str, str2, list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String searchContent(String key, boolean quick) {
|
public String searchContent(String key, boolean quick) {
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
JSONArray videos = new JSONArray();
|
JSONArray videos = new JSONArray();
|
||||||
try {
|
try {
|
||||||
fetchRule(true);
|
fetchRule(false,0);
|
||||||
String url = "",webUrl,detailRex,siteUrl,siteName;
|
String url = "",webUrl,detailRex,siteUrl,siteName;
|
||||||
JSONArray siteArray = rule.getJSONArray("sites");
|
JSONArray siteArray = Misc.siteRule.getJSONArray("sites");
|
||||||
for (int j = 0; j < siteArray.length(); j++) {
|
for (int j = 0; j < siteArray.length(); j++) {
|
||||||
JSONObject site = siteArray.getJSONObject(j);
|
JSONObject site = siteArray.getJSONObject(j);
|
||||||
siteUrl = site.optString("site");
|
siteUrl = site.optString("site");
|
||||||
|
|||||||
@@ -1,35 +1,15 @@
|
|||||||
package com.github.catvod.spider;
|
package com.github.catvod.spider;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import com.github.catvod.crawler.Spider;
|
|
||||||
import com.github.catvod.parser.Base64Utils;
|
import com.github.catvod.parser.Base64Utils;
|
||||||
import com.github.catvod.utils.Misc;
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
public class Upyunso extends Spider {
|
public class Upyunso extends PushAgent {
|
||||||
private static String b = "https://www.upyunso.com/";
|
private static String b = "https://www.upyunso.com/";
|
||||||
|
|
||||||
@Override
|
|
||||||
public void init(Context context, String extend) {
|
|
||||||
super.init(context, extend);
|
|
||||||
PushAgent.fetchRule(false, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String detailContent(List<String> list) {
|
|
||||||
try {
|
|
||||||
return PushAgent.getDetail(list);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getRealUrl(String url){
|
public static String getRealUrl(String url){
|
||||||
if (url.contains("upyunso.com/download")) {
|
if (url.contains("upyunso.com/download")) {
|
||||||
url = Base64Utils.sendGet(url);
|
url = Base64Utils.sendGet(url);
|
||||||
@@ -37,15 +17,9 @@ public class Upyunso extends Spider {
|
|||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String playerContent(String str, String str2, List<String> list) {
|
|
||||||
return PushAgent.player(str, str2, list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String searchContent(String key, boolean z) {
|
public String searchContent(String key, boolean z) {
|
||||||
try {
|
try {
|
||||||
PushAgent.getRefreshTk();
|
|
||||||
JSONArray jSONArray = new JSONArray();
|
JSONArray jSONArray = new JSONArray();
|
||||||
key = URLEncoder.encode(key);
|
key = URLEncoder.encode(key);
|
||||||
JSONArray arr = Base64Utils.getJSONByUrl("https://api.upyunso.com/search?keyword=" + key+"&page=1");
|
JSONArray arr = Base64Utils.getJSONByUrl("https://api.upyunso.com/search?keyword=" + key+"&page=1");
|
||||||
|
|||||||
@@ -1,41 +1,16 @@
|
|||||||
package com.github.catvod.spider;
|
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.crawler.SpiderDebug;
|
||||||
import com.github.catvod.utils.Misc;
|
|
||||||
import com.github.catvod.utils.okhttp.OkHttpUtil;
|
import com.github.catvod.utils.okhttp.OkHttpUtil;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class Yiso extends Spider {
|
public class Yiso extends PushAgent {
|
||||||
private static final Pattern aliyun = Pattern.compile("(https://www.aliyundrive.com/s/[^\"]+)");
|
private static final Pattern aliyun = Pattern.compile("(https://www.aliyundrive.com/s/[^\"]+)");
|
||||||
@Override
|
|
||||||
public void init(Context context, String extend) {
|
|
||||||
super.init(context);
|
|
||||||
PushAgent.fetchRule(false, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String detailContent(List<String> list) {
|
|
||||||
try {
|
|
||||||
return PushAgent.getDetail(list);
|
|
||||||
} catch (Exception e) {
|
|
||||||
SpiderDebug.log(e);
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public String playerContent(String str, String str2, List<String> list) {
|
|
||||||
return PushAgent.player(str, str2, list);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static HashMap<String, String> sHeaders() {
|
protected static HashMap<String, String> sHeaders() {
|
||||||
HashMap<String, String> headers = new HashMap<>();
|
HashMap<String, String> headers = new HashMap<>();
|
||||||
@@ -49,6 +24,7 @@ public class Yiso extends Spider {
|
|||||||
@Override
|
@Override
|
||||||
public String searchContent(String key, boolean quick) {
|
public String searchContent(String key, boolean quick) {
|
||||||
try {
|
try {
|
||||||
|
PushAgent.getRefreshTk();
|
||||||
HashMap<String, String> LT = sHeaders();
|
HashMap<String, String> LT = sHeaders();
|
||||||
String url = "https://yiso.fun/api/search?name=" + URLEncoder.encode(key) + "&from=ali";
|
String url = "https://yiso.fun/api/search?name=" + URLEncoder.encode(key) + "&from=ali";
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ public class Misc {
|
|||||||
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 refreshToken="http://catvod.fun:8001/tv/ali.txt";
|
public static String refreshToken="http://catvod.fun:8001/tv/ali.txt";
|
||||||
public static JSONObject siteRule = null;
|
public static JSONObject siteRule = null;
|
||||||
public static PushAgent pushAgent = null;
|
|
||||||
public static Integer type=1;
|
public static Integer type=1;
|
||||||
public static String btype="N";
|
public static String btype="N";
|
||||||
public static boolean rflag = false;
|
public static boolean rflag = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user