mirror of
https://github.com/bizhangjie/CatVodSpider.git
synced 2026-11-05 19:22:10 +00:00
'更新可用状态'
This commit is contained in:
1 parent
a50249d0d3
commit
c0469fc8f3
5 files changed
+192
-5
No files matched your search
@@ -28,6 +28,7 @@ import com.github.catvod.spider.QxiTv;
|
|||||||
import com.github.catvod.spider.RouVideo;
|
import com.github.catvod.spider.RouVideo;
|
||||||
import com.github.catvod.spider.W55Movie;
|
import com.github.catvod.spider.W55Movie;
|
||||||
import com.github.catvod.spider.Wogg;
|
import com.github.catvod.spider.Wogg;
|
||||||
|
import com.github.catvod.spider.XMVideo;
|
||||||
import com.github.catvod.spider.XVideos;
|
import com.github.catvod.spider.XVideos;
|
||||||
import com.github.catvod.spider.Zhaozy;
|
import com.github.catvod.spider.Zhaozy;
|
||||||
import com.orhanobut.logger.AndroidLogAdapter;
|
import com.orhanobut.logger.AndroidLogAdapter;
|
||||||
@@ -68,7 +69,7 @@ public class MainActivity extends Activity {
|
|||||||
private void initSpider() {
|
private void initSpider() {
|
||||||
try {
|
try {
|
||||||
Init.init(getApplicationContext());
|
Init.init(getApplicationContext());
|
||||||
spider = new Ikanbot();
|
spider = new XMVideo();
|
||||||
spider.init(this, "");
|
spider.init(this, "");
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -94,7 +95,7 @@ public class MainActivity extends Activity {
|
|||||||
public void categoryContent(){
|
public void categoryContent(){
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Logger.t("categoryContent").d(spider.categoryContent("57", "1", true, new HashMap<>()));
|
Logger.t("categoryContent").d(spider.categoryContent("6", "1", true, new HashMap<>()));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -102,7 +103,7 @@ public class MainActivity extends Activity {
|
|||||||
|
|
||||||
public void detailContent() {
|
public void detailContent() {
|
||||||
try {
|
try {
|
||||||
Logger.t("detailContent").d(spider.detailContent(Arrays.asList("846223")));
|
Logger.t("detailContent").d(spider.detailContent(Arrays.asList("网红空姐‘温柔与霸道’空姐制服丝袜性爱私拍~扛腿抽插后入猛操#https://hweu3.sjzsq.com/video/m3u8/202403/28/19535c45bbdf/1.jpg")));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,178 @@
|
|||||||
|
package com.github.catvod.spider;
|
||||||
|
|
||||||
|
import com.github.catvod.bean.Class;
|
||||||
|
import com.github.catvod.bean.Result;
|
||||||
|
import com.github.catvod.bean.Vod;
|
||||||
|
import com.github.catvod.crawler.Spider;
|
||||||
|
import com.github.catvod.net.OkHttp;
|
||||||
|
import com.github.catvod.utils.Json;
|
||||||
|
import com.github.catvod.utils.Util;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonArray;
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
|
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.URLDecoder;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.StringTokenizer;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public class XMVideo extends Spider {
|
||||||
|
|
||||||
|
private static final String siteUrl = "https://uu11vv.com";
|
||||||
|
|
||||||
|
private static final String Init = "https://spiderscloudcn2.51111666.com/getDataInit";
|
||||||
|
|
||||||
|
private static final String cateUrl = "https://spiderscloudcn2.51111666.com/forward";
|
||||||
|
private static final String detailUrl = siteUrl + "/play/";
|
||||||
|
private static final String playUrl = siteUrl + "/play/";
|
||||||
|
private static final String searchUrl = siteUrl + "/search--------------.html?wd=";
|
||||||
|
|
||||||
|
private HashMap<String, String> getHeaders() {
|
||||||
|
HashMap<String, String> headers = new HashMap<>();
|
||||||
|
headers.put("User-Agent", Util.CHROME);
|
||||||
|
return headers;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String homeContent(boolean filter) throws Exception {
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
List<Class> classes = new ArrayList<>();
|
||||||
|
String target = Init;
|
||||||
|
// 构建JSON格式的请求体,包含整数
|
||||||
|
String json = "{\"name\":\"John\", \"age\":31, \"city\":\"New York\"}";
|
||||||
|
String data = OkHttp.post(target, json);
|
||||||
|
// json处理
|
||||||
|
Gson gson = new Gson();
|
||||||
|
JsonObject jsonObject = gson.fromJson(data, JsonObject.class);
|
||||||
|
JsonObject asJsonObject = jsonObject.getAsJsonObject("data");
|
||||||
|
JsonArray menu0ListMap = asJsonObject.getAsJsonArray("menu0ListMap");
|
||||||
|
// 输出menu0ListMap的前三个元素
|
||||||
|
for (int i = 0; i < menu0ListMap.size() && i < 3; i++) {
|
||||||
|
JsonObject object = menu0ListMap.get(i).getAsJsonObject();
|
||||||
|
JsonArray menu2List = object.getAsJsonArray("menu2List");
|
||||||
|
for (int j = 0; j < menu2List.size(); j++) {
|
||||||
|
JsonObject object1 = menu2List.get(j).getAsJsonObject();
|
||||||
|
String typeName2 = object1.get("typeName2").getAsString();
|
||||||
|
String typeId2 = object1.get("typeId2").getAsString().replace(".0", "");
|
||||||
|
classes.add(new Class(typeId2, typeName2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Document doc = Jsoup.parse(OkHttp.string(siteUrl, getHeaders()));
|
||||||
|
// for (Element element : doc.select("a.vodlist_thumb")) {
|
||||||
|
// try {
|
||||||
|
// String pic = element.attr("data-original");
|
||||||
|
// String url = element.attr("href");
|
||||||
|
// String name = element.attr("title");
|
||||||
|
// if (!pic.startsWith("http")) {
|
||||||
|
// pic = siteUrl + pic;
|
||||||
|
// }
|
||||||
|
// String id = url.split("/")[2];
|
||||||
|
// list.add(new Vod(id, name, pic));
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
return Result.string(classes, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {
|
||||||
|
|
||||||
|
// 构建JSON格式的请求体,包含整数
|
||||||
|
String json = "{\"command\":\"WEB_GET_INFO\",\"pageNumber\":" + pg + ",\"RecordsPage\":20,\"typeId\":\"" + tid
|
||||||
|
+ "\",\"typeMid\":\"1\",\"languageType\":\"CN\",\"content\":\"\"}";
|
||||||
|
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
String target = cateUrl;
|
||||||
|
String data = OkHttp.post(target, json);
|
||||||
|
|
||||||
|
// json处理
|
||||||
|
Gson gson = new Gson();
|
||||||
|
JsonObject fromJson = gson.fromJson(data, JsonObject.class);
|
||||||
|
JsonObject data1 = fromJson.getAsJsonObject("data");
|
||||||
|
JsonArray menu0ListMap = data1.getAsJsonArray("resultList");
|
||||||
|
// 输出menu0ListMap的前三个元素
|
||||||
|
for (int i = 0; i < menu0ListMap.size(); i++) {
|
||||||
|
JsonObject object = menu0ListMap.get(i).getAsJsonObject();
|
||||||
|
String vod_name = object.get("vod_name").getAsString().replace("yy8ycom", "");
|
||||||
|
String vod_pic = object.get("vod_pic").getAsString();
|
||||||
|
String id = vod_name + "#" + vod_pic;
|
||||||
|
list.add(new Vod(id, vod_name, vod_pic));
|
||||||
|
}
|
||||||
|
|
||||||
|
Integer total = (Integer.parseInt(pg) + 1) * 20;
|
||||||
|
return Result.string(Integer.parseInt(pg), Integer.parseInt(pg) + 1, 20, total, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String detailContent(List<String> ids) throws Exception {
|
||||||
|
|
||||||
|
String vod_name = ids.get(0).split("#")[0];
|
||||||
|
String vod_pic = ids.get(0).split("#")[1];
|
||||||
|
String PlayUrl = vod_pic.replace("1.jpg","playlist.m3u8");
|
||||||
|
Vod vod = new Vod();
|
||||||
|
vod.setVodId(vod_name);
|
||||||
|
vod.setVodPic(vod_pic);
|
||||||
|
vod.setVodName(vod_name);
|
||||||
|
vod.setVodPlayFrom("熊猫视频");
|
||||||
|
vod.setVodPlayUrl("播放$" + PlayUrl);
|
||||||
|
return Result.string(vod);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String searchContent(String key, boolean quick) throws Exception {
|
||||||
|
|
||||||
|
String json = "{\"command\":\"WEB_GET_INFO\",\"pageNumber\":1,\"RecordsPage\":20,\"typeId\":\"0\",\"typeMid\":\"1\",\"languageType\":\"CN\",\"content\":\""+
|
||||||
|
key + "\",\"type\":\"1\"}";
|
||||||
|
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
String target = cateUrl;
|
||||||
|
String data = OkHttp.post(target, json);
|
||||||
|
|
||||||
|
// json处理
|
||||||
|
Gson gson = new Gson();
|
||||||
|
JsonObject fromJson = gson.fromJson(data, JsonObject.class);
|
||||||
|
JsonObject data1 = fromJson.getAsJsonObject("data");
|
||||||
|
JsonArray menu0ListMap = data1.getAsJsonArray("resultList");
|
||||||
|
// 输出menu0ListMap的前三个元素
|
||||||
|
for (int i = 0; i < menu0ListMap.size(); i++) {
|
||||||
|
JsonObject object = menu0ListMap.get(i).getAsJsonObject();
|
||||||
|
String vod_name = object.get("vod_name").getAsString().replace("yy8ycom", "");
|
||||||
|
String vod_pic = object.get("vod_pic").getAsString();
|
||||||
|
String id = vod_name + "#" + vod_pic;
|
||||||
|
list.add(new Vod(id, vod_name, vod_pic));
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.string(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
|
||||||
|
String target = playUrl.concat(id);
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(target));
|
||||||
|
String regex = "\"url\\\":\\\"(.*?)\\\",\\\"url_next\\\":";
|
||||||
|
|
||||||
|
Pattern pattern = Pattern.compile(regex);
|
||||||
|
Matcher matcher = pattern.matcher(doc.html());
|
||||||
|
String url = "";
|
||||||
|
if (matcher.find()) {
|
||||||
|
url = URLDecoder.decode(matcher.group(1), "UTF-8").split("&")[0];
|
||||||
|
}
|
||||||
|
return Result.get().url(url).header(getHeaders()).string();
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -1 +1 @@
|
|||||||
ee6b2660f80010f9ca4c5138b5c9c4fb
|
625c69bcb0c11d2a338df0f20d05a804
|
||||||
+9
-1
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"spider": "https://mirror.ghproxy.com/https://github.com/bizhangjie/CatVodSpider/blob/main/jar/custom_spider.jar;md5;ee6b2660f80010f9ca4c5138b5c9c4fb",
|
"spider": "https://mirror.ghproxy.com/https://github.com/bizhangjie/CatVodSpider/blob/main/jar/custom_spider.jar;md5;625c69bcb0c11d2a338df0f20d05a804",
|
||||||
"lives": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "直播ipv6",
|
"name": "直播ipv6",
|
||||||
@@ -67,6 +67,14 @@
|
|||||||
"searchable": 0,
|
"searchable": 0,
|
||||||
"filterable": 1
|
"filterable": 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"key": "XMVideo",
|
||||||
|
"name": "熊猫视频 | 珍惜",
|
||||||
|
"type": 3,
|
||||||
|
"api": "csp_XMVideo",
|
||||||
|
"searchable": 1,
|
||||||
|
"filterable": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"key": "JustLive",
|
"key": "JustLive",
|
||||||
"name": "JustLive | 直播",
|
"name": "JustLive | 直播",
|
||||||
|
|||||||
Reference in new issue
Block a user