mirror of
https://github.com/bizhangjie/CatVodSpider.git
synced 2025-10-26 01:22:17 +00:00
'更新可用状态'
This commit is contained in:
@@ -30,6 +30,7 @@ import com.github.catvod.spider.NCat;
|
|||||||
import com.github.catvod.spider.QxiTv;
|
import com.github.catvod.spider.QxiTv;
|
||||||
import com.github.catvod.spider.ROU223;
|
import com.github.catvod.spider.ROU223;
|
||||||
import com.github.catvod.spider.RouVideo;
|
import com.github.catvod.spider.RouVideo;
|
||||||
|
import com.github.catvod.spider.TvDy;
|
||||||
import com.github.catvod.spider.W55Movie;
|
import com.github.catvod.spider.W55Movie;
|
||||||
import com.github.catvod.spider.WWRR;
|
import com.github.catvod.spider.WWRR;
|
||||||
import com.github.catvod.spider.Wogg;
|
import com.github.catvod.spider.Wogg;
|
||||||
@@ -75,7 +76,7 @@ public class MainActivity extends Activity {
|
|||||||
private void initSpider() {
|
private void initSpider() {
|
||||||
try {
|
try {
|
||||||
Init.init(getApplicationContext());
|
Init.init(getApplicationContext());
|
||||||
spider = new NCat();
|
spider = new TvDy();
|
||||||
spider.init(this, "");
|
spider.init(this, "");
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -109,7 +110,7 @@ public class MainActivity extends Activity {
|
|||||||
|
|
||||||
public void detailContent() {
|
public void detailContent() {
|
||||||
try {
|
try {
|
||||||
Logger.t("detailContent").d(spider.detailContent(Arrays.asList("230341.html")));
|
Logger.t("detailContent").d(spider.detailContent(Arrays.asList("index122512.html")));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -117,7 +118,7 @@ public class MainActivity extends Activity {
|
|||||||
|
|
||||||
public void playerContent() {
|
public void playerContent() {
|
||||||
try {
|
try {
|
||||||
Logger.t("playerContent").d(spider.playerContent("轉存原畫", "152786-10-123806.html", new ArrayList<>()));
|
Logger.t("playerContent").d(spider.playerContent("轉存原畫", "121974-1-2.html", new ArrayList<>()));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
168
app/src/main/java/com/github/catvod/spider/TvDy.java
Normal file
168
app/src/main/java/com/github/catvod/spider/TvDy.java
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
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.Util;
|
||||||
|
|
||||||
|
import org.jsoup.Jsoup;
|
||||||
|
import org.jsoup.nodes.Document;
|
||||||
|
import org.jsoup.nodes.Element;
|
||||||
|
import org.jsoup.select.Elements;
|
||||||
|
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public class TvDy extends Spider {
|
||||||
|
|
||||||
|
private static final String siteUrl = "https://www.tvdy.xyz";
|
||||||
|
private static final String cateUrl = siteUrl + "/search.php?tid=";
|
||||||
|
private static final String detailUrl = siteUrl + "/movie/";
|
||||||
|
private static final String searchUrl = siteUrl + "/search.php?searchword=";
|
||||||
|
private static final String playUrl = siteUrl + "/play/";
|
||||||
|
|
||||||
|
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[] typeIdList = {"1", "2", "3", "4", "5", "34"};
|
||||||
|
String[] typeNameList = {"电影", "电视剧", "综艺", "动漫", "福利", "纪录片"};
|
||||||
|
for (int i = 0; i < typeNameList.length; i++) {
|
||||||
|
classes.add(new Class(typeIdList[i], typeNameList[i]));
|
||||||
|
}
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(siteUrl, getHeaders()));
|
||||||
|
for (Element element : doc.select("div.stui-vodlist__box a")) {
|
||||||
|
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 {
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
String target = cateUrl + tid + "&searchtype=5&order=commend&page=" + pg;
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(target, getHeaders()));
|
||||||
|
for (Element element : doc.select("div.stui-vodlist__box a")) {
|
||||||
|
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) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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 {
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(detailUrl.concat(ids.get(0)), getHeaders()));
|
||||||
|
String name = doc.select("h1.title").text();
|
||||||
|
String pic = doc.select("a.pic img").attr("data-original");
|
||||||
|
String year = doc.select("p.data").get(4).text().replace("年份:","");
|
||||||
|
String desc = doc.select("span.detail-content").text();
|
||||||
|
|
||||||
|
// 播放源
|
||||||
|
Elements tabs = doc.select("div.stui-vodlist__head h4");
|
||||||
|
Elements list = doc.select("div.stui-vodlist__head ul");
|
||||||
|
String PlayFrom = "";
|
||||||
|
String PlayUrl = "";
|
||||||
|
for (int i = 0; i < tabs.size(); i++) {
|
||||||
|
String tabName = tabs.get(i).text();
|
||||||
|
if (!"".equals(PlayFrom)) {
|
||||||
|
PlayFrom = PlayFrom + "$$$" + tabName;
|
||||||
|
} else {
|
||||||
|
PlayFrom = PlayFrom + tabName;
|
||||||
|
}
|
||||||
|
Elements li = list.get(i).select("a");
|
||||||
|
String liUrl = "";
|
||||||
|
for (int i1 = 0; i1 < li.size(); i1++) {
|
||||||
|
if (!"".equals(liUrl)) {
|
||||||
|
liUrl = liUrl + "#" + li.get(i1).text() + "$" + li.get(i1).attr("href").replace("/play/", "");
|
||||||
|
} else {
|
||||||
|
liUrl = liUrl + li.get(i1).text() + "$" + li.get(i1).attr("href").replace("/play/", "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!"".equals(PlayUrl)) {
|
||||||
|
PlayUrl = PlayUrl + "$$$" + liUrl;
|
||||||
|
} else {
|
||||||
|
PlayUrl = PlayUrl + liUrl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Vod vod = new Vod();
|
||||||
|
vod.setVodId(ids.get(0));
|
||||||
|
vod.setVodPic(siteUrl + pic);
|
||||||
|
vod.setVodYear(year);
|
||||||
|
vod.setVodName(name);
|
||||||
|
vod.setVodContent(desc);
|
||||||
|
vod.setVodPlayFrom(PlayFrom);
|
||||||
|
vod.setVodPlayUrl(PlayUrl);
|
||||||
|
return Result.string(vod);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String searchContent(String key, boolean quick) throws Exception {
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(searchUrl.concat(URLEncoder.encode(key)), getHeaders()));
|
||||||
|
for (Element element : doc.select("div.stui-vodlist__box a")) {
|
||||||
|
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(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(playUrl.concat(id), getHeaders()));
|
||||||
|
String regex = "now=base64decode(\"(.*?)\");";
|
||||||
|
|
||||||
|
Pattern pattern = Pattern.compile(regex);
|
||||||
|
Matcher matcher = pattern.matcher(doc.html());
|
||||||
|
String url = "";
|
||||||
|
if (matcher.find()) {
|
||||||
|
url = matcher.group(1);
|
||||||
|
url = url;
|
||||||
|
}
|
||||||
|
return Result.get().url(url).header(getHeaders()).string();
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -1 +1 @@
|
|||||||
4fa91e831a495b00628b13b24b861ff7
|
a2e67333ec2a448a0ec16f708ede4f03
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"spider": "https://mirror.ghproxy.com/https://github.com/bizhangjie/CatVodSpider/blob/main/jar/custom_spider.jar;md5;4fa91e831a495b00628b13b24b861ff7",
|
"spider": "https://mirror.ghproxy.com/https://github.com/bizhangjie/CatVodSpider/blob/main/jar/custom_spider.jar;md5;a2e67333ec2a448a0ec16f708ede4f03",
|
||||||
"lives": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "直播ipv6",
|
"name": "直播ipv6",
|
||||||
@@ -27,6 +27,14 @@
|
|||||||
"searchable": 1,
|
"searchable": 1,
|
||||||
"filterable": 1
|
"filterable": 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"key": "TvDy",
|
||||||
|
"name": "\uD83D\uDE07 电影天堂 | 影视",
|
||||||
|
"type": 3,
|
||||||
|
"api": "csp_TvDy",
|
||||||
|
"searchable": 1,
|
||||||
|
"filterable": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"key": "YingTan",
|
"key": "YingTan",
|
||||||
"name": "\uD83D\uDCFD\uFE0F 影探 | 影视",
|
"name": "\uD83D\uDCFD\uFE0F 影探 | 影视",
|
||||||
|
|||||||
Reference in New Issue
Block a user