add - B站
This commit is contained in:
@@ -478,6 +478,7 @@ public class PushAgent extends Spider {
|
|||||||
vodAtom.put("vod_content", url);
|
vodAtom.put("vod_content", url);
|
||||||
vodAtom.put("vod_area", type + refreshToken);
|
vodAtom.put("vod_area", type + refreshToken);
|
||||||
if (Misc.isVip(url) && !url.contains("qq.com") && !url.contains("mgtv.com")) {
|
if (Misc.isVip(url) && !url.contains("qq.com") && !url.contains("mgtv.com")) {
|
||||||
|
vodAtom.put("vod_play_from", "jx");
|
||||||
Elements playListA = null;
|
Elements playListA = null;
|
||||||
Document doc = Jsoup.parse(OkHttpUtil.string(url, Misc.Headers(0,url)));
|
Document doc = Jsoup.parse(OkHttpUtil.string(url, Misc.Headers(0,url)));
|
||||||
String baseUrl = url.replaceAll("(^https?://.*?)(:\\d+)?/.*$", "$1");//https://www.dyk9.com
|
String baseUrl = url.replaceAll("(^https?://.*?)(:\\d+)?/.*$", "$1");//https://www.dyk9.com
|
||||||
@@ -498,13 +499,14 @@ public class PushAgent extends Spider {
|
|||||||
String playList = TextUtils.join("#", vodItems);
|
String playList = TextUtils.join("#", vodItems);
|
||||||
vodAtom.put("vod_play_url", playList);
|
vodAtom.put("vod_play_url", playList);
|
||||||
}
|
}
|
||||||
|
vodAtom.put("vod_play_from", "parse");
|
||||||
} else {
|
} else {
|
||||||
vodAtom.put("vod_play_url", "立即播放$" + url);
|
vodAtom.put("vod_play_url", "立即播放$" + url);
|
||||||
}
|
}
|
||||||
VodName = doc.select("head > title").text();
|
VodName = doc.select("head > title").text();
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
vodAtom.put("vod_name", VodName);
|
vodAtom.put("vod_name", VodName);
|
||||||
vodAtom.put("vod_play_from", "jx");
|
|
||||||
lists.put(vodAtom);
|
lists.put(vodAtom);
|
||||||
result.put("list", lists);
|
result.put("list", lists);
|
||||||
return result.toString();
|
return result.toString();
|
||||||
@@ -826,11 +828,11 @@ public class PushAgent extends Spider {
|
|||||||
return result.toString();
|
return result.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(flag.startsWith("嗅探")){
|
if(flag.startsWith("嗅探")||flag.equals("parse")){
|
||||||
result.put("parse", 1);
|
result.put("parse", 1);
|
||||||
result.put("playUrl", "");
|
result.put("playUrl", "");
|
||||||
result.put("url", id);
|
result.put("url", id);
|
||||||
result.put("header", Misc.jHeaders(type,id).toString());
|
if(!flag.equals("parse")) result.put("header", Misc.jHeaders(type,id).toString());
|
||||||
return result.toString();
|
return result.toString();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -82,30 +82,51 @@ public class PushAgentQQ extends Spider {
|
|||||||
|
|
||||||
private JSONObject category(String tid, String pg, boolean filter, HashMap<String, String> extend,JSONObject jo) {
|
private JSONObject category(String tid, String pg, boolean filter, HashMap<String, String> extend,JSONObject jo) {
|
||||||
try {
|
try {
|
||||||
if (jo == null) jo = PushAgent.fetchRule(true,1);
|
|
||||||
JSONArray videos = new JSONArray();
|
JSONArray videos = new JSONArray();
|
||||||
JSONArray array = jo.getJSONArray(tid);
|
|
||||||
JSONObject jsonObject = null, v = null;
|
|
||||||
String url=null,name=null,pic=null;
|
String url=null,name=null,pic=null;
|
||||||
for (int i = 0; i < array.length(); i++) {
|
JSONObject jsonObject = null, v = null;
|
||||||
jsonObject = array.getJSONObject(i);
|
if (tid.equals("bili")) {
|
||||||
url = PushAgent.getRuleVal(jsonObject, "url");
|
String json = OkHttpUtil.string("https://api.bilibili.com/x/web-interface/ranking/v2?rid=0&type=all", null);
|
||||||
name = PushAgent.getRuleVal(jsonObject, "name");
|
JSONObject j = new JSONObject(json);
|
||||||
pic = PushAgent.getRuleVal(jsonObject, "pic");
|
JSONObject o = j.getJSONObject("data");
|
||||||
if(pic.equals("")) pic = Misc.getWebName(url, 1);
|
JSONArray array = o.getJSONArray("list");
|
||||||
v = new JSONObject();
|
for (int i = 0; i < array.length(); i++) {
|
||||||
v.put("vod_id", url + "$$$" + pic + "$$$" + name);
|
jsonObject = array.getJSONObject(i);
|
||||||
v.put("vod_name", name);
|
url = jsonObject.optString("short_link", "");
|
||||||
v.put("vod_pic", pic);
|
name = jsonObject.optString("title", "");
|
||||||
v.put("vod_remarks", Misc.getWebName(url,0));
|
pic = jsonObject.optString("pic", "");
|
||||||
videos.put(v);
|
v = new JSONObject();
|
||||||
|
v.put("vod_id", url + "$$$" + pic + "$$$" + name);
|
||||||
|
v.put("vod_name", name);
|
||||||
|
v.put("vod_pic", pic);
|
||||||
|
v.put("vod_remarks", "");
|
||||||
|
videos.put(v);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (jo == null) jo = PushAgent.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");
|
||||||
|
if(pic.equals("")) pic = Misc.getWebName(url, 1);
|
||||||
|
v = new JSONObject();
|
||||||
|
v.put("vod_id", url + "$$$" + pic + "$$$" + name);
|
||||||
|
v.put("vod_name", name);
|
||||||
|
v.put("vod_pic", pic);
|
||||||
|
v.put("vod_remarks", Misc.getWebName(url,0));
|
||||||
|
videos.put(v);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
result.put("page", pg);
|
int limit = 20;int total = videos.length();
|
||||||
result.put("pagecount", Integer.MAX_VALUE);
|
int page = Integer.parseInt(pg)+1;
|
||||||
result.put("limit", 120);
|
result.put("page", page);
|
||||||
result.put("total", Integer.MAX_VALUE);
|
int pageCount = (int)Math.ceil((double)total/limit);
|
||||||
|
result.put("pagecount", pageCount);
|
||||||
|
result.put("limit", limit);
|
||||||
|
result.put("total", total);
|
||||||
result.put("list", videos);
|
result.put("list", videos);
|
||||||
return result;
|
return result;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user