diff --git a/app/src/main/java/com/github/catvod/spider/NCat.java b/app/src/main/java/com/github/catvod/spider/NCat.java index fcbfb864..1dd6fc00 100644 --- a/app/src/main/java/com/github/catvod/spider/NCat.java +++ b/app/src/main/java/com/github/catvod/spider/NCat.java @@ -47,7 +47,7 @@ public class NCat extends Spider { Document doc = Jsoup.parse(OkHttp.string(siteUrl, getHeaders())); for (Element element : doc.select("div.module-item")) { try { - String pic = element.select("img").attr("data-original"); + String pic = element.select("img").last().attr("data-original"); String url = element.select("a").attr("href"); String name = element.select("img").attr("title"); if (!pic.startsWith("http")) { @@ -69,7 +69,7 @@ public class NCat extends Spider { Document doc = Jsoup.parse(OkHttp.string(target, getHeaders())); for (Element element : doc.select("div.module-item")) { try { - String pic = element.select("img").attr("data-original"); + String pic = element.select("img").last().attr("data-original"); String url = element.select("a").attr("href"); String name = element.select("img").attr("title"); if (!pic.startsWith("http")) { @@ -89,17 +89,17 @@ public class NCat extends Spider { public String detailContent(List ids) throws Exception { Document doc = Jsoup.parse(OkHttp.string(detailUrl.concat(ids.get(0)), getHeaders())); String name = doc.select("div.detail-title strong").text(); - String pic = doc.select(".detail-pic img").attr("data-original"); + String pic = doc.select(".detail-pic img").last().attr("data-original"); String year = doc.select("a.detail-tags-item").get(0).text(); String desc = doc.select("div.detail-desc p").text(); // 播放源 - Elements tabs = doc.select("a.source-item span"); + Elements tabs = doc.select("a.source-item"); Elements list = doc.select("div.episode-list"); String PlayFrom = ""; String PlayUrl = ""; for (int i = 0; i < tabs.size(); i++) { - String tabName = tabs.get(i).text(); + String tabName = tabs.get(i).select("span").last().text(); if (!"".equals(PlayFrom)) { PlayFrom = PlayFrom + "$$$" + tabName; } else { diff --git a/app/src/test/java/NCatTest.java b/app/src/test/java/NCatTest.java index 97c16440..b8031026 100644 --- a/app/src/test/java/NCatTest.java +++ b/app/src/test/java/NCatTest.java @@ -64,7 +64,7 @@ public class NCatTest { @org.junit.Test public void detailContent() throws Exception { - String content = spider.detailContent(Arrays.asList("241982.html")); + String content = spider.detailContent(Arrays.asList("232824.html")); JsonObject map = Json.safeObject(content); Gson gson = new GsonBuilder().setPrettyPrinting().create(); System.out.println("detailContent--" + gson.toJson(map)); @@ -73,14 +73,14 @@ public class NCatTest { @org.junit.Test public void playerContent() throws Exception { - String froms = "超清$$$4K(高峰不卡)$$$FF线路$$$蓝光3$$$蓝光2$$$蓝光2-1$$$蓝光2-2$$$蓝光9$$$蓝光9-1$$$蓝光9-2"; - String urls = "粤语$241982-32-1020215.html#国语$241982-32-1020217.html$$$粤语$241982-35-1020141.html#国语$241982-35-1020143.html$$$谈判专家粤语版$241982-4-788565.html#谈判专家国语版$241982-4-788566.html$$$(普通话版)$241982-2-578532.html#(粤语版)$241982-2-578533.html$$$1$241982-31-1011262.html$$$1$241982-31-1011263.html$$$1$241982-31-1016415.html$$$正片$241982-36-407941.html$$$正片$241982-36-405254.html$$$正片$241982-36-405255.html"; + String froms = "超清$$$4K(高峰不卡)$$$FF线路$$$蓝光3$$$蓝光2$$$蓝光9$$$蓝光1$$$蓝光9-1$$$蓝光1-1$$$蓝光9-2"; + String urls = "国语$232824-32-703932.html#粤语$232824-32-910325.html$$$国语$232824-35-703905.html#粤语$232824-35-910260.html$$$国语$232824-4-648287.html#粤语$232824-4-730937.html$$$HD国语$232824-2-558076.html#HD粤语$232824-2-573419.html$$$枪版$232824-31-824909.html$$$正片$232824-36-395120.html$$$国语中字$232824-27-547772.html$$$正片$232824-36-395138.html$$$TC$232824-27-504728.html$$$抢先版$232824-36-377043.html"; for (int i = 0; i < urls.split("\\$\\$\\$").length; i++) { String content = spider.playerContent(froms.split("\\$\\$\\$")[i], urls.split("\\$\\$\\$")[i].split("\\$")[1].split("#")[0], new ArrayList<>()); JsonObject map = Json.safeObject(content); Gson gson = new GsonBuilder().setPrettyPrinting().create(); System.out.println("playerContent--" + gson.toJson(map)); - // Assert.assertFalse(map.getAsJsonPrimitive("url").getAsString().isEmpty()); + // Assert.assertFalse(map.getAsJsonPrimitive("url").getAsString().isEmpty()); } diff --git a/jar/custom_spider.jar b/jar/custom_spider.jar index 9017a3e9..6fd45aaf 100644 Binary files a/jar/custom_spider.jar and b/jar/custom_spider.jar differ diff --git a/jar/custom_spider.jar.md5 b/jar/custom_spider.jar.md5 index eb96de68..bff079a1 100644 --- a/jar/custom_spider.jar.md5 +++ b/jar/custom_spider.jar.md5 @@ -1 +1 @@ -97267a31afae36f108e1065bddc72c23 +d6c20f6b7e2cd7b9a0875bd783a93fd7 diff --git a/json/index.json b/json/index.json index 51321b10..fbdbb4d9 100644 --- a/json/index.json +++ b/json/index.json @@ -1,5 +1,5 @@ { - "spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;97267a31afae36f108e1065bddc72c23", + "spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;d6c20f6b7e2cd7b9a0875bd783a93fd7", "lives": [ { "name": "直播ipv6", diff --git a/json/index1.json b/json/index1.json index ed08a4f5..188d2318 100644 --- a/json/index1.json +++ b/json/index1.json @@ -1,5 +1,5 @@ { - "spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;97267a31afae36f108e1065bddc72c23", + "spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;d6c20f6b7e2cd7b9a0875bd783a93fd7", "lives": [ { "name": "直播ipv6", diff --git a/json/index2.json b/json/index2.json index 502088f8..ad112023 100644 --- a/json/index2.json +++ b/json/index2.json @@ -1,5 +1,5 @@ { - "spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;97267a31afae36f108e1065bddc72c23", + "spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;d6c20f6b7e2cd7b9a0875bd783a93fd7", "lives": [ { "name": "直播ipv6",