add - douban yiso0-21
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
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.Misc;
|
||||
import com.github.catvod.utils.okhttp.OkHttpUtil;
|
||||
@@ -10,9 +8,8 @@ import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
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";
|
||||
public static JSONObject getUrls(){
|
||||
String _urls = "{" +
|
||||
@@ -124,19 +121,6 @@ public class PushAgentQQ extends Spider {
|
||||
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() {
|
||||
HashMap<String, String> headers = new HashMap<>();
|
||||
headers.put("Host","frodo.douban.com");
|
||||
@@ -150,10 +134,10 @@ public class PushAgentQQ extends Spider {
|
||||
@Override
|
||||
public String homeContent(boolean filter) {
|
||||
try {
|
||||
fetchRule(true);
|
||||
fetchRule(true,1);
|
||||
JSONObject result = new JSONObject();
|
||||
JSONArray classes = new JSONArray();
|
||||
String[] fenleis = PushAgent.getRuleVal(rule,"fenlei", "").split("#");
|
||||
String[] fenleis = getRuleVal(Misc.siteRule,"fenlei", "").split("#");
|
||||
for (String fenlei : fenleis) {
|
||||
String[] info = fenlei.split("\\$");
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
@@ -169,16 +153,12 @@ public class PushAgentQQ extends Spider {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
protected JSONObject fetchRule(boolean flag) {
|
||||
rule = PushAgent.fetchRule(flag, 0);
|
||||
return rule;
|
||||
}
|
||||
@Override
|
||||
public String homeVideoContent() {
|
||||
try {
|
||||
JSONObject jo = PushAgent.fetchRule(true,1);
|
||||
JSONObject jo = fetchRule(true,1);
|
||||
JSONArray videos = new JSONArray();
|
||||
String[] fenleis = PushAgent.getRuleVal(jo, "fenlei", "").split("#");
|
||||
String[] fenleis = getRuleVal(jo, "fenlei", "").split("#");
|
||||
for (String fenlei : fenleis) {
|
||||
String[] info = fenlei.split("\\$");
|
||||
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]);
|
||||
videos = getDouban(key, sort, count);
|
||||
}else{
|
||||
if (jo == null) jo = PushAgent.fetchRule(true,1);
|
||||
if (jo == null) jo = fetchRule(true,1);
|
||||
JSONArray array = jo.getJSONArray(tid);
|
||||
for (int i = 0; i < array.length(); i++) {
|
||||
jsonObject = array.getJSONObject(i);
|
||||
url = PushAgent.getRuleVal(jsonObject, "url");
|
||||
name = PushAgent.getRuleVal(jsonObject, "name");
|
||||
pic = PushAgent.getRuleVal(jsonObject, "pic");
|
||||
url = getRuleVal(jsonObject, "url");
|
||||
name = getRuleVal(jsonObject, "name");
|
||||
pic = getRuleVal(jsonObject, "pic");
|
||||
if(pic.equals("")) pic = Misc.getWebName(url, 1);
|
||||
v = new JSONObject();
|
||||
v.put("vod_id", url + "$$$" + pic + "$$$" + name);
|
||||
@@ -268,25 +248,14 @@ public class PushAgentQQ extends Spider {
|
||||
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
|
||||
public String searchContent(String key, boolean quick) {
|
||||
JSONObject result = new JSONObject();
|
||||
JSONArray videos = new JSONArray();
|
||||
try {
|
||||
fetchRule(true);
|
||||
fetchRule(false,0);
|
||||
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++) {
|
||||
JSONObject site = siteArray.getJSONObject(j);
|
||||
siteUrl = site.optString("site");
|
||||
|
||||
@@ -1,35 +1,15 @@
|
||||
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.utils.Misc;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
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/";
|
||||
|
||||
@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){
|
||||
if (url.contains("upyunso.com/download")) {
|
||||
url = Base64Utils.sendGet(url);
|
||||
@@ -37,15 +17,9 @@ public class Upyunso extends Spider {
|
||||
return url;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String playerContent(String str, String str2, List<String> list) {
|
||||
return PushAgent.player(str, str2, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String searchContent(String key, boolean z) {
|
||||
try {
|
||||
PushAgent.getRefreshTk();
|
||||
JSONArray jSONArray = new JSONArray();
|
||||
key = URLEncoder.encode(key);
|
||||
JSONArray arr = Base64Utils.getJSONByUrl("https://api.upyunso.com/search?keyword=" + key+"&page=1");
|
||||
|
||||
@@ -1,41 +1,16 @@
|
||||
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.Misc;
|
||||
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 Spider {
|
||||
public class Yiso extends PushAgent {
|
||||
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() {
|
||||
HashMap<String, String> headers = new HashMap<>();
|
||||
@@ -49,6 +24,7 @@ public class Yiso extends Spider {
|
||||
@Override
|
||||
public String searchContent(String key, boolean quick) {
|
||||
try {
|
||||
PushAgent.getRefreshTk();
|
||||
HashMap<String, String> LT = sHeaders();
|
||||
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 refreshToken="http://catvod.fun:8001/tv/ali.txt";
|
||||
public static JSONObject siteRule = null;
|
||||
public static PushAgent pushAgent = null;
|
||||
public static Integer type=1;
|
||||
public static String btype="N";
|
||||
public static boolean rflag = false;
|
||||
|
||||
Reference in New Issue
Block a user