多个网盘
This commit is contained in:
parent
9a221ab044
commit
b8c679f295
|
|
@ -0,0 +1,164 @@
|
||||||
|
package com.github.catvod.spider;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import com.github.catvod.bean.Class;
|
||||||
|
import com.github.catvod.bean.Result;
|
||||||
|
import com.github.catvod.bean.Vod;
|
||||||
|
import com.github.catvod.net.OkHttp;
|
||||||
|
import com.github.catvod.utils.Json;
|
||||||
|
import com.github.catvod.utils.Util;
|
||||||
|
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 org.jsoup.select.Elements;
|
||||||
|
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhixc
|
||||||
|
*/
|
||||||
|
public class DuoDuo extends Cloud {
|
||||||
|
|
||||||
|
private String siteUrl = "https://tv.yydsys.top/";
|
||||||
|
private final Pattern regexCategory = Pattern.compile("/vodtype/(\\w+).html");
|
||||||
|
private final Pattern regexPageTotal = Pattern.compile("\\$\\(\"\\.mac_total\"\\)\\.text\\('(\\d+)'\\);");
|
||||||
|
|
||||||
|
private Map<String, String> getHeader() {
|
||||||
|
Map<String, String> header = new HashMap<>();
|
||||||
|
header.put("User-Agent", Util.CHROME);
|
||||||
|
return header;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(Context context, String extend) throws Exception {
|
||||||
|
JsonObject ext = Json.safeObject(extend);
|
||||||
|
JsonArray siteList = ext.get("site").getAsJsonArray();
|
||||||
|
if (!siteList.isEmpty()) {
|
||||||
|
for (JsonElement jsonElement : siteList) {
|
||||||
|
String html = OkHttp.string(jsonElement.getAsString());
|
||||||
|
if (html.contains("电影")) {
|
||||||
|
siteUrl = jsonElement.getAsString();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.init(context, extend);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String homeContent(boolean filter) {
|
||||||
|
List<Class> classes = new ArrayList<>();
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(siteUrl, getHeader()));
|
||||||
|
Elements elements = doc.select(".nav-link");
|
||||||
|
for (Element e : elements) {
|
||||||
|
Matcher mather = regexCategory.matcher(e.attr("href"));
|
||||||
|
if (mather.find()) {
|
||||||
|
classes.add(new Class(mather.group(1), e.text().trim()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Result.string(classes, parseVodListFromDoc(doc));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) {
|
||||||
|
String[] urlParams = new String[]{tid, "", "", "", "", "", "", "", pg, "", "", ""};
|
||||||
|
if (extend != null && extend.size() > 0) {
|
||||||
|
for (String key : extend.keySet()) {
|
||||||
|
urlParams[Integer.parseInt(key)] = extend.get(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(String.format("%s/index.php/vodshow/%s.html", siteUrl, String.join("-", urlParams)), getHeader()));
|
||||||
|
int page = Integer.parseInt(pg), limit = 72, total = 0;
|
||||||
|
Matcher matcher = regexPageTotal.matcher(doc.html());
|
||||||
|
if (matcher.find()) total = Integer.parseInt(matcher.group(1));
|
||||||
|
int count = total <= limit ? 1 : ((int) Math.ceil(total / (double) limit));
|
||||||
|
return Result.get().vod(parseVodListFromDoc(doc)).page(page, count, limit, total).string();
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Vod> parseVodListFromDoc(Document doc) {
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
Elements elements = doc.select(".module-item");
|
||||||
|
for (Element e : elements) {
|
||||||
|
String vodId = e.selectFirst(".video-name a").attr("href");
|
||||||
|
String vodPic = e.selectFirst(".module-item-pic > img").attr("data-src");
|
||||||
|
String vodName = e.selectFirst(".video-name").text();
|
||||||
|
String vodRemarks = e.selectFirst(".module-item-text").text();
|
||||||
|
list.add(new Vod(vodId, vodName, vodPic, vodRemarks));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String detailContent(List<String> ids) throws Exception {
|
||||||
|
String vodId = ids.get(0);
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(siteUrl + vodId, getHeader()));
|
||||||
|
|
||||||
|
Vod item = new Vod();
|
||||||
|
item.setVodId(vodId);
|
||||||
|
item.setVodName(doc.selectFirst(".video-info-header > .page-title").text());
|
||||||
|
item.setVodPic(doc.selectFirst(".module-item-pic img").attr("data-src"));
|
||||||
|
item.setVodArea(doc.select(".video-info-header a.tag-link").last().text());
|
||||||
|
item.setTypeName(String.join(",", doc.select(".video-info-header div.tag-link a").eachText()));
|
||||||
|
|
||||||
|
List<String> shareLinks = doc.select(".module-row-text").eachAttr("data-clipboard-text");
|
||||||
|
for (int i = 0; i < shareLinks.size(); i++) {
|
||||||
|
shareLinks.set(i, shareLinks.get(i).trim());
|
||||||
|
//String detailContent = super.detailContent(List.of(shareLinks.get(i)));
|
||||||
|
}
|
||||||
|
item.setVodPlayUrl(super.detailContentVodPlayUrl(shareLinks));
|
||||||
|
item.setVodPlayFrom(super.detailContentVodPlayFrom(shareLinks));
|
||||||
|
|
||||||
|
Elements elements = doc.select(".video-info-item");
|
||||||
|
for (Element e : elements) {
|
||||||
|
String title = e.previousElementSibling().text();
|
||||||
|
if (title.contains("导演")) {
|
||||||
|
item.setVodDirector(String.join(",", e.select("a").eachText()));
|
||||||
|
} else if (title.contains("主演")) {
|
||||||
|
item.setVodActor(String.join(",", e.select("a").eachText()));
|
||||||
|
} else if (title.contains("年代")) {
|
||||||
|
item.setVodYear(e.selectFirst("a").text().trim());
|
||||||
|
} else if (title.contains("备注")) {
|
||||||
|
item.setVodRemarks(e.text().trim());
|
||||||
|
} else if (title.contains("剧情")) {
|
||||||
|
item.setVodContent(e.selectFirst(".sqjj_a").text().replace("[收起部分]", "").trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.string(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String searchContent(String key, boolean quick) throws Exception {
|
||||||
|
return searchContent(key, "1");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String searchContent(String key, boolean quick, String pg) throws Exception {
|
||||||
|
return searchContent(key, pg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private String searchContent(String key, String pg) {
|
||||||
|
String searchURL = siteUrl + String.format("/index.php/vodsearch/%s----------%s---.html", URLEncoder.encode(key), pg);
|
||||||
|
String html = OkHttp.string(searchURL, getHeader());
|
||||||
|
Elements items = Jsoup.parse(html).select(".module-search-item");
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
for (Element item : items) {
|
||||||
|
String vodId = item.select(".video-serial").attr("href");
|
||||||
|
String name = item.select(".video-serial").attr("title");
|
||||||
|
String pic = item.select(".module-item-pic > img").attr("data-src");
|
||||||
|
String remark = item.select(".video-tag-icon").text();
|
||||||
|
list.add(new Vod(vodId, name, pic, remark));
|
||||||
|
}
|
||||||
|
return Result.string(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -24,7 +24,7 @@ import java.util.regex.Pattern;
|
||||||
*/
|
*/
|
||||||
public class Mogg extends Cloud {
|
public class Mogg extends Cloud {
|
||||||
|
|
||||||
private final String siteUrl = "https://www.mogg.top/";
|
private final String siteUrl = "https://woog.nxog.eu.org/";
|
||||||
private final Pattern regexCategory = Pattern.compile("index.php/vod/type/id/(\\w+).html");
|
private final Pattern regexCategory = Pattern.compile("index.php/vod/type/id/(\\w+).html");
|
||||||
private final Pattern regexPageTotal = Pattern.compile("\\$\\(\"\\.mac_total\"\\)\\.text\\('(\\d+)'\\);");
|
private final Pattern regexPageTotal = Pattern.compile("\\$\\(\"\\.mac_total\"\\)\\.text\\('(\\d+)'\\);");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,164 @@
|
||||||
|
package com.github.catvod.spider;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import com.github.catvod.bean.Class;
|
||||||
|
import com.github.catvod.bean.Result;
|
||||||
|
import com.github.catvod.bean.Vod;
|
||||||
|
import com.github.catvod.net.OkHttp;
|
||||||
|
import com.github.catvod.utils.Json;
|
||||||
|
import com.github.catvod.utils.Util;
|
||||||
|
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 org.jsoup.select.Elements;
|
||||||
|
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhixc
|
||||||
|
*/
|
||||||
|
public class NaBi extends Cloud {
|
||||||
|
|
||||||
|
private String siteUrl = "https://duopan.fun/";
|
||||||
|
private final Pattern regexCategory = Pattern.compile("/vodtype/(\\w+).html");
|
||||||
|
private final Pattern regexPageTotal = Pattern.compile("\\$\\(\"\\.mac_total\"\\)\\.text\\('(\\d+)'\\);");
|
||||||
|
|
||||||
|
private Map<String, String> getHeader() {
|
||||||
|
Map<String, String> header = new HashMap<>();
|
||||||
|
header.put("User-Agent", Util.CHROME);
|
||||||
|
return header;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(Context context, String extend) throws Exception {
|
||||||
|
JsonObject ext = Json.safeObject(extend);
|
||||||
|
JsonArray siteList = ext.get("site").getAsJsonArray();
|
||||||
|
if (!siteList.isEmpty()) {
|
||||||
|
for (JsonElement jsonElement : siteList) {
|
||||||
|
String html = OkHttp.string(jsonElement.getAsString());
|
||||||
|
if (html.contains("电影")) {
|
||||||
|
siteUrl = jsonElement.getAsString();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.init(context, extend);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String homeContent(boolean filter) {
|
||||||
|
List<Class> classes = new ArrayList<>();
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(siteUrl, getHeader()));
|
||||||
|
Elements elements = doc.select(".nav-link");
|
||||||
|
for (Element e : elements) {
|
||||||
|
Matcher mather = regexCategory.matcher(e.attr("href"));
|
||||||
|
if (mather.find()) {
|
||||||
|
classes.add(new Class(mather.group(1), e.text().trim()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Result.string(classes, parseVodListFromDoc(doc));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) {
|
||||||
|
String[] urlParams = new String[]{tid, "", "", "", "", "", "", "", pg, "", "", ""};
|
||||||
|
if (extend != null && extend.size() > 0) {
|
||||||
|
for (String key : extend.keySet()) {
|
||||||
|
urlParams[Integer.parseInt(key)] = extend.get(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(String.format("%s/index.php/vodshow/%s.html", siteUrl, String.join("-", urlParams)), getHeader()));
|
||||||
|
int page = Integer.parseInt(pg), limit = 72, total = 0;
|
||||||
|
Matcher matcher = regexPageTotal.matcher(doc.html());
|
||||||
|
if (matcher.find()) total = Integer.parseInt(matcher.group(1));
|
||||||
|
int count = total <= limit ? 1 : ((int) Math.ceil(total / (double) limit));
|
||||||
|
return Result.get().vod(parseVodListFromDoc(doc)).page(page, count, limit, total).string();
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Vod> parseVodListFromDoc(Document doc) {
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
Elements elements = doc.select(".module-item");
|
||||||
|
for (Element e : elements) {
|
||||||
|
String vodId = e.selectFirst(".video-name a").attr("href");
|
||||||
|
String vodPic = e.selectFirst(".module-item-pic > img").attr("data-src");
|
||||||
|
String vodName = e.selectFirst(".video-name").text();
|
||||||
|
String vodRemarks = e.selectFirst(".module-item-text").text();
|
||||||
|
list.add(new Vod(vodId, vodName, vodPic, vodRemarks));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String detailContent(List<String> ids) throws Exception {
|
||||||
|
String vodId = ids.get(0);
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(siteUrl + vodId, getHeader()));
|
||||||
|
|
||||||
|
Vod item = new Vod();
|
||||||
|
item.setVodId(vodId);
|
||||||
|
item.setVodName(doc.selectFirst(".video-info-header > .page-title").text());
|
||||||
|
item.setVodPic(doc.selectFirst(".module-item-pic img").attr("data-src"));
|
||||||
|
item.setVodArea(doc.select(".video-info-header a.tag-link").last().text());
|
||||||
|
item.setTypeName(String.join(",", doc.select(".video-info-header div.tag-link a").eachText()));
|
||||||
|
|
||||||
|
List<String> shareLinks = doc.select(".module-row-text").eachAttr("data-clipboard-text");
|
||||||
|
for (int i = 0; i < shareLinks.size(); i++) {
|
||||||
|
shareLinks.set(i, shareLinks.get(i).trim());
|
||||||
|
//String detailContent = super.detailContent(List.of(shareLinks.get(i)));
|
||||||
|
}
|
||||||
|
item.setVodPlayUrl(super.detailContentVodPlayUrl(shareLinks));
|
||||||
|
item.setVodPlayFrom(super.detailContentVodPlayFrom(shareLinks));
|
||||||
|
|
||||||
|
Elements elements = doc.select(".video-info-item");
|
||||||
|
for (Element e : elements) {
|
||||||
|
String title = e.previousElementSibling().text();
|
||||||
|
if (title.contains("导演")) {
|
||||||
|
item.setVodDirector(String.join(",", e.select("a").eachText()));
|
||||||
|
} else if (title.contains("主演")) {
|
||||||
|
item.setVodActor(String.join(",", e.select("a").eachText()));
|
||||||
|
} else if (title.contains("年代")) {
|
||||||
|
item.setVodYear(e.selectFirst("a").text().trim());
|
||||||
|
} else if (title.contains("备注")) {
|
||||||
|
item.setVodRemarks(e.text().trim());
|
||||||
|
} else if (title.contains("剧情")) {
|
||||||
|
item.setVodContent(e.selectFirst(".sqjj_a").text().replace("[收起部分]", "").trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.string(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String searchContent(String key, boolean quick) throws Exception {
|
||||||
|
return searchContent(key, "1");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String searchContent(String key, boolean quick, String pg) throws Exception {
|
||||||
|
return searchContent(key, pg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private String searchContent(String key, String pg) {
|
||||||
|
String searchURL = siteUrl + String.format("/index.php/vodsearch/%s----------%s---.html", URLEncoder.encode(key), pg);
|
||||||
|
String html = OkHttp.string(searchURL, getHeader());
|
||||||
|
Elements items = Jsoup.parse(html).select(".module-search-item");
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
for (Element item : items) {
|
||||||
|
String vodId = item.select(".video-serial").attr("href");
|
||||||
|
String name = item.select(".video-serial").attr("title");
|
||||||
|
String pic = item.select(".module-item-pic > img").attr("data-src");
|
||||||
|
String remark = item.select(".video-tag-icon").text();
|
||||||
|
list.add(new Vod(vodId, name, pic, remark));
|
||||||
|
}
|
||||||
|
return Result.string(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,164 @@
|
||||||
|
package com.github.catvod.spider;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import com.github.catvod.bean.Class;
|
||||||
|
import com.github.catvod.bean.Result;
|
||||||
|
import com.github.catvod.bean.Vod;
|
||||||
|
import com.github.catvod.net.OkHttp;
|
||||||
|
import com.github.catvod.utils.Json;
|
||||||
|
import com.github.catvod.utils.Util;
|
||||||
|
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 org.jsoup.select.Elements;
|
||||||
|
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhixc
|
||||||
|
*/
|
||||||
|
public class ShanDian extends Cloud {
|
||||||
|
|
||||||
|
private String siteUrl = "http://1.95.79.193/";
|
||||||
|
private final Pattern regexCategory = Pattern.compile("/vodtype/(\\w+).html");
|
||||||
|
private final Pattern regexPageTotal = Pattern.compile("\\$\\(\"\\.mac_total\"\\)\\.text\\('(\\d+)'\\);");
|
||||||
|
|
||||||
|
private Map<String, String> getHeader() {
|
||||||
|
Map<String, String> header = new HashMap<>();
|
||||||
|
header.put("User-Agent", Util.CHROME);
|
||||||
|
return header;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(Context context, String extend) throws Exception {
|
||||||
|
JsonObject ext = Json.safeObject(extend);
|
||||||
|
JsonArray siteList = ext.get("site").getAsJsonArray();
|
||||||
|
if (!siteList.isEmpty()) {
|
||||||
|
for (JsonElement jsonElement : siteList) {
|
||||||
|
String html = OkHttp.string(jsonElement.getAsString());
|
||||||
|
if (html.contains("电影")) {
|
||||||
|
siteUrl = jsonElement.getAsString();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.init(context, extend);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String homeContent(boolean filter) {
|
||||||
|
List<Class> classes = new ArrayList<>();
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(siteUrl, getHeader()));
|
||||||
|
Elements elements = doc.select(".nav-link");
|
||||||
|
for (Element e : elements) {
|
||||||
|
Matcher mather = regexCategory.matcher(e.attr("href"));
|
||||||
|
if (mather.find()) {
|
||||||
|
classes.add(new Class(mather.group(1), e.text().trim()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Result.string(classes, parseVodListFromDoc(doc));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) {
|
||||||
|
String[] urlParams = new String[]{tid, "", "", "", "", "", "", "", pg, "", "", ""};
|
||||||
|
if (extend != null && extend.size() > 0) {
|
||||||
|
for (String key : extend.keySet()) {
|
||||||
|
urlParams[Integer.parseInt(key)] = extend.get(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(String.format("%s/index.php/vodshow/%s.html", siteUrl, String.join("-", urlParams)), getHeader()));
|
||||||
|
int page = Integer.parseInt(pg), limit = 72, total = 0;
|
||||||
|
Matcher matcher = regexPageTotal.matcher(doc.html());
|
||||||
|
if (matcher.find()) total = Integer.parseInt(matcher.group(1));
|
||||||
|
int count = total <= limit ? 1 : ((int) Math.ceil(total / (double) limit));
|
||||||
|
return Result.get().vod(parseVodListFromDoc(doc)).page(page, count, limit, total).string();
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Vod> parseVodListFromDoc(Document doc) {
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
Elements elements = doc.select(".module-item");
|
||||||
|
for (Element e : elements) {
|
||||||
|
String vodId = e.selectFirst(".video-name a").attr("href");
|
||||||
|
String vodPic = e.selectFirst(".module-item-pic > img").attr("data-src");
|
||||||
|
String vodName = e.selectFirst(".video-name").text();
|
||||||
|
String vodRemarks = e.selectFirst(".module-item-text").text();
|
||||||
|
list.add(new Vod(vodId, vodName, vodPic, vodRemarks));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String detailContent(List<String> ids) throws Exception {
|
||||||
|
String vodId = ids.get(0);
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(siteUrl + vodId, getHeader()));
|
||||||
|
|
||||||
|
Vod item = new Vod();
|
||||||
|
item.setVodId(vodId);
|
||||||
|
item.setVodName(doc.selectFirst(".video-info-header > .page-title").text());
|
||||||
|
item.setVodPic(doc.selectFirst(".module-item-pic img").attr("data-src"));
|
||||||
|
item.setVodArea(doc.select(".video-info-header a.tag-link").last().text());
|
||||||
|
item.setTypeName(String.join(",", doc.select(".video-info-header div.tag-link a").eachText()));
|
||||||
|
|
||||||
|
List<String> shareLinks = doc.select(".module-row-text").eachAttr("data-clipboard-text");
|
||||||
|
for (int i = 0; i < shareLinks.size(); i++) {
|
||||||
|
shareLinks.set(i, shareLinks.get(i).trim());
|
||||||
|
//String detailContent = super.detailContent(List.of(shareLinks.get(i)));
|
||||||
|
}
|
||||||
|
item.setVodPlayUrl(super.detailContentVodPlayUrl(shareLinks));
|
||||||
|
item.setVodPlayFrom(super.detailContentVodPlayFrom(shareLinks));
|
||||||
|
|
||||||
|
Elements elements = doc.select(".video-info-item");
|
||||||
|
for (Element e : elements) {
|
||||||
|
String title = e.previousElementSibling().text();
|
||||||
|
if (title.contains("导演")) {
|
||||||
|
item.setVodDirector(String.join(",", e.select("a").eachText()));
|
||||||
|
} else if (title.contains("主演")) {
|
||||||
|
item.setVodActor(String.join(",", e.select("a").eachText()));
|
||||||
|
} else if (title.contains("年代")) {
|
||||||
|
item.setVodYear(e.selectFirst("a").text().trim());
|
||||||
|
} else if (title.contains("备注")) {
|
||||||
|
item.setVodRemarks(e.text().trim());
|
||||||
|
} else if (title.contains("剧情")) {
|
||||||
|
item.setVodContent(e.selectFirst(".sqjj_a").text().replace("[收起部分]", "").trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.string(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String searchContent(String key, boolean quick) throws Exception {
|
||||||
|
return searchContent(key, "1");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String searchContent(String key, boolean quick, String pg) throws Exception {
|
||||||
|
return searchContent(key, pg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private String searchContent(String key, String pg) {
|
||||||
|
String searchURL = siteUrl + String.format("/index.php/vodsearch/%s----------%s---.html", URLEncoder.encode(key), pg);
|
||||||
|
String html = OkHttp.string(searchURL, getHeader());
|
||||||
|
Elements items = Jsoup.parse(html).select(".module-search-item");
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
for (Element item : items) {
|
||||||
|
String vodId = item.select(".video-serial").attr("href");
|
||||||
|
String name = item.select(".video-serial").attr("title");
|
||||||
|
String pic = item.select(".module-item-pic > img").attr("data-src");
|
||||||
|
String remark = item.select(".video-tag-icon").text();
|
||||||
|
list.add(new Vod(vodId, name, pic, remark));
|
||||||
|
}
|
||||||
|
return Result.string(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,164 @@
|
||||||
|
package com.github.catvod.spider;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import com.github.catvod.bean.Class;
|
||||||
|
import com.github.catvod.bean.Result;
|
||||||
|
import com.github.catvod.bean.Vod;
|
||||||
|
import com.github.catvod.net.OkHttp;
|
||||||
|
import com.github.catvod.utils.Json;
|
||||||
|
import com.github.catvod.utils.Util;
|
||||||
|
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 org.jsoup.select.Elements;
|
||||||
|
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhixc
|
||||||
|
*/
|
||||||
|
public class TeXiaFan extends Cloud {
|
||||||
|
|
||||||
|
private String siteUrl = "http://www.xn--ghqy10g1w0a.xyz/";
|
||||||
|
private final Pattern regexCategory = Pattern.compile("/vodtype/(\\w+).html");
|
||||||
|
private final Pattern regexPageTotal = Pattern.compile("\\$\\(\"\\.mac_total\"\\)\\.text\\('(\\d+)'\\);");
|
||||||
|
|
||||||
|
private Map<String, String> getHeader() {
|
||||||
|
Map<String, String> header = new HashMap<>();
|
||||||
|
header.put("User-Agent", Util.CHROME);
|
||||||
|
return header;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(Context context, String extend) throws Exception {
|
||||||
|
JsonObject ext = Json.safeObject(extend);
|
||||||
|
JsonArray siteList = ext.get("site").getAsJsonArray();
|
||||||
|
if (!siteList.isEmpty()) {
|
||||||
|
for (JsonElement jsonElement : siteList) {
|
||||||
|
String html = OkHttp.string(jsonElement.getAsString());
|
||||||
|
if (html.contains("电影")) {
|
||||||
|
siteUrl = jsonElement.getAsString();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.init(context, extend);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String homeContent(boolean filter) {
|
||||||
|
List<Class> classes = new ArrayList<>();
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(siteUrl, getHeader()));
|
||||||
|
Elements elements = doc.select(".nav-link");
|
||||||
|
for (Element e : elements) {
|
||||||
|
Matcher mather = regexCategory.matcher(e.attr("href"));
|
||||||
|
if (mather.find()) {
|
||||||
|
classes.add(new Class(mather.group(1), e.text().trim()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Result.string(classes, parseVodListFromDoc(doc));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) {
|
||||||
|
String[] urlParams = new String[]{tid, "", "", "", "", "", "", "", pg, "", "", ""};
|
||||||
|
if (extend != null && extend.size() > 0) {
|
||||||
|
for (String key : extend.keySet()) {
|
||||||
|
urlParams[Integer.parseInt(key)] = extend.get(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(String.format("%s/index.php/vodshow/%s.html", siteUrl, String.join("-", urlParams)), getHeader()));
|
||||||
|
int page = Integer.parseInt(pg), limit = 72, total = 0;
|
||||||
|
Matcher matcher = regexPageTotal.matcher(doc.html());
|
||||||
|
if (matcher.find()) total = Integer.parseInt(matcher.group(1));
|
||||||
|
int count = total <= limit ? 1 : ((int) Math.ceil(total / (double) limit));
|
||||||
|
return Result.get().vod(parseVodListFromDoc(doc)).page(page, count, limit, total).string();
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Vod> parseVodListFromDoc(Document doc) {
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
Elements elements = doc.select(".module-item");
|
||||||
|
for (Element e : elements) {
|
||||||
|
String vodId = e.selectFirst(".video-name a").attr("href");
|
||||||
|
String vodPic = e.selectFirst(".module-item-pic > img").attr("data-src");
|
||||||
|
String vodName = e.selectFirst(".video-name").text();
|
||||||
|
String vodRemarks = e.selectFirst(".module-item-text").text();
|
||||||
|
list.add(new Vod(vodId, vodName, vodPic, vodRemarks));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String detailContent(List<String> ids) throws Exception {
|
||||||
|
String vodId = ids.get(0);
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(siteUrl + vodId, getHeader()));
|
||||||
|
|
||||||
|
Vod item = new Vod();
|
||||||
|
item.setVodId(vodId);
|
||||||
|
item.setVodName(doc.selectFirst(".video-info-header > .page-title").text());
|
||||||
|
item.setVodPic(doc.selectFirst(".module-item-pic img").attr("data-src"));
|
||||||
|
item.setVodArea(doc.select(".video-info-header a.tag-link").last().text());
|
||||||
|
item.setTypeName(String.join(",", doc.select(".video-info-header div.tag-link a").eachText()));
|
||||||
|
|
||||||
|
List<String> shareLinks = doc.select(".module-row-text").eachAttr("data-clipboard-text");
|
||||||
|
for (int i = 0; i < shareLinks.size(); i++) {
|
||||||
|
shareLinks.set(i, shareLinks.get(i).trim());
|
||||||
|
//String detailContent = super.detailContent(List.of(shareLinks.get(i)));
|
||||||
|
}
|
||||||
|
item.setVodPlayUrl(super.detailContentVodPlayUrl(shareLinks));
|
||||||
|
item.setVodPlayFrom(super.detailContentVodPlayFrom(shareLinks));
|
||||||
|
|
||||||
|
Elements elements = doc.select(".video-info-item");
|
||||||
|
for (Element e : elements) {
|
||||||
|
String title = e.previousElementSibling().text();
|
||||||
|
if (title.contains("导演")) {
|
||||||
|
item.setVodDirector(String.join(",", e.select("a").eachText()));
|
||||||
|
} else if (title.contains("主演")) {
|
||||||
|
item.setVodActor(String.join(",", e.select("a").eachText()));
|
||||||
|
} else if (title.contains("年代")) {
|
||||||
|
item.setVodYear(e.selectFirst("a").text().trim());
|
||||||
|
} else if (title.contains("备注")) {
|
||||||
|
item.setVodRemarks(e.text().trim());
|
||||||
|
} else if (title.contains("剧情")) {
|
||||||
|
item.setVodContent(e.selectFirst(".sqjj_a").text().replace("[收起部分]", "").trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.string(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String searchContent(String key, boolean quick) throws Exception {
|
||||||
|
return searchContent(key, "1");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String searchContent(String key, boolean quick, String pg) throws Exception {
|
||||||
|
return searchContent(key, pg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private String searchContent(String key, String pg) {
|
||||||
|
String searchURL = siteUrl + String.format("/index.php/vodsearch/%s----------%s---.html", URLEncoder.encode(key), pg);
|
||||||
|
String html = OkHttp.string(searchURL, getHeader());
|
||||||
|
Elements items = Jsoup.parse(html).select(".module-search-item");
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
for (Element item : items) {
|
||||||
|
String vodId = item.select(".video-serial").attr("href");
|
||||||
|
String name = item.select(".video-serial").attr("title");
|
||||||
|
String pic = item.select(".module-item-pic > img").attr("data-src");
|
||||||
|
String remark = item.select(".video-tag-icon").text();
|
||||||
|
list.add(new Vod(vodId, name, pic, remark));
|
||||||
|
}
|
||||||
|
return Result.string(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -47,7 +47,7 @@ public class Wogg extends Cloud {
|
||||||
if (!siteList.isEmpty()) {
|
if (!siteList.isEmpty()) {
|
||||||
for (JsonElement jsonElement : siteList) {
|
for (JsonElement jsonElement : siteList) {
|
||||||
String html = OkHttp.string(jsonElement.getAsString());
|
String html = OkHttp.string(jsonElement.getAsString());
|
||||||
if (html.contains("玩偶哥哥")) {
|
if (html.contains("电影")) {
|
||||||
siteUrl = jsonElement.getAsString();
|
siteUrl = jsonElement.getAsString();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,164 @@
|
||||||
|
package com.github.catvod.spider;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import com.github.catvod.bean.Class;
|
||||||
|
import com.github.catvod.bean.Result;
|
||||||
|
import com.github.catvod.bean.Vod;
|
||||||
|
import com.github.catvod.net.OkHttp;
|
||||||
|
import com.github.catvod.utils.Json;
|
||||||
|
import com.github.catvod.utils.Util;
|
||||||
|
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 org.jsoup.select.Elements;
|
||||||
|
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhixc
|
||||||
|
*/
|
||||||
|
public class XiaoMi extends Cloud {
|
||||||
|
|
||||||
|
private String siteUrl = "https://milvdou.fun/";
|
||||||
|
private final Pattern regexCategory = Pattern.compile("/vodtype/(\\w+).html");
|
||||||
|
private final Pattern regexPageTotal = Pattern.compile("\\$\\(\"\\.mac_total\"\\)\\.text\\('(\\d+)'\\);");
|
||||||
|
|
||||||
|
private Map<String, String> getHeader() {
|
||||||
|
Map<String, String> header = new HashMap<>();
|
||||||
|
header.put("User-Agent", Util.CHROME);
|
||||||
|
return header;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(Context context, String extend) throws Exception {
|
||||||
|
JsonObject ext = Json.safeObject(extend);
|
||||||
|
JsonArray siteList = ext.get("site").getAsJsonArray();
|
||||||
|
if (!siteList.isEmpty()) {
|
||||||
|
for (JsonElement jsonElement : siteList) {
|
||||||
|
String html = OkHttp.string(jsonElement.getAsString());
|
||||||
|
if (html.contains("电影")) {
|
||||||
|
siteUrl = jsonElement.getAsString();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.init(context, extend);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String homeContent(boolean filter) {
|
||||||
|
List<Class> classes = new ArrayList<>();
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(siteUrl, getHeader()));
|
||||||
|
Elements elements = doc.select(".nav-link");
|
||||||
|
for (Element e : elements) {
|
||||||
|
Matcher mather = regexCategory.matcher(e.attr("href"));
|
||||||
|
if (mather.find()) {
|
||||||
|
classes.add(new Class(mather.group(1), e.text().trim()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Result.string(classes, parseVodListFromDoc(doc));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) {
|
||||||
|
String[] urlParams = new String[]{tid, "", "", "", "", "", "", "", pg, "", "", ""};
|
||||||
|
if (extend != null && extend.size() > 0) {
|
||||||
|
for (String key : extend.keySet()) {
|
||||||
|
urlParams[Integer.parseInt(key)] = extend.get(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(String.format("%s/index.php/vodshow/%s.html", siteUrl, String.join("-", urlParams)), getHeader()));
|
||||||
|
int page = Integer.parseInt(pg), limit = 72, total = 0;
|
||||||
|
Matcher matcher = regexPageTotal.matcher(doc.html());
|
||||||
|
if (matcher.find()) total = Integer.parseInt(matcher.group(1));
|
||||||
|
int count = total <= limit ? 1 : ((int) Math.ceil(total / (double) limit));
|
||||||
|
return Result.get().vod(parseVodListFromDoc(doc)).page(page, count, limit, total).string();
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Vod> parseVodListFromDoc(Document doc) {
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
Elements elements = doc.select(".module-item");
|
||||||
|
for (Element e : elements) {
|
||||||
|
String vodId = e.selectFirst(".video-name a").attr("href");
|
||||||
|
String vodPic = e.selectFirst(".module-item-pic > img").attr("data-src");
|
||||||
|
String vodName = e.selectFirst(".video-name").text();
|
||||||
|
String vodRemarks = e.selectFirst(".module-item-text").text();
|
||||||
|
list.add(new Vod(vodId, vodName, vodPic, vodRemarks));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String detailContent(List<String> ids) throws Exception {
|
||||||
|
String vodId = ids.get(0);
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(siteUrl + vodId, getHeader()));
|
||||||
|
|
||||||
|
Vod item = new Vod();
|
||||||
|
item.setVodId(vodId);
|
||||||
|
item.setVodName(doc.selectFirst(".video-info-header > .page-title").text());
|
||||||
|
item.setVodPic(doc.selectFirst(".module-item-pic img").attr("data-src"));
|
||||||
|
item.setVodArea(doc.select(".video-info-header a.tag-link").last().text());
|
||||||
|
item.setTypeName(String.join(",", doc.select(".video-info-header div.tag-link a").eachText()));
|
||||||
|
|
||||||
|
List<String> shareLinks = doc.select(".module-row-text").eachAttr("data-clipboard-text");
|
||||||
|
for (int i = 0; i < shareLinks.size(); i++) {
|
||||||
|
shareLinks.set(i, shareLinks.get(i).trim());
|
||||||
|
//String detailContent = super.detailContent(List.of(shareLinks.get(i)));
|
||||||
|
}
|
||||||
|
item.setVodPlayUrl(super.detailContentVodPlayUrl(shareLinks));
|
||||||
|
item.setVodPlayFrom(super.detailContentVodPlayFrom(shareLinks));
|
||||||
|
|
||||||
|
Elements elements = doc.select(".video-info-item");
|
||||||
|
for (Element e : elements) {
|
||||||
|
String title = e.previousElementSibling().text();
|
||||||
|
if (title.contains("导演")) {
|
||||||
|
item.setVodDirector(String.join(",", e.select("a").eachText()));
|
||||||
|
} else if (title.contains("主演")) {
|
||||||
|
item.setVodActor(String.join(",", e.select("a").eachText()));
|
||||||
|
} else if (title.contains("年代")) {
|
||||||
|
item.setVodYear(e.selectFirst("a").text().trim());
|
||||||
|
} else if (title.contains("备注")) {
|
||||||
|
item.setVodRemarks(e.text().trim());
|
||||||
|
} else if (title.contains("剧情")) {
|
||||||
|
item.setVodContent(e.selectFirst(".sqjj_a").text().replace("[收起部分]", "").trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.string(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String searchContent(String key, boolean quick) throws Exception {
|
||||||
|
return searchContent(key, "1");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String searchContent(String key, boolean quick, String pg) throws Exception {
|
||||||
|
return searchContent(key, pg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private String searchContent(String key, String pg) {
|
||||||
|
String searchURL = siteUrl + String.format("/index.php/vodsearch/%s----------%s---.html", URLEncoder.encode(key), pg);
|
||||||
|
String html = OkHttp.string(searchURL, getHeader());
|
||||||
|
Elements items = Jsoup.parse(html).select(".module-search-item");
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
for (Element item : items) {
|
||||||
|
String vodId = item.select(".video-serial").attr("href");
|
||||||
|
String name = item.select(".video-serial").attr("title");
|
||||||
|
String pic = item.select(".module-item-pic > img").attr("data-src");
|
||||||
|
String remark = item.select(".video-tag-icon").text();
|
||||||
|
list.add(new Vod(vodId, name, pic, remark));
|
||||||
|
}
|
||||||
|
return Result.string(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,164 @@
|
||||||
|
package com.github.catvod.spider;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import com.github.catvod.bean.Class;
|
||||||
|
import com.github.catvod.bean.Result;
|
||||||
|
import com.github.catvod.bean.Vod;
|
||||||
|
import com.github.catvod.net.OkHttp;
|
||||||
|
import com.github.catvod.utils.Json;
|
||||||
|
import com.github.catvod.utils.Util;
|
||||||
|
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 org.jsoup.select.Elements;
|
||||||
|
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhixc
|
||||||
|
*/
|
||||||
|
public class ZhiZhen extends Cloud {
|
||||||
|
|
||||||
|
private String siteUrl = "https://mihdr.top/";
|
||||||
|
private final Pattern regexCategory = Pattern.compile("/vodtype/(\\w+).html");
|
||||||
|
private final Pattern regexPageTotal = Pattern.compile("\\$\\(\"\\.mac_total\"\\)\\.text\\('(\\d+)'\\);");
|
||||||
|
|
||||||
|
private Map<String, String> getHeader() {
|
||||||
|
Map<String, String> header = new HashMap<>();
|
||||||
|
header.put("User-Agent", Util.CHROME);
|
||||||
|
return header;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(Context context, String extend) throws Exception {
|
||||||
|
JsonObject ext = Json.safeObject(extend);
|
||||||
|
JsonArray siteList = ext.get("site").getAsJsonArray();
|
||||||
|
if (!siteList.isEmpty()) {
|
||||||
|
for (JsonElement jsonElement : siteList) {
|
||||||
|
String html = OkHttp.string(jsonElement.getAsString());
|
||||||
|
if (html.contains("电影")) {
|
||||||
|
siteUrl = jsonElement.getAsString();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.init(context, extend);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String homeContent(boolean filter) {
|
||||||
|
List<Class> classes = new ArrayList<>();
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(siteUrl, getHeader()));
|
||||||
|
Elements elements = doc.select(".nav-link");
|
||||||
|
for (Element e : elements) {
|
||||||
|
Matcher mather = regexCategory.matcher(e.attr("href"));
|
||||||
|
if (mather.find()) {
|
||||||
|
classes.add(new Class(mather.group(1), e.text().trim()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Result.string(classes, parseVodListFromDoc(doc));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) {
|
||||||
|
String[] urlParams = new String[]{tid, "", "", "", "", "", "", "", pg, "", "", ""};
|
||||||
|
if (extend != null && extend.size() > 0) {
|
||||||
|
for (String key : extend.keySet()) {
|
||||||
|
urlParams[Integer.parseInt(key)] = extend.get(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(String.format("%s/index.php/vodshow/%s.html", siteUrl, String.join("-", urlParams)), getHeader()));
|
||||||
|
int page = Integer.parseInt(pg), limit = 72, total = 0;
|
||||||
|
Matcher matcher = regexPageTotal.matcher(doc.html());
|
||||||
|
if (matcher.find()) total = Integer.parseInt(matcher.group(1));
|
||||||
|
int count = total <= limit ? 1 : ((int) Math.ceil(total / (double) limit));
|
||||||
|
return Result.get().vod(parseVodListFromDoc(doc)).page(page, count, limit, total).string();
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Vod> parseVodListFromDoc(Document doc) {
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
Elements elements = doc.select(".module-item");
|
||||||
|
for (Element e : elements) {
|
||||||
|
String vodId = e.selectFirst(".video-name a").attr("href");
|
||||||
|
String vodPic = e.selectFirst(".module-item-pic > img").attr("data-src");
|
||||||
|
String vodName = e.selectFirst(".video-name").text();
|
||||||
|
String vodRemarks = e.selectFirst(".module-item-text").text();
|
||||||
|
list.add(new Vod(vodId, vodName, vodPic, vodRemarks));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String detailContent(List<String> ids) throws Exception {
|
||||||
|
String vodId = ids.get(0);
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(siteUrl + vodId, getHeader()));
|
||||||
|
|
||||||
|
Vod item = new Vod();
|
||||||
|
item.setVodId(vodId);
|
||||||
|
item.setVodName(doc.selectFirst(".video-info-header > .page-title").text());
|
||||||
|
item.setVodPic(doc.selectFirst(".module-item-pic img").attr("data-src"));
|
||||||
|
item.setVodArea(doc.select(".video-info-header a.tag-link").last().text());
|
||||||
|
item.setTypeName(String.join(",", doc.select(".video-info-header div.tag-link a").eachText()));
|
||||||
|
|
||||||
|
List<String> shareLinks = doc.select(".module-row-text").eachAttr("data-clipboard-text");
|
||||||
|
for (int i = 0; i < shareLinks.size(); i++) {
|
||||||
|
shareLinks.set(i, shareLinks.get(i).trim());
|
||||||
|
//String detailContent = super.detailContent(List.of(shareLinks.get(i)));
|
||||||
|
}
|
||||||
|
item.setVodPlayUrl(super.detailContentVodPlayUrl(shareLinks));
|
||||||
|
item.setVodPlayFrom(super.detailContentVodPlayFrom(shareLinks));
|
||||||
|
|
||||||
|
Elements elements = doc.select(".video-info-item");
|
||||||
|
for (Element e : elements) {
|
||||||
|
String title = e.previousElementSibling().text();
|
||||||
|
if (title.contains("导演")) {
|
||||||
|
item.setVodDirector(String.join(",", e.select("a").eachText()));
|
||||||
|
} else if (title.contains("主演")) {
|
||||||
|
item.setVodActor(String.join(",", e.select("a").eachText()));
|
||||||
|
} else if (title.contains("年代")) {
|
||||||
|
item.setVodYear(e.selectFirst("a").text().trim());
|
||||||
|
} else if (title.contains("备注")) {
|
||||||
|
item.setVodRemarks(e.text().trim());
|
||||||
|
} else if (title.contains("剧情")) {
|
||||||
|
item.setVodContent(e.selectFirst(".sqjj_a").text().replace("[收起部分]", "").trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.string(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String searchContent(String key, boolean quick) throws Exception {
|
||||||
|
return searchContent(key, "1");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String searchContent(String key, boolean quick, String pg) throws Exception {
|
||||||
|
return searchContent(key, pg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private String searchContent(String key, String pg) {
|
||||||
|
String searchURL = siteUrl + String.format("/index.php/vodsearch/%s----------%s---.html", URLEncoder.encode(key), pg);
|
||||||
|
String html = OkHttp.string(searchURL, getHeader());
|
||||||
|
Elements items = Jsoup.parse(html).select(".module-search-item");
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
for (Element item : items) {
|
||||||
|
String vodId = item.select(".video-serial").attr("href");
|
||||||
|
String name = item.select(".video-serial").attr("title");
|
||||||
|
String pic = item.select(".module-item-pic > img").attr("data-src");
|
||||||
|
String remark = item.select(".video-tag-icon").text();
|
||||||
|
list.add(new Vod(vodId, name, pic, remark));
|
||||||
|
}
|
||||||
|
return Result.string(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
f9c6ffc30c6a09b30ee403675a8851af
|
85de1e405045eef7302676d47d77106f
|
||||||
|
|
|
||||||
|
|
@ -67,14 +67,67 @@
|
||||||
"ext": "{\"site\": [\"https://www.wogg.net/\",\"https://wogg.xxooo.cf/\"]}"
|
"ext": "{\"site\": [\"https://www.wogg.net/\",\"https://wogg.xxooo.cf/\"]}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "木偶",
|
"key": "欧歌",
|
||||||
"name": "木偶哥哥",
|
"name": "欧歌|Pan",
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"api": "csp_Mogg",
|
"api": "csp_Mogg",
|
||||||
"searchable": 1,
|
"searchable": 1,
|
||||||
"changeable": 1,
|
"changeable": 1,
|
||||||
"ext": {}
|
"ext": {}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"key": "多多影音",
|
||||||
|
"name": "多多影音|Pan",
|
||||||
|
"type": 3,
|
||||||
|
"api": "csp_DuoDuo",
|
||||||
|
"searchable": 1,
|
||||||
|
"changeable": 1,
|
||||||
|
"ext": "{\"site\": [\"https://tv.yydsys.top/\"]}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "蜡笔盘盘",
|
||||||
|
"name": "蜡笔盘盘|Pan",
|
||||||
|
"type": 3,
|
||||||
|
"api": "csp_NaBi",
|
||||||
|
"searchable": 1,
|
||||||
|
"changeable": 1,
|
||||||
|
"ext": "{\"site\": [\"https://duopan.fun/\"]}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "闪电优汐",
|
||||||
|
"name": "闪电优汐|Pan",
|
||||||
|
"type": 3,
|
||||||
|
"api": "csp_ShanDian",
|
||||||
|
"searchable": 1,
|
||||||
|
"changeable": 1,
|
||||||
|
"ext": "{\"site\": [\"http://1.95.79.193/\"]}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "特下饭",
|
||||||
|
"name": "特下饭|Pan",
|
||||||
|
"type": 3,
|
||||||
|
"api": "csp_TeXiaFan",
|
||||||
|
"searchable": 1,
|
||||||
|
"changeable": 1,
|
||||||
|
"ext": "{\"site\": [\"http://www.xn--ghqy10g1w0a.xyz/\",\"http://www.txfyyda.top/\",]}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "小米",
|
||||||
|
"name": "小米UC|Pan",
|
||||||
|
"type": 3,
|
||||||
|
"api": "csp_XiaoMi",
|
||||||
|
"searchable": 1,
|
||||||
|
"changeable": 1,
|
||||||
|
"ext": "{\"site\": [\"http://mucpan.cc/\",\"http://milvdou.fun/\"]}"
|
||||||
|
},{
|
||||||
|
"key": "至臻视觉",
|
||||||
|
"name": "至臻视觉|Pan",
|
||||||
|
"type": 3,
|
||||||
|
"api": "csp_ZhiZhen",
|
||||||
|
"searchable": 1,
|
||||||
|
"changeable": 1,
|
||||||
|
"ext": "{\"site\": [\"https://mihdr.top/\"]}"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"key": "KuaKeBa",
|
"key": "KuaKeBa",
|
||||||
"name": "夸克吧",
|
"name": "夸克吧",
|
||||||
|
|
|
||||||
|
|
@ -98,14 +98,67 @@
|
||||||
"ext":{"cookie":"_UP_A4A_11_=wb965111521e45ffa80410c24a071a54; _UP_D_=pc; tfstk=fXFith4nnRk114LAjWc1TT-OQUXL5hGjqodxDjnVLDoBBchYujR4Drht3GaYxmqYlcPtWc34mknIMcFTB-Y_tuAv6G6_uIcxggIRw_U15jGV2EjCXmnslyoqlSMN9PGjgMEW0dR85uVOAjYmgwcEoqOqgIrqLyoIlq-ZuC738DgqgCJZgH8EuqxZNmAqqSPQTaC3h7bb2rFnSvW87D8jTW0iX0zasIR2zVDi4Poh2svabvzjnSTXixaaFogzbhS-Cry3xVcc9dlz--roR55Jj2wT8znUrEdYrfV3t-kh71znscDo-vYWpf24fSD_IE_78frQF0MNdMg367HmVvxFbyUnbY20XMOqX84UxYFpvQhbA-rqok-G4A9eUc4wG27YtK9jQ2gnVNJioG_mbu_h-wv5CAuIWgQh-K9jQ2gn2wbHFhMZRVIR.; __pus=c81f57897dafcb65d4ecb501bc299199AARcqF72zsatdbsCbiT3qVqsk36caaycoPQW7hz8rbEf+UY7f5aGgH1e90lsONAUwCAW8y27u5A/KXyYqkHCWgjS; __kp=99fa2760-1669-11ef-90cf-8f7a59c3b86e; __kps=AATSt4xuf6r6bqes3LdJvxvy; __ktd=c2e+aLICIvFoeklXXz36VA==; __uid=AATSt4xuf6r6bqes3LdJvxvy; Video-Auth=smob3MOUslklDq2MutANJYZCVo50sLv0GFelx3+cu1nK2fkdL2kvkdpT5yNOhNz0NLTyi5ThWRL47+ztJA4kXQ==; __puus=72f667c533c9a22496f88d2f1bb7ae71AAQ7mrvFw7s9AUPUXvnuGPkcDU3RRTVPdYaYQfsM9Cje2doYXgRZXbImg02EaUaEG+G9ikpo3xubGGdElArOuYvUtJzIXb6yHDnSZbtEUxkwvjfQRNEnDnVwLQ6LL2ORjRaxa9OUfwk/WppWvy6OcDqQtHYkaqB+Poxn5kFs7ZVdAtX7ZQks1czD+g9gAZjsbeBHxHQ1AP5MGc1s3M4RhwZQ","token":"26fc6787afff43e78b78992e782502f1"}
|
"ext":{"cookie":"_UP_A4A_11_=wb965111521e45ffa80410c24a071a54; _UP_D_=pc; tfstk=fXFith4nnRk114LAjWc1TT-OQUXL5hGjqodxDjnVLDoBBchYujR4Drht3GaYxmqYlcPtWc34mknIMcFTB-Y_tuAv6G6_uIcxggIRw_U15jGV2EjCXmnslyoqlSMN9PGjgMEW0dR85uVOAjYmgwcEoqOqgIrqLyoIlq-ZuC738DgqgCJZgH8EuqxZNmAqqSPQTaC3h7bb2rFnSvW87D8jTW0iX0zasIR2zVDi4Poh2svabvzjnSTXixaaFogzbhS-Cry3xVcc9dlz--roR55Jj2wT8znUrEdYrfV3t-kh71znscDo-vYWpf24fSD_IE_78frQF0MNdMg367HmVvxFbyUnbY20XMOqX84UxYFpvQhbA-rqok-G4A9eUc4wG27YtK9jQ2gnVNJioG_mbu_h-wv5CAuIWgQh-K9jQ2gn2wbHFhMZRVIR.; __pus=c81f57897dafcb65d4ecb501bc299199AARcqF72zsatdbsCbiT3qVqsk36caaycoPQW7hz8rbEf+UY7f5aGgH1e90lsONAUwCAW8y27u5A/KXyYqkHCWgjS; __kp=99fa2760-1669-11ef-90cf-8f7a59c3b86e; __kps=AATSt4xuf6r6bqes3LdJvxvy; __ktd=c2e+aLICIvFoeklXXz36VA==; __uid=AATSt4xuf6r6bqes3LdJvxvy; Video-Auth=smob3MOUslklDq2MutANJYZCVo50sLv0GFelx3+cu1nK2fkdL2kvkdpT5yNOhNz0NLTyi5ThWRL47+ztJA4kXQ==; __puus=72f667c533c9a22496f88d2f1bb7ae71AAQ7mrvFw7s9AUPUXvnuGPkcDU3RRTVPdYaYQfsM9Cje2doYXgRZXbImg02EaUaEG+G9ikpo3xubGGdElArOuYvUtJzIXb6yHDnSZbtEUxkwvjfQRNEnDnVwLQ6LL2ORjRaxa9OUfwk/WppWvy6OcDqQtHYkaqB+Poxn5kFs7ZVdAtX7ZQks1czD+g9gAZjsbeBHxHQ1AP5MGc1s3M4RhwZQ","token":"26fc6787afff43e78b78992e782502f1"}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "木偶",
|
"key": "欧歌",
|
||||||
"name": "木偶哥哥",
|
"name": "欧歌|Pan",
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"api": "csp_Mogg",
|
"api": "csp_Mogg",
|
||||||
"searchable": 1,
|
"searchable": 1,
|
||||||
"changeable": 1,
|
"changeable": 1,
|
||||||
"ext": {}
|
"ext": {}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"key": "多多影音",
|
||||||
|
"name": "多多影音|Pan",
|
||||||
|
"type": 3,
|
||||||
|
"api": "csp_DuoDuo",
|
||||||
|
"searchable": 1,
|
||||||
|
"changeable": 1,
|
||||||
|
"ext": "{\"site\": [\"https://tv.yydsys.top/\"]}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "蜡笔盘盘",
|
||||||
|
"name": "蜡笔盘盘|Pan",
|
||||||
|
"type": 3,
|
||||||
|
"api": "csp_NaBi",
|
||||||
|
"searchable": 1,
|
||||||
|
"changeable": 1,
|
||||||
|
"ext": "{\"site\": [\"https://duopan.fun/\"]}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "闪电优汐",
|
||||||
|
"name": "闪电优汐|Pan",
|
||||||
|
"type": 3,
|
||||||
|
"api": "csp_ShanDian",
|
||||||
|
"searchable": 1,
|
||||||
|
"changeable": 1,
|
||||||
|
"ext": "{\"site\": [\"http://1.95.79.193/\"]}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "特下饭",
|
||||||
|
"name": "特下饭|Pan",
|
||||||
|
"type": 3,
|
||||||
|
"api": "csp_TeXiaFan",
|
||||||
|
"searchable": 1,
|
||||||
|
"changeable": 1,
|
||||||
|
"ext": "{\"site\": [\"http://www.xn--ghqy10g1w0a.xyz/\",\"http://www.txfyyda.top/\",]}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "小米",
|
||||||
|
"name": "小米UC|Pan",
|
||||||
|
"type": 3,
|
||||||
|
"api": "csp_XiaoMi",
|
||||||
|
"searchable": 1,
|
||||||
|
"changeable": 1,
|
||||||
|
"ext": "{\"site\": [\"http://mucpan.cc/\",\"http://milvdou.fun/\"]}"
|
||||||
|
},{
|
||||||
|
"key": "至臻视觉",
|
||||||
|
"name": "至臻视觉|Pan",
|
||||||
|
"type": 3,
|
||||||
|
"api": "csp_ZhiZhen",
|
||||||
|
"searchable": 1,
|
||||||
|
"changeable": 1,
|
||||||
|
"ext": "{\"site\": [\"https://mihdr.top/\"]}"
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"key": "KuaKeBa",
|
"key": "KuaKeBa",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue