mirror of
https://github.com/bizhangjie/CatVodSpider.git
synced 2025-12-14 12:12:20 +00:00
'更新可用状态'
This commit is contained in:
@@ -27,6 +27,7 @@ import com.github.catvod.spider.MiMei;
|
||||
import com.github.catvod.spider.QxiTv;
|
||||
import com.github.catvod.spider.RouVideo;
|
||||
import com.github.catvod.spider.W55Movie;
|
||||
import com.github.catvod.spider.WWRR;
|
||||
import com.github.catvod.spider.Wogg;
|
||||
import com.github.catvod.spider.XMVideo;
|
||||
import com.github.catvod.spider.XVideos;
|
||||
@@ -69,7 +70,7 @@ public class MainActivity extends Activity {
|
||||
private void initSpider() {
|
||||
try {
|
||||
Init.init(getApplicationContext());
|
||||
spider = new XMVideo();
|
||||
spider = new WWRR();
|
||||
spider.init(this, "");
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
@@ -95,7 +96,7 @@ public class MainActivity extends Activity {
|
||||
public void categoryContent(){
|
||||
|
||||
try {
|
||||
Logger.t("categoryContent").d(spider.categoryContent("6", "1", true, new HashMap<>()));
|
||||
Logger.t("categoryContent").d(spider.categoryContent("1", "2", true, new HashMap<>()));
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -103,7 +104,7 @@ public class MainActivity extends Activity {
|
||||
|
||||
public void detailContent() {
|
||||
try {
|
||||
Logger.t("detailContent").d(spider.detailContent(Arrays.asList("网红空姐‘温柔与霸道’空姐制服丝袜性爱私拍~扛腿抽插后入猛操#https://hweu3.sjzsq.com/video/m3u8/202403/28/19535c45bbdf/1.jpg")));
|
||||
Logger.t("detailContent").d(spider.detailContent(Arrays.asList("582607.html")));
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
147
app/src/main/java/com/github/catvod/spider/WWRR.java
Normal file
147
app/src/main/java/com/github/catvod/spider/WWRR.java
Normal file
@@ -0,0 +1,147 @@
|
||||
package com.github.catvod.spider;
|
||||
|
||||
import com.github.catvod.bean.Class;
|
||||
import com.github.catvod.bean.Result;
|
||||
import com.github.catvod.bean.Vod;
|
||||
import com.github.catvod.crawler.Spider;
|
||||
import com.github.catvod.net.OkHttp;
|
||||
import com.github.catvod.utils.Util;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.jsoup.nodes.Element;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import android.util.Base64;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.zip.Inflater;
|
||||
|
||||
public class WWRR extends Spider {
|
||||
|
||||
private static final String siteUrl = "https://hd.6nu2.com";
|
||||
private static final String cateUrl = siteUrl + "/index.php/home/index/";
|
||||
private static final String detailUrl = siteUrl + "/index.php/play/";
|
||||
private static final String searchUrl = siteUrl + "/index.php/search/video/";
|
||||
|
||||
private HashMap<String, String> getHeaders() {
|
||||
HashMap<String, String> headers = new HashMap<>();
|
||||
headers.put("User-Agent", Util.CHROME);
|
||||
return headers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String homeContent(boolean filter) throws Exception {
|
||||
List<Vod> list = new ArrayList<>();
|
||||
List<Class> classes = new ArrayList<>();
|
||||
Document doc = Jsoup.parse(OkHttp.string(siteUrl, getHeaders()));
|
||||
for (Element element : doc.select("div.div_ad_a a")) {
|
||||
String typeId = element.attr("href").replace("/index.php/home/index/","").replace(".html","");
|
||||
String typeName = element.text();
|
||||
classes.add(new Class(typeId, typeName));
|
||||
}
|
||||
doc = Jsoup.parse(OkHttp.string(siteUrl, getHeaders()));
|
||||
for (Element element : doc.select("div.listA a")) {
|
||||
String pic = element.select("img").attr("src");
|
||||
String url = element.attr("href");
|
||||
String name = element.select("div.name").text().replace("2048.cc-","");
|
||||
String id = url.split("/")[3];
|
||||
list.add(new Vod(id, name, pic));
|
||||
}
|
||||
return Result.string(classes, list);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {
|
||||
List<Vod> list = new ArrayList<>();
|
||||
String target = cateUrl + tid + "/" + tid;
|
||||
Document doc = Jsoup.parse(OkHttp.string(target, getHeaders()));
|
||||
for (Element element : doc.select("div.listA a")) {
|
||||
String pic = element.select("img").attr("src");
|
||||
String url = element.attr("href");
|
||||
String name = element.select("div.name").text().replace("2048.cc-","");
|
||||
String id = url.split("/")[3];
|
||||
list.add(new Vod(id, name, pic));
|
||||
}
|
||||
Integer total = (Integer.parseInt(pg)+1)*20;
|
||||
return Result.string(Integer.parseInt(pg),Integer.parseInt(pg)+1,20,total,list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String detailContent(List<String> ids) throws Exception {
|
||||
Document doc = Jsoup.parse(OkHttp.string(detailUrl.concat(ids.get(0)), getHeaders()));
|
||||
String name = doc.select("div.name.WF").text().replace("2048.cc-","");
|
||||
String pic = doc.select("div.vjs-poster img").attr("src");
|
||||
|
||||
Pattern pattern = Pattern.compile("abcd = '(.*?)';");
|
||||
Matcher matcher = pattern.matcher(doc.html());
|
||||
String PlayUrl = "";
|
||||
// 提取匹配到的内容
|
||||
if (matcher.find()) {
|
||||
PlayUrl = matcher.group(1);
|
||||
}
|
||||
String decompressedUrl = "";
|
||||
try {
|
||||
String decompressedData = decompress(PlayUrl);
|
||||
JsonObject jsonObject = new Gson().fromJson(decompressedData, JsonObject.class);
|
||||
decompressedUrl = jsonObject.get("url").getAsString();
|
||||
System.out.println("解压缩后的数据: " + decompressedUrl);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Vod vod = new Vod();
|
||||
vod.setVodId(ids.get(0));
|
||||
vod.setVodPic(pic);
|
||||
vod.setVodName(name);
|
||||
vod.setVodPlayFrom("我为人人");
|
||||
vod.setVodPlayUrl("播放$" + decompressedUrl);
|
||||
return Result.string(vod);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String searchContent(String key, boolean quick) throws Exception {
|
||||
List<Vod> list = new ArrayList<>();
|
||||
Document doc = Jsoup.parse(OkHttp.string(searchUrl.concat(key).concat("/1.html"), getHeaders()));
|
||||
for (Element element : doc.select("div.listA a")) {
|
||||
String pic = element.select("img").attr("src");
|
||||
String url = element.attr("href");
|
||||
String name = element.select("div.name").text().replace("2048.cc-","");
|
||||
String id = url.split("/")[3];
|
||||
list.add(new Vod(id, name, pic));
|
||||
}
|
||||
return Result.string(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
|
||||
return Result.get().url(id).header(getHeaders()).string();
|
||||
}
|
||||
|
||||
|
||||
public static String decompress(String base64String) throws Exception {
|
||||
// 将Base64字符串转换为字节数组
|
||||
byte[] compressedData = Base64.decode(base64String, Base64.DEFAULT);
|
||||
|
||||
// 使用Inflater解压缩数据
|
||||
Inflater inflater = new Inflater(true); // true表示处理raw deflate数据
|
||||
inflater.setInput(compressedData);
|
||||
|
||||
byte[] buffer = new byte[1024];
|
||||
StringBuilder outputStream = new StringBuilder();
|
||||
while (!inflater.finished()) {
|
||||
int count = inflater.inflate(buffer);
|
||||
outputStream.append(new String(buffer, 0, count));
|
||||
}
|
||||
inflater.end();
|
||||
|
||||
return outputStream.toString();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
489b16c0ecda7987365cddd6b4d94fb2
|
||||
1bfbb1e08019e4c4d62dda45e6ff2113
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"spider": "https://mirror.ghproxy.com/https://github.com/bizhangjie/CatVodSpider/blob/main/jar/custom_spider.jar;md5;489b16c0ecda7987365cddd6b4d94fb2",
|
||||
"spider": "https://mirror.ghproxy.com/https://github.com/bizhangjie/CatVodSpider/blob/main/jar/custom_spider.jar;md5;1bfbb1e08019e4c4d62dda45e6ff2113",
|
||||
"lives": [
|
||||
{
|
||||
"name": "直播ipv6",
|
||||
@@ -75,6 +75,14 @@
|
||||
"searchable": 1,
|
||||
"filterable": 1
|
||||
},
|
||||
{
|
||||
"key": "WWRR",
|
||||
"name": "我为人人 | 珍惜",
|
||||
"type": 3,
|
||||
"api": "csp_WWRR",
|
||||
"searchable": 1,
|
||||
"filterable": 1
|
||||
},
|
||||
{
|
||||
"key": "JustLive",
|
||||
"name": "JustLive | 直播",
|
||||
|
||||
Reference in New Issue
Block a user