'更新可用状态'

This commit is contained in:
zhangjie committed 2024-03-13 15:10:19 +08:00
1 parent d83f7aa911
commit 09fc5fc1c5
7 files changed
+38 -14

No files matched your search

@@ -62,7 +62,7 @@ public class MainActivity extends Activity {
private void initSpider() { private void initSpider() {
try { try {
Init.init(getApplicationContext()); Init.init(getApplicationContext());
spider = new MiMei(); spider = new Ikanbot();
spider.init(this, ""); spider.init(this, "");
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); e.printStackTrace();
@@ -87,7 +87,7 @@ public class MainActivity extends Activity {
public void categoryContent() { public void categoryContent() {
try { try {
Logger.t("categoryContent").d(spider.categoryContent("guochan", "1", true, new HashMap<>())); Logger.t("categoryContent").d(spider.categoryContent("/index-movie", "2", true, new HashMap<>()));
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); e.printStackTrace();
} }
@@ -28,7 +28,7 @@ import java.util.regex.Pattern;
public class Ikanbot extends Spider { public class Ikanbot extends Spider {
private static final String siteUrl = "https://v.ikanbot.com"; private static final String siteUrl = "https://v.ikanbot.com";
private static final String cateUrl = siteUrl + "/hot/index-"; private static final String cateUrl = siteUrl + "/hot";
private static final String detailUrl = siteUrl + "/play/"; private static final String detailUrl = siteUrl + "/play/";
private static final String searchUrl = siteUrl + "/search?q="; private static final String searchUrl = siteUrl + "/search?q=";
@@ -53,7 +53,7 @@ public class Ikanbot extends Spider {
@Override @Override
public String homeContent(boolean filter) throws Exception { public String homeContent(boolean filter) throws Exception {
List<Class> classes = new ArrayList<>(); List<Class> classes = new ArrayList<>();
String[] typeIdList = {"movie", "tv"}; String[] typeIdList = {"/index-movie", "/index-tv"};
String[] typeNameList = {"热门电影", "热门剧集"}; String[] typeNameList = {"热门电影", "热门剧集"};
for (int i = 0; i < typeNameList.length; i++) { for (int i = 0; i < typeNameList.length; i++) {
classes.add(new Class(typeIdList[i], typeNameList[i])); classes.add(new Class(typeIdList[i], typeNameList[i]));
@@ -53,6 +53,22 @@ public class MiMei extends Spider {
return list; return list;
} }
public List<Vod> parseHtmlZB(Document document) {
List<Vod> list = new ArrayList<>();
for (Element element : document.select("#zhibo")) {
try {
String pic = element.select("img").attr("src");
String id = element.select("a").attr("href");
String name = element.select("a").attr("title");
if (!"".equals(name)) {
list.add(new Vod(id, name, pic));
}
} catch (Exception e) {
}
}
return list;
}
@Override @Override
public String homeContent(boolean filter) throws Exception { public String homeContent(boolean filter) throws Exception {
List<Class> classes = new ArrayList<>(); List<Class> classes = new ArrayList<>();
@@ -75,12 +91,18 @@ public class MiMei extends Spider {
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception { public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {
String target = cateUrl + tid; String target = cateUrl + tid;
if (pg == "1"){ if (pg == "1"){
target = target + "/"; target = target ;
}else { }else {
target = target + "/index_" + pg + ".html"; target = target + "/index_" + pg + ".html";
} }
Document doc = Jsoup.parse(OkHttp.string(target, getHeaders())); Document doc = Jsoup.parse(OkHttp.string(target, getHeaders()));
List<Vod> list = parseHtml(doc);
List<Vod> list;
if (tid == "zhibo"){
list = parseHtmlZB(doc);
}else {
list = parseHtml(doc);
}
Integer total = (Integer.parseInt(pg) + 1) * 20; Integer total = (Integer.parseInt(pg) + 1) * 20;
return Result.string(Integer.parseInt(pg), Integer.parseInt(pg) + 1, 20, total, list); return Result.string(Integer.parseInt(pg), Integer.parseInt(pg) + 1, 20, total, list);
} }
@@ -47,12 +47,14 @@ public class QxiTv extends Spider {
List<Vod> list = new ArrayList<>(); List<Vod> list = new ArrayList<>();
List<Class> classes = new ArrayList<>(); List<Class> classes = new ArrayList<>();
Document doc = Jsoup.parse(OkHttp.string(siteUrl, getHeaders())); Document doc = Jsoup.parse(OkHttp.string(siteUrl, getHeaders()));
int index = 1;
for (Element element : doc.select("h4.title-h")) { for (Element element : doc.select("h4.title-h")) {
String typeId = element.select("a").attr("href"); String typeId = element.select("a").attr("href");
String typeName = element.select("span").text(); String typeName = element.select("span").text();
if (!"".equals(typeName)) { if (!"".equals(typeName) && index != 1 && index != 6) {
classes.add(new Class(typeId, typeName.replace(" 查看更多",""))); classes.add(new Class(typeId, typeName.replace(" 查看更多","")));
} }
index++;
} }
for (Element element : doc.select("a.public-list-exp")) { for (Element element : doc.select("a.public-list-exp")) {
try { try {
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
18db580eee9b3d5efdf9264132d39010 21d5205b09e5d9937666fe0a3df0a4c2
+6 -6
View File
@@ -32,7 +32,7 @@
}, },
{ {
"key": "QxiTv", "key": "QxiTv",
"name": "7xiTv", "name": "7喜影视",
"type": 3, "type": 3,
"api": "csp_QxiTv", "api": "csp_QxiTv",
"searchable": 1, "searchable": 1,
@@ -48,7 +48,7 @@
}, },
{ {
"key": "W55Movie", "key": "W55Movie",
"name": "W55Movie", "name": "555电影",
"type": 3, "type": 3,
"api": "csp_W55Movie", "api": "csp_W55Movie",
"searchable": 0, "searchable": 0,
@@ -56,7 +56,7 @@
}, },
{ {
"key": "J91", "key": "J91",
"name": "J91", "name": "91",
"type": 3, "type": 3,
"api": "csp_J91", "api": "csp_J91",
"searchable": 1, "searchable": 1,
@@ -64,7 +64,7 @@
}, },
{ {
"key": "Cg51", "key": "Cg51",
"name": "Cg51", "name": "51吃瓜",
"type": 3, "type": 3,
"api": "csp_Cg51", "api": "csp_Cg51",
"searchable": 1, "searchable": 1,
@@ -80,7 +80,7 @@
}, },
{ {
"key": "MiMei", "key": "MiMei",
"name": "MiMei", "name": "迷妹",
"type": 3, "type": 3,
"api": "csp_MiMei", "api": "csp_MiMei",
"searchable": 1, "searchable": 1,
@@ -88,7 +88,7 @@
}, },
{ {
"key": "CaoLiu", "key": "CaoLiu",
"name": "CaoLiu", "name": "小草",
"type": 3, "type": 3,
"api": "csp_CaoLiu", "api": "csp_CaoLiu",
"searchable": 0, "searchable": 0,