ncat修复
This commit is contained in:
parent
e9c23f28ba
commit
1095ba8e73
|
|
@ -160,14 +160,14 @@ public class NCat extends Spider {
|
|||
@Override
|
||||
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
|
||||
Document doc = Jsoup.parse(OkHttp.string(playUrl.concat(id), getHeaders()));
|
||||
String regex = "src: \"(.*?)m3u8\",";
|
||||
String regex = "src: \"(.*?)\",";
|
||||
|
||||
Pattern pattern = Pattern.compile(regex);
|
||||
Matcher matcher = pattern.matcher(doc.html());
|
||||
String url = "";
|
||||
if (matcher.find()) {
|
||||
url = matcher.group(1);
|
||||
url = url.replace("\\/", "/") + "m3u8";
|
||||
url = url.replace("\\/", "/").replace(" ","");
|
||||
}
|
||||
return Result.get().url(url).header(getHeaders()).string();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public class NCatTest {
|
|||
@org.junit.Test
|
||||
public void detailContent() throws Exception {
|
||||
|
||||
String content = spider.detailContent(Arrays.asList("237526.html"));
|
||||
String content = spider.detailContent(Arrays.asList("241982.html"));
|
||||
JsonObject map = Json.safeObject(content);
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
System.out.println("detailContent--" + gson.toJson(map));
|
||||
|
|
@ -73,11 +73,17 @@ public class NCatTest {
|
|||
|
||||
@org.junit.Test
|
||||
public void playerContent() throws Exception {
|
||||
String content = spider.playerContent("", "15744-4-99491.html", 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());
|
||||
String froms = "超清$$$4K(高峰不卡)$$$FF线路$$$蓝光8$$$蓝光3$$$蓝光2$$$蓝光2-1$$$蓝光2-2$$$蓝光9$$$蓝光9-1";
|
||||
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-34-345909.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";
|
||||
for (int i = 0; i < urls.split("\\$\\$\\$").length; i++) {
|
||||
String content = spider.playerContent(froms.split("\\$\\$\\$")[i], urls.split("\\$\\$\\$")[i].split("\\$")[1], 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());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@org.junit.Test
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
3495a63cf181e6f690d3f257478e1913
|
||||
b92fe52d6ac0ed4005b6780dd937cb54
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"spider": "https://gh.idayer.com/https://raw.githubusercontent.com/lushunming/AndroidCatVodSpider/mine/jar/custom_spider.jar;md5;3495a63cf181e6f690d3f257478e1913",
|
||||
"spider": "https://gh.idayer.com/https://raw.githubusercontent.com/lushunming/AndroidCatVodSpider/mine/jar/custom_spider.jar;md5;b92fe52d6ac0ed4005b6780dd937cb54",
|
||||
"lives": [
|
||||
{
|
||||
"name": "直播ipv6",
|
||||
|
|
|
|||
Loading…
Reference in New Issue