'更新可用状态'

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() {
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();
}
@@ -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]));
@@ -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);
}
@@ -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 {