'更新可用状态'

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

View File

@@ -62,7 +62,7 @@ public class MainActivity extends Activity {
private void initSpider() {
try {
Init.init(getApplicationContext());
spider = new MiMei();
spider = new Ikanbot();
spider.init(this, "");
} catch (Throwable e) {
e.printStackTrace();
@@ -87,7 +87,7 @@ public class MainActivity extends Activity {
public void categoryContent() {
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) {
e.printStackTrace();
}

View File

@@ -28,7 +28,7 @@ import java.util.regex.Pattern;
public class Ikanbot extends Spider {
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 searchUrl = siteUrl + "/search?q=";
@@ -53,7 +53,7 @@ public class Ikanbot extends Spider {
@Override
public String homeContent(boolean filter) throws Exception {
List<Class> classes = new ArrayList<>();
String[] typeIdList = {"movie", "tv"};
String[] typeIdList = {"/index-movie", "/index-tv"};
String[] typeNameList = {"热门电影", "热门剧集"};
for (int i = 0; i < typeNameList.length; i++) {
classes.add(new Class(typeIdList[i], typeNameList[i]));

View File

@@ -53,6 +53,22 @@ public class MiMei extends Spider {
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
public String homeContent(boolean filter) throws Exception {
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 {
String target = cateUrl + tid;
if (pg == "1"){
target = target + "/";
target = target ;
}else {
target = target + "/index_" + pg + ".html";
}
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;
return Result.string(Integer.parseInt(pg), Integer.parseInt(pg) + 1, 20, total, list);
}

View File

@@ -47,12 +47,14 @@ public class QxiTv extends Spider {
List<Vod> list = new ArrayList<>();
List<Class> classes = new ArrayList<>();
Document doc = Jsoup.parse(OkHttp.string(siteUrl, getHeaders()));
int index = 1;
for (Element element : doc.select("h4.title-h")) {
String typeId = element.select("a").attr("href");
String typeName = element.select("span").text();
if (!"".equals(typeName)) {
if (!"".equals(typeName) && index != 1 && index != 6) {
classes.add(new Class(typeId, typeName.replace(" 查看更多","")));
}
index++;
}
for (Element element : doc.select("a.public-list-exp")) {
try {

Binary file not shown.

View File

@@ -1 +1 @@
18db580eee9b3d5efdf9264132d39010
21d5205b09e5d9937666fe0a3df0a4c2

View File

@@ -32,7 +32,7 @@
},
{
"key": "QxiTv",
"name": "7xiTv",
"name": "7喜影视",
"type": 3,
"api": "csp_QxiTv",
"searchable": 1,
@@ -48,7 +48,7 @@
},
{
"key": "W55Movie",
"name": "W55Movie",
"name": "555电影",
"type": 3,
"api": "csp_W55Movie",
"searchable": 0,
@@ -56,7 +56,7 @@
},
{
"key": "J91",
"name": "J91",
"name": "91",
"type": 3,
"api": "csp_J91",
"searchable": 1,
@@ -64,7 +64,7 @@
},
{
"key": "Cg51",
"name": "Cg51",
"name": "51吃瓜",
"type": 3,
"api": "csp_Cg51",
"searchable": 1,
@@ -80,7 +80,7 @@
},
{
"key": "MiMei",
"name": "MiMei",
"name": "迷妹",
"type": 3,
"api": "csp_MiMei",
"searchable": 1,
@@ -88,7 +88,7 @@
},
{
"key": "CaoLiu",
"name": "CaoLiu",
"name": "小草",
"type": 3,
"api": "csp_CaoLiu",
"searchable": 0,