add - douban112288
This commit is contained in:
@@ -70,6 +70,7 @@ public class PushAgent extends Spider {
|
|||||||
}
|
}
|
||||||
Misc.type = Misc.siteRule.optInt("ua", 1);
|
Misc.type = Misc.siteRule.optInt("ua", 1);
|
||||||
Misc.btype = Misc.siteRule.optString("btype", "N");
|
Misc.btype = Misc.siteRule.optString("btype", "N");
|
||||||
|
Misc.apikey = Misc.siteRule.optString("apikey", "0ac44ae016490db2204ce0a042db2916");
|
||||||
}
|
}
|
||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import java.util.List;
|
|||||||
|
|
||||||
public class PushAgentQQ extends Spider {
|
public class PushAgentQQ extends Spider {
|
||||||
private static String douban_api_host = "https://frodo.douban.com/api/v2";
|
private static String douban_api_host = "https://frodo.douban.com/api/v2";
|
||||||
private static String apikey = "0ac44ae016490db2204ce0a042db2916";
|
|
||||||
public static JSONObject getUrls(){
|
public static JSONObject getUrls(){
|
||||||
String _urls = "{" +
|
String _urls = "{" +
|
||||||
" \"search\": \"/search/weixin\"," +
|
" \"search\": \"/search/weixin\"," +
|
||||||
@@ -91,26 +90,30 @@ public class PushAgentQQ extends Spider {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JSONArray getDouban(String key,String sort) throws JSONException {
|
public static JSONArray getDouban(String key,String sort,Integer count) throws JSONException {
|
||||||
if(sort==null)sort="U";
|
if(sort==null)sort="U";
|
||||||
|
if(count ==null) count =120;
|
||||||
JSONObject ju = getUrls();
|
JSONObject ju = getUrls();
|
||||||
String url = douban_api_host + ju.getString(key)+"?sort="+sort+"&start=0&count=120&apikey=" + apikey + "&channel=Douban";
|
String url = douban_api_host + ju.getString(key)+"?sort="+sort+"&start=0&count="+count+"&apikey=" + Misc.apikey + "&channel=Douban";
|
||||||
String json = OkHttpUtil.string(url, getHeaderDB());
|
String json = OkHttpUtil.string(url, getHeaderDB());
|
||||||
JSONArray jSONArray = new JSONArray();
|
JSONArray jSONArray = new JSONArray();
|
||||||
JSONObject jo = new JSONObject(json),o1 = null,op1=null,vo=null;
|
JSONObject jo = new JSONObject(json),o1 = null,op1=null,vo=null;
|
||||||
|
|
||||||
JSONArray ay = jo.getJSONArray("subject_collection_items");
|
JSONArray ay = jo.getJSONArray("subject_collection_items");
|
||||||
String remark = "", title = "",pic="";
|
String remark = "", title = "",pic="";
|
||||||
|
Object o = null;
|
||||||
for (int i = 0; i < ay.length(); i++) {
|
for (int i = 0; i < ay.length(); i++) {
|
||||||
JSONObject v = ay.getJSONObject(i);
|
JSONObject v = ay.getJSONObject(i);
|
||||||
vo = new JSONObject();
|
vo = new JSONObject();
|
||||||
title = v.getString("title");
|
title = v.getString("title");
|
||||||
o1 = v.getJSONObject("rating");
|
o = v.get("rating");
|
||||||
|
if (!o.getClass().getName().contains("Null")) {
|
||||||
|
o1 = v.getJSONObject("rating");
|
||||||
|
remark = o1.optString("value", "暂无评分");
|
||||||
|
}else remark = "暂无评分";
|
||||||
|
|
||||||
op1 = v.getJSONObject("pic");
|
op1 = v.getJSONObject("pic");
|
||||||
pic = op1.optString("normal", "");
|
pic = op1.optString("normal", "");
|
||||||
remark = o1.optString("value", "暂无评分");
|
|
||||||
|
|
||||||
vo.put("vod_id", "");
|
vo.put("vod_id", "");
|
||||||
vo.put("vod_name", title);
|
vo.put("vod_name", title);
|
||||||
vo.put("vod_remarks", remark);
|
vo.put("vod_remarks", remark);
|
||||||
@@ -224,8 +227,10 @@ public class PushAgentQQ extends Spider {
|
|||||||
String [] arr = tid.split("-");
|
String [] arr = tid.split("-");
|
||||||
String key = arr[1];
|
String key = arr[1];
|
||||||
String sort = null;
|
String sort = null;
|
||||||
|
Integer count = 120;
|
||||||
if(arr.length>2)sort = arr[2];
|
if(arr.length>2)sort = arr[2];
|
||||||
videos = getDouban(key, sort);
|
if(arr.length>3)count = Integer.parseInt(arr[3]);
|
||||||
|
videos = getDouban(key, sort, count);
|
||||||
}else{
|
}else{
|
||||||
if (jo == null) jo = PushAgent.fetchRule(true,1);
|
if (jo == null) jo = PushAgent.fetchRule(true,1);
|
||||||
JSONArray array = jo.getJSONArray(tid);
|
JSONArray array = jo.getJSONArray(tid);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ public class Misc {
|
|||||||
public static Integer type=1;
|
public static Integer type=1;
|
||||||
public static String btype="N";
|
public static String btype="N";
|
||||||
public static boolean rflag = true;
|
public static boolean rflag = true;
|
||||||
|
public static String apikey = "0ac44ae016490db2204ce0a042db2916";
|
||||||
public static boolean isVip(String url) {
|
public static boolean isVip(String url) {
|
||||||
// 适配2.0.6的调用应用内解析列表的支持, 需要配合直连分析一起使用,参考cjt影视和极品直连
|
// 适配2.0.6的调用应用内解析列表的支持, 需要配合直连分析一起使用,参考cjt影视和极品直连
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user