mirror of
https://github.com/bizhangjie/CatVodSpider.git
synced 2025-12-17 21:52:19 +00:00
'更新可用状态'
This commit is contained in:
@@ -9,6 +9,7 @@ import android.widget.Toast;
|
||||
|
||||
import com.github.catvod.R;
|
||||
import com.github.catvod.crawler.Spider;
|
||||
import com.github.catvod.spider.CaoLiu;
|
||||
import com.github.catvod.spider.Cg51;
|
||||
import com.github.catvod.spider.Douban;
|
||||
import com.github.catvod.spider.Ikanbot;
|
||||
@@ -17,6 +18,7 @@ import com.github.catvod.spider.J91;
|
||||
import com.github.catvod.spider.Jable;
|
||||
import com.github.catvod.spider.JavDb;
|
||||
import com.github.catvod.spider.JustLive;
|
||||
import com.github.catvod.spider.MiMei;
|
||||
import com.github.catvod.spider.QxiTv;
|
||||
import com.github.catvod.spider.W55Movie;
|
||||
import com.github.catvod.spider.Wogg;
|
||||
@@ -60,7 +62,7 @@ public class MainActivity extends Activity {
|
||||
private void initSpider() {
|
||||
try {
|
||||
Init.init(getApplicationContext());
|
||||
spider = new XVideos();
|
||||
spider = new CaoLiu();
|
||||
spider.init(this, "");
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
@@ -85,7 +87,7 @@ public class MainActivity extends Activity {
|
||||
|
||||
public void categoryContent() {
|
||||
try {
|
||||
Logger.t("categoryContent").d(spider.categoryContent("", "2", true, new HashMap<>()));
|
||||
Logger.t("categoryContent").d(spider.categoryContent("6", "2", true, new HashMap<>()));
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -93,7 +95,7 @@ public class MainActivity extends Activity {
|
||||
|
||||
public void detailContent() {
|
||||
try {
|
||||
Logger.t("detailContent").d(spider.detailContent(Arrays.asList("/video79810059/_")));
|
||||
Logger.t("detailContent").d(spider.detailContent(Arrays.asList("1716500")));
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
187
app/src/main/java/com/github/catvod/spider/CaoLiu.java
Normal file
187
app/src/main/java/com/github/catvod/spider/CaoLiu.java
Normal file
@@ -0,0 +1,187 @@
|
||||
package com.github.catvod.spider;
|
||||
|
||||
import android.util.Base64;
|
||||
|
||||
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.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
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 java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
public class CaoLiu extends Spider {
|
||||
|
||||
private static final String siteUrl = "https://www.cld296.top";
|
||||
private static final String cateUrl = siteUrl + "/thread.php?fid=";
|
||||
private static final String detailUrl = siteUrl + "/video.php?tid=";
|
||||
private static final String searchUrl = "https://api.3bmmjla.life/Api/getSearch";
|
||||
|
||||
private HashMap<String, String> getHeaders() {
|
||||
HashMap<String, String> headers = new HashMap<>();
|
||||
headers.put("User-Agent", Util.CHROME);
|
||||
return headers;
|
||||
}
|
||||
|
||||
private HashMap<String, String> getCookie() {
|
||||
HashMap<String, String> headers = new HashMap<>();
|
||||
headers.put("User-Agent", Util.CHROME);
|
||||
headers.put("Cookie", "a2640_online=no; _gid=GA1.2.1938127140.1710303567; a2640_readlog=%2C2075561%2C; a2640_winduser=AFJWU1xdDT4EUldQAFAIBQlYCFJbBgdSWQ9WWAIAAgIAVwRZXAAAA20%3D; a2640_ck_info=%2F%09; a2640_appuser=DAUCUg5bDD0HVgYFVw9bUQlYBAUPB1VUWAxVXFNVVV1TAwRZUFdUAj8%3D; a2640_ol_offset=225119; a2640_threadlog=%2C2075561%2C47%2C; a2640_lastpos=other; _ga=GA1.1.745497893.1710303567; _ga_LQZNZ7TBVX=GS1.1.1710303566.1.1.1710305180.0.0.0; a2640_lastvisit=73%091710305199%09%2Fvideo.php%3Ftid%3D1948195; _ga_KCKJL9NRY7=GS1.1.1710303566.1.1.1710305199.0.0.0; _ga_QTT9CLMQSW=GS1.1.1710303566.1.1.1710305199.0.0.0; _ga_255J96M2SG=GS1.1.1710303566.1.1.1710305199.0.0.0");
|
||||
return headers;
|
||||
}
|
||||
|
||||
public List<Vod> parseHtml(Document document) {
|
||||
List<Vod> list = new ArrayList<>();
|
||||
for (Element element : document.select("div.vv-box")) {
|
||||
try {
|
||||
String pic = element.select("img").attr("data-aes");
|
||||
String id = element.select("img").attr("alt");
|
||||
// 获取图片进行解密
|
||||
String string = OkHttp.string(pic);
|
||||
String picView = aesDecrypt(string);
|
||||
String name = "看圖片";
|
||||
list.add(new Vod(id, name, picView));
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
private static final String IV = "IMGy92137kxhxabI";
|
||||
private static final String KEY = "I884417AYxOK0123";
|
||||
|
||||
// 解密方法
|
||||
private String aesDecrypt(String str) {
|
||||
try {
|
||||
byte[] ivBytes = IV.getBytes("UTF-8");
|
||||
byte[] keyBytes = KEY.getBytes("UTF-8");
|
||||
|
||||
SecretKey secretKey = new SecretKeySpec(keyBytes, "AES");
|
||||
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
|
||||
cipher.init(Cipher.DECRYPT_MODE, secretKey, new IvParameterSpec(ivBytes));
|
||||
|
||||
byte[] decryptedBytes = cipher.doFinal(Base64.decode(str, Base64.DEFAULT));
|
||||
return new String(decryptedBytes, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String homeContent(boolean filter) throws Exception {
|
||||
List<Class> classes = new ArrayList<>();
|
||||
String[] typeIdList = {"57", "33", "47", "6", "7", "2", "3", "4", "5", "48"};
|
||||
String[] typeNameList = {"VIP特享影視", "VIP影視專區", "草榴黑料記", "國產原創區", "中字原創區", "亞洲無碼區", "亞洲有碼區", "歐美原創區", "動漫原創區", "ASMR視訊區"};
|
||||
for (int i = 0; i < typeNameList.length; i++) {
|
||||
classes.add(new Class(typeIdList[i], typeNameList[i]));
|
||||
}
|
||||
List<Vod> list = new ArrayList<>();
|
||||
return Result.string(classes, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {
|
||||
String target = cateUrl + tid + "&page=" + pg;
|
||||
List<Vod> list = new ArrayList<>();
|
||||
// 只有图片模版
|
||||
if (tid == "57") {
|
||||
Document doc = Jsoup.parse(OkHttp.string(target, getHeaders()));
|
||||
list = parseHtml(doc);
|
||||
}
|
||||
// 图文结合模版
|
||||
if (tid == "47") {
|
||||
Document doc = Jsoup.parse(OkHttp.string(target, getCookie()));
|
||||
for (Element element : doc.select("div.url_linkkarl")) {
|
||||
String pic = element.select("img").attr("data-aes");
|
||||
String href = element.attr("data-url").replace("read.php?tid=", "").split("&")[0];
|
||||
String name = element.select("h2").text();
|
||||
// 获取图片进行解密
|
||||
String string = OkHttp.string(pic);
|
||||
String picView = aesDecrypt(string);
|
||||
list.add(new Vod(href, name, picView));
|
||||
}
|
||||
}
|
||||
// 文字列表模版
|
||||
else {
|
||||
Document doc = Jsoup.parse(OkHttp.string(target, getCookie()));
|
||||
for (Element element : doc.select("td.tal")) {
|
||||
String id = element.select("a").attr("href").replace("read.php?tid=", "").split("&")[0];
|
||||
String name = element.select("a").text();
|
||||
list.add(new Vod(id, name, ""));
|
||||
}
|
||||
}
|
||||
|
||||
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))));
|
||||
String name = doc.select("title").text().replace(" - | 草榴社區", "");
|
||||
|
||||
Pattern pattern = Pattern.compile("url: '(.*?)',");
|
||||
Matcher matcher = pattern.matcher(doc.html());
|
||||
String PlayUrl = "";
|
||||
// 提取匹配到的内容
|
||||
if (matcher.find()) {
|
||||
PlayUrl = matcher.group(1);
|
||||
}
|
||||
Vod vod = new Vod();
|
||||
vod.setVodId(ids.get(0));
|
||||
vod.setVodName(name);
|
||||
vod.setVodPlayFrom("草榴");
|
||||
vod.setVodPlayUrl("播放$" + PlayUrl);
|
||||
return Result.string(vod);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String searchContent(String key, boolean quick) throws Exception {
|
||||
String target = searchUrl;
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("className", "ed5315ea37ade2181edbd8b27b3fc881");
|
||||
params.put("keyword", key);
|
||||
params.put("page", "1");
|
||||
params.put("limit", "24");
|
||||
String data = OkHttp.post(target, params);
|
||||
Gson gson = new Gson();
|
||||
JsonObject jsonObject = gson.fromJson(data, JsonObject.class);
|
||||
JsonArray array = jsonObject.getAsJsonArray("data");
|
||||
List<Vod> list = new ArrayList<>();
|
||||
for (JsonElement element : array) {
|
||||
JsonObject object = element.getAsJsonObject();
|
||||
String title = object.get("title").toString().replace("\"", "");
|
||||
String pic = "https://3bmmaeh.life/pic" + object.get("titlepic").toString().replace("\"", "");
|
||||
String id = object.get("titleurl").toString().replace("\"", "");
|
||||
list.add(new Vod(id, title, 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();
|
||||
}
|
||||
}
|
||||
129
app/src/main/java/com/github/catvod/spider/MiMei.java
Normal file
129
app/src/main/java/com/github/catvod/spider/MiMei.java
Normal file
@@ -0,0 +1,129 @@
|
||||
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.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.jsoup.nodes.Element;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class MiMei extends Spider {
|
||||
|
||||
private static final String siteUrl = "https://infmbln.info";
|
||||
private static final String cateUrl = siteUrl + "/suoyoushipin/";
|
||||
private static final String detailUrl = siteUrl;
|
||||
private static final String searchUrl = "https://api.3bmmjla.life/Api/getSearch";
|
||||
|
||||
private HashMap<String, String> getHeaders() {
|
||||
HashMap<String, String> headers = new HashMap<>();
|
||||
headers.put("User-Agent", Util.CHROME);
|
||||
return headers;
|
||||
}
|
||||
|
||||
public List<Vod> parseHtml(Document document){
|
||||
List<Vod> list = new ArrayList<>();
|
||||
for (Element element : document.select("div.pos")) {
|
||||
try {
|
||||
String pic = element.select("img").attr("src");
|
||||
String id = element.select("a").attr("href");
|
||||
String name = element.select("a").attr("title").replace("迷妹推荐--","");
|
||||
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<>();
|
||||
Document doc = Jsoup.parse(OkHttp.string(siteUrl,getHeaders()));
|
||||
for (Element element : doc.select("div.hend").select("li")) {
|
||||
try {
|
||||
String typeId = element.select("a").attr("href").split("/")[2];
|
||||
String typeName = element.select("a").text();
|
||||
classes.add(new Class(typeId, typeName));
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
}
|
||||
doc = Jsoup.parse(OkHttp.string(siteUrl, getHeaders()));
|
||||
List<Vod> list = parseHtml(doc);
|
||||
return Result.string(classes, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {
|
||||
String target = cateUrl + tid + "/index_" + pg + ".html";
|
||||
Document doc = Jsoup.parse(OkHttp.string(target, getHeaders()));
|
||||
List<Vod> list = parseHtml(doc);
|
||||
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))));
|
||||
String name = doc.select("title").text().replace("迷妹推荐--","");
|
||||
|
||||
Pattern pattern = Pattern.compile("vHLSurl = \\\"(.*?)\\\";");
|
||||
Matcher matcher = pattern.matcher(doc.html());
|
||||
String PlayUrl = "";
|
||||
// 提取匹配到的内容
|
||||
if (matcher.find()) {
|
||||
PlayUrl = matcher.group(1);
|
||||
}
|
||||
Vod vod = new Vod();
|
||||
vod.setVodId(ids.get(0));
|
||||
vod.setVodName(name);
|
||||
vod.setVodPlayFrom("MiMei");
|
||||
vod.setVodPlayUrl("播放$" + "https://3bmmikh.life/new/hls" + PlayUrl);
|
||||
return Result.string(vod);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String searchContent(String key, boolean quick) throws Exception {
|
||||
String target = searchUrl;
|
||||
Map<String,String> params = new HashMap<>();
|
||||
params.put("className", "ed5315ea37ade2181edbd8b27b3fc881");
|
||||
params.put("keyword", key);
|
||||
params.put("page", "1");
|
||||
params.put("limit", "24");
|
||||
String data = OkHttp.post(target, params);
|
||||
Gson gson = new Gson();
|
||||
JsonObject jsonObject = gson.fromJson(data, JsonObject.class);
|
||||
JsonArray array = jsonObject.getAsJsonArray("data");
|
||||
List<Vod> list = new ArrayList<>();
|
||||
for (JsonElement element : array) {
|
||||
JsonObject object = element.getAsJsonObject();
|
||||
String title = object.get("title").toString().replace("\"","");
|
||||
String pic = "https://3bmmaeh.life/pic" + object.get("titlepic").toString().replace("\"","");
|
||||
String id = object.get("titleurl").toString().replace("\"","");
|
||||
list.add(new Vod(id,title,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();
|
||||
}
|
||||
}
|
||||
@@ -32,9 +32,22 @@ public class XVideos extends Spider {
|
||||
return headers;
|
||||
}
|
||||
|
||||
public List<Vod> parseHtml(Document document){
|
||||
List<Vod> list = new ArrayList<>();
|
||||
for (Element element : document.select("div.thumb-block")) {
|
||||
try {
|
||||
String pic = element.select("img").attr("src");
|
||||
String id = element.select("a").attr("href");
|
||||
String name = element.select("p.title").select("a").attr("title");
|
||||
list.add(new Vod(id, name, pic));
|
||||
}catch (Exception e){
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String homeContent(boolean filter) throws Exception {
|
||||
List<Vod> list = new ArrayList<>();
|
||||
List<Class> classes = new ArrayList<>();
|
||||
Document doc = Jsoup.parse(OkHttp.string(cateUrl,getHeaders()));
|
||||
for (Element element : doc.select("div#date-links-pagination").select("li")) {
|
||||
@@ -47,34 +60,15 @@ public class XVideos extends Spider {
|
||||
}
|
||||
}
|
||||
doc = Jsoup.parse(OkHttp.string(siteUrl, getHeaders()));
|
||||
for (Element element : doc.select("div.thumb-block")) {
|
||||
try {
|
||||
String pic = element.select("img").attr("src");
|
||||
String id = element.select("a").attr("href");
|
||||
String name = element.select("p.title").select("a").attr("title");
|
||||
list.add(new Vod(id, name, pic));
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
}
|
||||
List<Vod> list = parseHtml(doc);
|
||||
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 + "/" + pg;
|
||||
Document doc = Jsoup.parse(OkHttp.string(target, getHeaders()));
|
||||
for (Element element : doc.select("div.thumb-block")) {
|
||||
try {
|
||||
String pic = element.select("img").attr("src");
|
||||
String id = element.select("a").attr("href");
|
||||
String name = element.select("p.title").select("a").attr("title");
|
||||
list.add(new Vod(id, name, pic));
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
}
|
||||
List<Vod> list = parseHtml(doc);
|
||||
Integer total = (Integer.parseInt(pg)+1)*20;
|
||||
return Result.string(Integer.parseInt(pg),Integer.parseInt(pg)+1,20,total,list);
|
||||
}
|
||||
@@ -103,19 +97,9 @@ public class XVideos extends Spider {
|
||||
|
||||
@Override
|
||||
public String searchContent(String key, boolean quick) throws Exception {
|
||||
List<Vod> list = new ArrayList<>();
|
||||
String target = searchUrl + URLEncoder.encode(key) + "&p=1";
|
||||
Document doc = Jsoup.parse(OkHttp.string(target, getHeaders()));
|
||||
for (Element element : doc.select("div.thumb-block")) {
|
||||
try {
|
||||
String pic = element.select("img").attr("src");
|
||||
String id = element.select("a").attr("href");
|
||||
String name = element.select("p.title").select("a").attr("title");
|
||||
list.add(new Vod(id, name, pic));
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
}
|
||||
List<Vod> list = parseHtml(doc);
|
||||
return Result.string(list);
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
1e2a8f46eac7e31b1ab65bcec3a13ec8
|
||||
ef2960a148d277b8b707f32a51a859bd
|
||||
|
||||
@@ -78,6 +78,22 @@
|
||||
"searchable": 1,
|
||||
"filterable": 1
|
||||
},
|
||||
{
|
||||
"key": "MiMei",
|
||||
"name": "MiMei",
|
||||
"type": 3,
|
||||
"api": "csp_MiMei",
|
||||
"searchable": 1,
|
||||
"filterable": 1
|
||||
},
|
||||
{
|
||||
"key": "CaoLiu",
|
||||
"name": "CaoLiu",
|
||||
"type": 3,
|
||||
"api": "csp_CaoLiu",
|
||||
"searchable": 0,
|
||||
"filterable": 1
|
||||
},
|
||||
{
|
||||
"key": "push_agent",
|
||||
"name": "推送",
|
||||
|
||||
Reference in New Issue
Block a user