ncat修复
This commit is contained in:
parent
5f7e292f98
commit
b983a94bbc
|
|
@ -47,7 +47,7 @@ public class NCat extends Spider {
|
||||||
Document doc = Jsoup.parse(OkHttp.string(siteUrl, getHeaders()));
|
Document doc = Jsoup.parse(OkHttp.string(siteUrl, getHeaders()));
|
||||||
for (Element element : doc.select("div.module-item")) {
|
for (Element element : doc.select("div.module-item")) {
|
||||||
try {
|
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 url = element.select("a").attr("href");
|
||||||
String name = element.select("img").attr("title");
|
String name = element.select("img").attr("title");
|
||||||
if (!pic.startsWith("http")) {
|
if (!pic.startsWith("http")) {
|
||||||
|
|
@ -69,7 +69,7 @@ public class NCat extends Spider {
|
||||||
Document doc = Jsoup.parse(OkHttp.string(target, getHeaders()));
|
Document doc = Jsoup.parse(OkHttp.string(target, getHeaders()));
|
||||||
for (Element element : doc.select("div.module-item")) {
|
for (Element element : doc.select("div.module-item")) {
|
||||||
try {
|
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 url = element.select("a").attr("href");
|
||||||
String name = element.select("img").attr("title");
|
String name = element.select("img").attr("title");
|
||||||
if (!pic.startsWith("http")) {
|
if (!pic.startsWith("http")) {
|
||||||
|
|
@ -89,17 +89,17 @@ public class NCat extends Spider {
|
||||||
public String detailContent(List<String> ids) throws Exception {
|
public String detailContent(List<String> ids) throws Exception {
|
||||||
Document doc = Jsoup.parse(OkHttp.string(detailUrl.concat(ids.get(0)), getHeaders()));
|
Document doc = Jsoup.parse(OkHttp.string(detailUrl.concat(ids.get(0)), getHeaders()));
|
||||||
String name = doc.select("div.detail-title strong").text();
|
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 year = doc.select("a.detail-tags-item").get(0).text();
|
||||||
String desc = doc.select("div.detail-desc p").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");
|
Elements list = doc.select("div.episode-list");
|
||||||
String PlayFrom = "";
|
String PlayFrom = "";
|
||||||
String PlayUrl = "";
|
String PlayUrl = "";
|
||||||
for (int i = 0; i < tabs.size(); i++) {
|
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)) {
|
if (!"".equals(PlayFrom)) {
|
||||||
PlayFrom = PlayFrom + "$$$" + tabName;
|
PlayFrom = PlayFrom + "$$$" + tabName;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ public class NCatTest {
|
||||||
@org.junit.Test
|
@org.junit.Test
|
||||||
public void detailContent() throws Exception {
|
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);
|
JsonObject map = Json.safeObject(content);
|
||||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||||
System.out.println("detailContent--" + gson.toJson(map));
|
System.out.println("detailContent--" + gson.toJson(map));
|
||||||
|
|
@ -73,14 +73,14 @@ public class NCatTest {
|
||||||
|
|
||||||
@org.junit.Test
|
@org.junit.Test
|
||||||
public void playerContent() throws Exception {
|
public void playerContent() throws Exception {
|
||||||
String froms = "超清$$$4K(高峰不卡)$$$FF线路$$$蓝光3$$$蓝光2$$$蓝光2-1$$$蓝光2-2$$$蓝光9$$$蓝光9-1$$$蓝光9-2";
|
String froms = "超清$$$4K(高峰不卡)$$$FF线路$$$蓝光3$$$蓝光2$$$蓝光9$$$蓝光1$$$蓝光9-1$$$蓝光1-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 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++) {
|
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<>());
|
String content = spider.playerContent(froms.split("\\$\\$\\$")[i], urls.split("\\$\\$\\$")[i].split("\\$")[1].split("#")[0], new ArrayList<>());
|
||||||
JsonObject map = Json.safeObject(content);
|
JsonObject map = Json.safeObject(content);
|
||||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||||
System.out.println("playerContent--" + gson.toJson(map));
|
System.out.println("playerContent--" + gson.toJson(map));
|
||||||
// Assert.assertFalse(map.getAsJsonPrimitive("url").getAsString().isEmpty());
|
// Assert.assertFalse(map.getAsJsonPrimitive("url").getAsString().isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
97267a31afae36f108e1065bddc72c23
|
d6c20f6b7e2cd7b9a0875bd783a93fd7
|
||||||
|
|
|
||||||
|
|
@ -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": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "直播ipv6",
|
"name": "直播ipv6",
|
||||||
|
|
|
||||||
|
|
@ -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": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "直播ipv6",
|
"name": "直播ipv6",
|
||||||
|
|
|
||||||
|
|
@ -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": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "直播ipv6",
|
"name": "直播ipv6",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue