add DyGang,Xl720,Xunlei8

This commit is contained in:
zhixc 2024-12-05 09:32:39 +08:00
parent f4f6c4e8e6
commit 84ac1dfd25
6 changed files with 1311 additions and 0 deletions

View File

@ -0,0 +1,266 @@
package com.github.catvod.spider;
import android.content.Context;
import android.text.TextUtils;
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.Json;
import com.github.catvod.utils.Util;
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.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import okhttp3.MediaType;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
/**
* @author zhixc
* 电影港
* 地址发布https://www.dygang.me/
*/
public class DyGang extends Spider {
private final String siteUrl = "https://www.dygangs.me";
private String extend;
private String nextSearchUrlPrefix;
private String nextSearchUrlSuffix;
private Map<String, String> getHeader() {
Map<String, String> header = new HashMap<>();
header.put("User-Agent", Util.CHROME);
header.put("Referer", siteUrl + "/");
return header;
}
private Map<String, String> getSearchHeader() {
Map<String, String> header = new HashMap<>();
header.put("User-Agent", Util.CHROME);
return header;
}
private String response2string(Response response) throws Exception {
if (!response.isSuccessful() || response.body() == null) return "";
byte[] bytes = response.body().bytes();
response.close();
return new String(bytes, "GBK");
}
private String getStrByRegex(Pattern pattern, String html) {
Matcher matcher = pattern.matcher(html);
return matcher.find() ? matcher.group(1).trim() : "";
}
private List<Vod> parseVodListFromDoc(String html, boolean isHotVod) {
List<Vod> videos = new ArrayList<>();
Document doc = Jsoup.parse(html);
String itemsCssQuery = isHotVod ? "td[width=132]" : "table[width=388]";
Elements items = doc.select(itemsCssQuery);
for (Element it : items) {
String vodId = it.select("a:eq(0)").attr("href");
String name = it.select("a:eq(0) > img:eq(0)").attr("alt");
String pic = it.select("a:eq(0) > img:eq(0)").attr("src");
videos.add(new Vod(vodId, name, pic));
}
return videos;
}
private String getActor(String html) {
String actor = getStrByRegex(Pattern.compile("◎演  员 (.*?)</p", Pattern.DOTALL), html);
if ("".equals(actor)) actor = getStrByRegex(Pattern.compile("◎主  演 (.*?)</p", Pattern.DOTALL), html);
return actor.replaceAll("&middot;", "·").replaceAll("\r\n", "").replaceAll("<br />", "").replaceAll("&nbsp;", "").replaceAll("      ", " / ").replaceAll("      ", " / ").replaceAll("      ", " / ");
}
private String getDirector(String html) {
return getStrByRegex(Pattern.compile("◎导  演 (.*?)<br"), html).replaceAll("&middot;", "·");
}
private String getDescription(String html) {
return getStrByRegex(Pattern.compile("◎简  介(.*?)<hr", Pattern.DOTALL), html).replaceAll("&middot;", "·").replaceAll("\r\n", "").replaceAll("&nbsp;", " ").replaceAll("    ", "");
}
private String removeHtmlTag(String str) {
return str.replaceAll("</?[^>]+>", "");
}
private boolean isMovie(String vodId) {
return !(vodId.startsWith("/dsj") || vodId.startsWith("/dsj1") || vodId.startsWith("/yx") || vodId.startsWith("/dmq"));
}
private Map<String, String> parsePlayMapFromDoc(Document doc) {
Map<String, String> playMap = new LinkedHashMap<>();
List<String> magnetList = new ArrayList<>();
List<String> ed2kList = new ArrayList<>();
Elements aList = doc.select("td[bgcolor=#ffffbb] > a");
for (Element a : aList) {
String episodeUrl = a.attr("href");
String episodeName = a.text();
String episode = episodeName + "$" + episodeUrl;
if (episodeUrl.startsWith("magnet")) magnetList.add(episode);
if (episodeUrl.startsWith("ed2k")) ed2kList.add(episode);
}
if (magnetList.size() > 0) playMap.put("磁力", TextUtils.join("#", magnetList));
if (ed2kList.size() > 0) playMap.put("电驴", TextUtils.join("#", ed2kList));
return playMap;
}
private Map<String, String> parsePlayMapForMovieFromDoc(Document doc) {
Map<String, String> playMap = new LinkedHashMap<>();
Elements aList = doc.select("td[bgcolor=#ffffbb] > a");
for (int i = 0; i < aList.size(); i++) {
Element a = aList.get(i);
String episodeUrl = a.attr("href");
String episodeName = a.text();
if (episodeUrl.startsWith("magnet") || episodeUrl.startsWith("ed2k")) {
if (playMap.containsKey(episodeName)) episodeName += i;
playMap.put(episodeName, episodeUrl);
}
}
return playMap;
}
private int parseLastPageNumber(String html) {
try {
String href = Jsoup.parse(html).select("td[align=middle] > a").last().attr("href");
int num = Integer.parseInt(getStrByRegex(Pattern.compile("index_(.*?)\\.htm"), href));
return num;
} catch (Exception ignored) {
return 1;
}
}
@Override
public void init(Context context, String extend) throws Exception {
super.init(context, extend);
this.extend = extend;
}
@Override
public String homeContent(boolean filter) throws Exception {
List<Class> classes = new ArrayList<>();
List<String> typeIds = Arrays.asList("my_dianying", "my_dianshiju", "dmq", "zy", "jilupian");
List<String> typeNames = Arrays.asList("电影", "电视剧", "动漫", "综艺", "纪录片");
for (int i = 0; i < typeIds.size(); i++) classes.add(new Class(typeIds.get(i), typeNames.get(i)));
return Result.string(classes, Json.parse(OkHttp.string(extend)));
}
@Override
public String homeVideoContent() throws Exception {
String html = response2string(OkHttp.newCall(siteUrl, getHeader()));
List<Vod> videos = parseVodListFromDoc(html, true);
return Result.string(videos);
}
@Override
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {
if ("my_dianying".equals(tid)) tid = extend.get("cateId") == null ? "ys" : extend.get("cateId");
if ("my_dianshiju".equals(tid)) tid = extend.get("cateId") == null ? "dsj" : extend.get("cateId");
String cateUrl = siteUrl + "/" + tid;
if (!"1".equals(pg)) cateUrl += "/index_" + pg + ".htm";
String html = response2string(OkHttp.newCall(cateUrl, getHeader()));
List<Vod> videos = parseVodListFromDoc(html, false);
int lastPageNumber = parseLastPageNumber(html);
int page = Integer.parseInt(pg), count = (lastPageNumber == 1 || lastPageNumber < page) ? page : lastPageNumber, limit = videos.size(), total = Integer.MAX_VALUE;
return Result.get().vod(videos).page(page, count, limit, total).string();
}
@Override
public String detailContent(List<String> ids) throws Exception {
String vodId = ids.get(0);
String link = siteUrl + vodId;
String html = response2string(OkHttp.newCall(link, getHeader()));
String remark = "上映日期:" + removeHtmlTag(getStrByRegex(Pattern.compile("◎上映日期 (.*?)<br"), html));
String actor = getActor(html);
String director = getDirector(html);
String description = removeHtmlTag(getDescription(html)).replaceAll("   ", "").replaceAll("  ", "");
Document doc = Jsoup.parse(html);
Map<String, String> playMap = isMovie(vodId) ? parsePlayMapForMovieFromDoc(doc) : parsePlayMapFromDoc(doc);
String name = doc.select("div[class=title] > a:eq(0)").text();
String pic = doc.select("img[width=120]:eq(0)").attr("src");
String typeName = removeHtmlTag(getStrByRegex(Pattern.compile("◎类  别 (.*?)<br"), html)).replaceAll(" / ", "/");
String year = getStrByRegex(Pattern.compile("◎年  代 (.*?)<br"), html);
String area = removeHtmlTag(getStrByRegex(Pattern.compile("◎产  地 (.*?)<br"), html));
// 由于部分信息过长故进行一些调整将年份地区等信息放到 类别备注里面
typeName += " 地区:" + area;
area = "";
typeName += " 年份:" + year;
remark += " 年份:" + year;
year = "";
Vod vod = new Vod();
vod.setVodId(ids.get(0));
vod.setVodName(name);
vod.setVodPic(pic);
vod.setTypeName(typeName);
vod.setVodYear(year);
vod.setVodArea(area);
vod.setVodRemarks(remark);
vod.setVodActor(actor);
vod.setVodDirector(director);
vod.setVodContent(description);
vod.setVodPlayFrom(TextUtils.join("$$$", playMap.keySet()));
vod.setVodPlayUrl(TextUtils.join("$$$", playMap.values()));
return Result.string(vod);
}
@Override
public String searchContent(String key, boolean quick) throws Exception {
return searchContent(key, quick, "1");
}
@Override
public String searchContent(String key, boolean quick, String pg) throws Exception {
String searchUrl = siteUrl + "/e/search/index.php";
String html = "";
if ("1".equals(pg)) {
String requestBody = "tempid=1&tbname=article&keyboard=" + URLEncoder.encode(key, "GBK") + "&show=title%2Csmalltext&Submit=%CB%D1%CB%F7";
RequestBody formBody = RequestBody.create(MediaType.parse("application/x-www-form-urlencoded"), requestBody);
Request request = new Request.Builder()
.url(searchUrl)
.post(formBody)
.header("Accept", Util.ACCEPT)
.header("Accept-Language", "zh-CN,zh;q=0.9")
.header("Cache-Control", "max-age=0")
.header("Connection", "keep-alive")
.header("Content-Type", "application/x-www-form-urlencoded")
.header("Origin", siteUrl)
.header("Referer", siteUrl + "/")
.header("User-Agent", Util.CHROME)
.build();
Response response = OkHttp.newCall(request);
if (!response.isSuccessful()) return "";
String[] split = String.valueOf(response.request().url()).split("\\?searchid=");
nextSearchUrlPrefix = split[0] + "index.php?page=";
nextSearchUrlSuffix = "&searchid=" + split[1];
html = response2string(response);
} else {
int page = Integer.parseInt(pg) - 1;
searchUrl = nextSearchUrlPrefix + page + nextSearchUrlSuffix;
html = response2string(OkHttp.newCall(searchUrl, getSearchHeader()));
}
List<Vod> videos = parseVodListFromDoc(html, false);
return Result.string(videos);
}
@Override
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
return Result.get().url(id).string();
}
}

View File

@ -21,6 +21,8 @@ public class Proxy extends Spider {
return WebDAV.vod(params);
case "local":
return Local.proxy(params);
case "xunlei8":
return Xunlei8.loadPic(params);
default:
return null;
}

View File

@ -0,0 +1,213 @@
package com.github.catvod.spider;
import android.text.TextUtils;
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 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.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author zhixc
* 迅雷电影天堂
*/
public class Xl720 extends Spider {
private final String siteUrl = "https://www.xl720.com";
private final Pattern NAME_PATTERN = Pattern.compile("《(.*?)》");
private Map<String, String> getHeader() {
Map<String, String> header = new HashMap<>();
header.put("User-Agent", Util.CHROME);
return header;
}
private Map<String, String> getHeader(String referer) {
Map<String, String> header = new HashMap<>();
header.put("User-Agent", Util.CHROME);
header.put("Referer", referer);
return header;
}
private String getStrByRegex(Pattern pattern, String html) {
Matcher matcher = pattern.matcher(html);
return matcher.find() ? matcher.group(1).trim() : "";
}
private int parseLastPageNumber(String html) {
try {
Element last = Jsoup.parse(html).select(".wp-pagenavi > a.last").last();
int lastPageNum = Integer.parseInt(last.attr("href").split("/page/")[1]);
return lastPageNum;
} catch (Exception ignored) {
return 1;
}
}
private List<Vod> parseVodListFromDoc(String html) {
List<Vod> videos = new ArrayList<>();
Elements items = Jsoup.parse(html).select("[class=post-grid clearfix] > [class=post clearfix]");
for (Element item : items) {
String vodId = item.select(".entry-title > a").attr("href");
String name = getName(item);
String pic = item.select("img").attr("src");
String remark = getRemark(item);
videos.add(new Vod(vodId, name, pic, remark));
}
return videos;
}
private String getName(Element item) {
String title = item.select(".entry-title > a").attr("title");
String s = getStrByRegex(NAME_PATTERN, title);
return "".equals(s) ? title : s;
}
private String getRemark(Element item) {
try {
String remark = item.select(".entry-title > a").attr("title").split("")[1];
return remark;
} catch (Exception e) {
return "";
}
}
private String getActor(String html) {
String actor = getStrByRegex(Pattern.compile("演  员 (.*?)<p>"), html);
if ("".equals(actor)) actor = getStrByRegex(Pattern.compile("主  演 (.*?)\n<p>"), html);
return removeHtmlTag(actor);
}
private String removeHtmlTag(String str) {
return str.replaceAll("</?[^>]+>", "");
}
@Override
public String homeContent(boolean filter) throws Exception {
String html = OkHttp.string(siteUrl, getHeader());
Document doc = Jsoup.parse(html);
Elements aList = doc.select(".sf-menu > li > a");
List<Class> classes = new ArrayList<>();
for (int i = 1; i < aList.size(); i++) {
Element a = aList.get(i);
String typeId = a.attr("href").split("/category/")[1];
String typeName = a.text();
classes.add(new Class(typeId, typeName));
}
Elements elements = doc.select("[class=slider clearfix] > ul > li");
List<Vod> videos = new ArrayList<>();
for (Element element : elements) {
Element a = element.selectFirst("a");
String vodId = a.attr("href");
String name = a.select(".cap").text();
String pic = a.select("img").attr("src");
String remark = element.select(".entry-rating").text();
videos.add(new Vod(vodId, name, pic, remark));
}
return Result.string(classes, videos);
}
@Override
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {
String cateUrl = siteUrl + "/category/" + tid;
if (!pg.equals("1")) cateUrl += "/page/" + pg;
String html = OkHttp.string(cateUrl, getHeader(siteUrl + "/"));
List<Vod> videos = parseVodListFromDoc(html);
int page = Integer.parseInt(pg), count = parseLastPageNumber(html), limit = videos.size(), total = Integer.MAX_VALUE;
return Result.get().vod(videos).page(page, count, limit, total).string();
}
@Override
public String detailContent(List<String> ids) throws Exception {
String detailUrl = ids.get(0);
String html = OkHttp.string(detailUrl, getHeader());
Document doc = Jsoup.parse(html);
Map<String, String> playMap = new LinkedHashMap<>();
List<String> vodItems = new ArrayList<>();
for (Element a : doc.select("#play_list > a")) {
String episodeUrl = a.attr("href").split("path=")[1].replaceAll("ftp", "tvbox-xg:ftp");
String episodeTitle = a.text();
vodItems.add(episodeTitle + "$" + episodeUrl);
}
if (vodItems.size() > 0) playMap.put("荐片", TextUtils.join("#", vodItems));
vodItems = new ArrayList<>();
for (Element a : doc.select("#zdownload > .download-link > a")) {
String episodeUrl = a.attr("href");
String episodeTitle = a.text().replaceAll(".torrent", "");
vodItems.add(episodeTitle + "$" + episodeUrl);
}
if (vodItems.size() > 0) playMap.put("磁力", TextUtils.join("#", vodItems));
String partHTML = doc.select("#info").html();
String name = getStrByRegex(Pattern.compile("片  名 (.*?)<br"), partHTML);
String pic = doc.select("#mainpic > img").attr("src");
String typeName = getStrByRegex(Pattern.compile("类  别 (.*?)<br"), partHTML);
String year = removeHtmlTag(getStrByRegex(Pattern.compile("年  代 (.*?)<br"), partHTML));
String area = removeHtmlTag(getStrByRegex(Pattern.compile("产  地 (.*?)<br"), partHTML));
String remark = "上映日期:" + getStrByRegex(Pattern.compile("上映日期 (.*?)<br"), partHTML);
String actor = getActor(partHTML);
String director = removeHtmlTag(getStrByRegex(Pattern.compile("导  演 (.*?)\n<br"), partHTML));
String description = doc.select("#link-report").text().replaceAll("  ", "");
// 由于部分信息过长故进行一些调整将年份地区等信息放到 类别备注里面
typeName += " 地区:" + area;
area = "";
typeName += " 年份:" + year;
remark += " 年份:" + year;
year = "";
Vod vod = new Vod();
vod.setVodId(ids.get(0));
vod.setVodName(name);
vod.setVodPic(pic);
vod.setTypeName(typeName);
vod.setVodYear(year);
vod.setVodArea(area);
vod.setVodRemarks(remark);
vod.setVodActor(actor);
vod.setVodDirector(director);
vod.setVodContent(description);
vod.setVodPlayFrom(TextUtils.join("$$$", playMap.keySet()));
vod.setVodPlayUrl(TextUtils.join("$$$", playMap.values()));
return Result.string(vod);
}
@Override
public String searchContent(String key, boolean quick) throws Exception {
return searchContent(key, quick, "1");
}
@Override
public String searchContent(String key, boolean quick, String pg) throws Exception {
String searchUrl = siteUrl + "/?s=" + URLEncoder.encode(key);
String html = "";
if ("1".equals(pg)) {
html = OkHttp.string(searchUrl, getHeader(siteUrl + "/"));
} else {
searchUrl = siteUrl + "/page/2?s=" + URLEncoder.encode(key);
html = OkHttp.string(searchUrl, getHeader(siteUrl + "/"));
}
List<Vod> videos = parseVodListFromDoc(html);
return Result.string(videos);
}
@Override
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
return Result.get().url(id).string();
}
}

View File

@ -0,0 +1,226 @@
package com.github.catvod.spider;
import android.content.Context;
import android.text.TextUtils;
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.crawler.SpiderDebug;
import com.github.catvod.net.OkHttp;
import com.github.catvod.utils.Json;
import com.github.catvod.utils.Util;
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.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import okhttp3.Headers;
import okhttp3.Response;
/**
* @author zhixc
* 迅雷吧
*/
public class Xunlei8 extends Spider {
private final String siteUrl = "https://xunlei8.top";
private String extend;
private static HashMap<String, String> xunlei8PicHeader = null;
private Map<String, String> getHeader() {
Map<String, String> header = new HashMap<>();
header.put("User-Agent", Util.CHROME);
header.put("Referer", siteUrl + "/");
return header;
}
private List<Vod> parseVodListFromDoc(String html) {
List<Vod> videos = new ArrayList<>();
Document doc = Jsoup.parse(html);
Elements items = doc.select(".b876dd567bb .b33c0");
for (Element it : items) {
String vodId = it.select("a:eq(0)").attr("href");
String name = it.select("a:eq(0)").attr("title");
String pic = fixCover(it.select("a:eq(0) img:eq(0)").attr("src"));
videos.add(new Vod(vodId, name, pic));
}
return videos;
}
private String fixCover(String cover) {
try {
return "proxy://do=xunlei8&pic=" + Base64.encodeToString(cover.getBytes("UTF-8"), Base64.DEFAULT | Base64.URL_SAFE | Base64.NO_WRAP);
} catch (Exception ignored) {
return cover;
}
}
public static Object[] loadPic(Map<String, String> params) {
String pic = params.get("pic");
try {
pic = new String(Base64.decode(pic, Base64.DEFAULT | Base64.URL_SAFE | Base64.NO_WRAP), "UTF-8");
if (xunlei8PicHeader == null) {
xunlei8PicHeader = new HashMap<>();
xunlei8PicHeader.put("User-Agent", Util.CHROME);
xunlei8PicHeader.put("referer", "https://xunlei8.top/");
}
Response response = OkHttp.newCall(pic, xunlei8PicHeader);
if (response.code() == 200) {
Headers headers = response.headers();
String type = headers.get("Content-Type");
if (type == null) {
type = "application/octet-stream";
}
Object[] result = new Object[3];
result[0] = 200;
result[1] = type;
result[2] = response.body().byteStream();
return result;
}
} catch (Throwable throwable) {
SpiderDebug.log(throwable);
}
return null;
}
private String fixVodInfo(Element e) {
StringBuilder sb = new StringBuilder();
for (Element a : e.select("a")) sb.append(a.text()).append("/");
return sb.toString();
}
@Override
public void init(Context context, String extend) throws Exception {
super.init(context, extend);
this.extend = extend;
}
@Override
public String homeContent(boolean filter) throws Exception {
List<Class> classes = new ArrayList<>();
List<String> typeIds = Arrays.asList("list", "tv");
List<String> typeNames = Arrays.asList("电影", "电视剧");
for (int i = 0; i < typeIds.size(); i++) classes.add(new Class(typeIds.get(i), typeNames.get(i)));
return Result.string(classes, Json.parse(OkHttp.string(extend)));
}
@Override
public String homeVideoContent() throws Exception {
String html = OkHttp.string(siteUrl, getHeader());
List<Vod> videos = parseVodListFromDoc(html);
return Result.string(videos);
}
@Override
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {
String cateId = extend.get("cateId") == null ? "0" : extend.get("cateId");
String year = extend.get("year") == null ? "0" : extend.get("year");
String area = extend.get("area") == null ? "0" : extend.get("area");
String sort = extend.get("sort") == null ? "date" : extend.get("sort");
String cateUrl = siteUrl + "/" + tid + "-" + cateId + "-" + year + "-" + area + "-" + sort + "-" + pg + "-30.html";
String html = OkHttp.string(cateUrl, getHeader());
List<Vod> videos = parseVodListFromDoc(html);
int page = Integer.parseInt(pg), count = Integer.MAX_VALUE, limit = videos.size(), total = Integer.MAX_VALUE;
return Result.get().vod(videos).page(page, count, limit, total).string();
}
@Override
public String detailContent(List<String> ids) throws Exception {
String link = siteUrl + ids.get(0);
String html = OkHttp.string(link, getHeader());
Document doc = Jsoup.parse(html);
String name = doc.select("h1").text();
String pic = fixCover(doc.select(".bd800a7092 > img").attr("src"));
String typeName = "";
String year = "";
String area = "";
String remark = "";
String actor = "";
String director = "";
String description = doc.select(".b1f40f7888").text();
for (Element e : doc.select(".be998a > p")) {
String text = e.text();
if (text.startsWith("类型")) typeName = fixVodInfo(e);
if (text.startsWith("上映")) year = text.replace("上映:", "");
if (text.startsWith("地区")) area = text.replace("地区:", "");
if (text.startsWith("片长")) remark = text;
if (text.startsWith("主演")) actor = fixVodInfo(e);
if (text.startsWith("导演")) director = fixVodInfo(e);
}
typeName += " 地区:" + area;
area = "";
typeName += " 年份:" + year;
remark += " 年份:" + year;
year = "";
List<String> magnetList = new ArrayList<>();
List<String> ed2kList = new ArrayList<>();
List<String> vodItems = new ArrayList<>();
Elements aList = doc.select("a.copylink");
for (int i = 0; i < aList.size(); i++) {
Element a = aList.get(i);
String episodeUrl = a.attr("alt");
String episodeName = (i + 1) + "";
String episode = episodeName + "$" + episodeUrl;
if (episodeUrl.startsWith("magnet")) magnetList.add(episode);
if (episodeUrl.startsWith("ed2k")) ed2kList.add(episode);
if (episodeUrl.startsWith("thunder://")) vodItems.add(episode);
}
Map<String, String> playMap = new LinkedHashMap<>();
if (magnetList.size() > 0) playMap.put("磁力", TextUtils.join("#", magnetList));
if (ed2kList.size() > 0) playMap.put("电驴", TextUtils.join("#", ed2kList));
if (vodItems.size() > 0) playMap.put("边下边播", TextUtils.join("#", vodItems));
Vod vod = new Vod();
vod.setVodId(ids.get(0));
vod.setVodName(name);
vod.setVodPic(pic);
vod.setTypeName(typeName);
vod.setVodYear(year);
vod.setVodArea(area);
vod.setVodRemarks(remark);
vod.setVodActor(actor);
vod.setVodDirector(director);
vod.setVodContent(description);
vod.setVodPlayFrom(TextUtils.join("$$$", playMap.keySet()));
vod.setVodPlayUrl(TextUtils.join("$$$", playMap.values()));
return Result.string(vod);
}
@Override
public String searchContent(String key, boolean quick) throws Exception {
return searchContent(key, quick, "1");
}
@Override
public String searchContent(String key, boolean quick, String pg) throws Exception {
if (!"1".equals(pg)) return "";
String searchUrl = siteUrl + "/s/" + URLEncoder.encode(key) + ".html";
String html = OkHttp.string(searchUrl, getHeader());
List<Vod> videos = new ArrayList<>();
Document doc = Jsoup.parse(html);
for (Element it : doc.select(".b007")) {
String vodId = it.select("a:eq(0)").attr("href");
String name = it.select("h2 > a:eq(0)").text();
String pic = fixCover(it.select("a:eq(0) > img").attr("src"));
videos.add(new Vod(vodId, name, pic));
}
return Result.string(videos);
}
@Override
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
return Result.get().url(id).string();
}
}

46
json/DyGang.json Normal file
View File

@ -0,0 +1,46 @@
{
"my_dianying": [
{
"name": "类型",
"key": "cateId",
"value": [
{
"n": "最新电影(默认)",
"v": "ys"
},
{
"n": "经典高清",
"v": "bd"
},
{
"n": "国配电影",
"v": "gy"
},
{
"n": "经典港片",
"v": "gp"
}
]
}
],
"my_dianshiju": [
{
"name": "类型",
"key": "cateId",
"value": [
{
"n": "国剧(默认)",
"v": "dsj"
},
{
"n": "日韩剧",
"v": "dsj1"
},
{
"n": "美剧",
"v": "yx"
}
]
}
]
}

558
json/xunlei8.json Normal file
View File

@ -0,0 +1,558 @@
{
"list": [
{
"name": "类型",
"key": "cateId",
"value": [
{
"n": "全部",
"v": "0"
},
{
"n": "科幻",
"v": "科幻"
},
{
"n": "悬疑",
"v": "悬疑"
},
{
"n": "情色",
"v": "情色"
},
{
"n": "恐怖",
"v": "恐怖"
},
{
"n": "奇幻",
"v": "奇幻"
},
{
"n": "喜剧",
"v": "喜剧"
},
{
"n": "战争",
"v": "战争"
},
{
"n": "动作",
"v": "动作"
},
{
"n": "动画",
"v": "动画"
},
{
"n": "冒险",
"v": "冒险"
},
{
"n": "爱情",
"v": "爱情"
},
{
"n": "武侠",
"v": "武侠"
},
{
"n": "犯罪",
"v": "犯罪"
},
{
"n": "惊悚",
"v": "惊悚"
},
{
"n": "剧情",
"v": "剧情"
},
{
"n": "纪录片",
"v": "纪录片"
},
{
"n": "运动",
"v": "运动"
},
{
"n": "历史",
"v": "历史"
},
{
"n": "西部",
"v": "西部"
},
{
"n": "家庭",
"v": "家庭"
},
{
"n": "音乐",
"v": "音乐"
},
{
"n": "同性",
"v": "同性"
}
]
},
{
"name": "年份",
"key": "year",
"value": [
{
"n": "全部",
"v": "0"
},
{
"n": "2024",
"v": "2024"
},
{
"n": "2023",
"v": "2023"
},
{
"n": "2022",
"v": "2022"
},
{
"n": "2021",
"v": "2021"
},
{
"n": "2020",
"v": "2020"
},
{
"n": "2019",
"v": "2019"
},
{
"n": "2018",
"v": "2018"
},
{
"n": "2017",
"v": "2017"
},
{
"n": "2016",
"v": "2016"
},
{
"n": "2015",
"v": "2015"
},
{
"n": "2014",
"v": "2014"
},
{
"n": "2013",
"v": "2013"
},
{
"n": "2012",
"v": "2012"
},
{
"n": "2011",
"v": "2011"
},
{
"n": "2010",
"v": "2010"
},
{
"n": "2009",
"v": "2009"
},
{
"n": "2008",
"v": "2008"
},
{
"n": "更早",
"v": "更早"
}
]
},
{
"name": "地区",
"key": "area",
"value": [
{
"n": "全部",
"v": "0"
},
{
"n": "美国",
"v": "美国"
},
{
"n": "中国大陆",
"v": "中国大陆"
},
{
"n": "韩国",
"v": "韩国"
},
{
"n": "日本",
"v": "日本"
},
{
"n": "英国",
"v": "英国"
},
{
"n": "印度",
"v": "印度"
},
{
"n": "法国",
"v": "法国"
},
{
"n": "俄罗斯",
"v": "俄罗斯"
},
{
"n": "加拿大",
"v": "加拿大"
},
{
"n": "德国",
"v": "德国"
},
{
"n": "泰国",
"v": "泰国"
},
{
"n": "西班牙",
"v": "西班牙"
},
{
"n": "澳大利亚",
"v": "澳大利亚"
},
{
"n": "意大利",
"v": "意大利"
},
{
"n": "比利时",
"v": "比利时"
},
{
"n": "中国台湾",
"v": "中国台湾"
},
{
"n": "中国香港",
"v": "中国香港"
}
]
},
{
"name": "排序",
"key": "sort",
"value": [
{
"n": "最近更新(默认)",
"v": "date"
},
{
"n": "精彩热播",
"v": "hot"
},
{
"n": "高分好评",
"v": "rating"
}
]
}
],
"tv": [
{
"name": "类型",
"key": "cateId",
"value": [
{
"n": "全部",
"v": "0"
},
{
"n": "科幻",
"v": "科幻"
},
{
"n": "悬疑",
"v": "悬疑"
},
{
"n": "情色",
"v": "情色"
},
{
"n": "恐怖",
"v": "恐怖"
},
{
"n": "奇幻",
"v": "奇幻"
},
{
"n": "喜剧",
"v": "喜剧"
},
{
"n": "战争",
"v": "战争"
},
{
"n": "动作",
"v": "动作"
},
{
"n": "动画",
"v": "动画"
},
{
"n": "冒险",
"v": "冒险"
},
{
"n": "爱情",
"v": "爱情"
},
{
"n": "武侠",
"v": "武侠"
},
{
"n": "犯罪",
"v": "犯罪"
},
{
"n": "惊悚",
"v": "惊悚"
},
{
"n": "剧情",
"v": "剧情"
},
{
"n": "纪录片",
"v": "纪录片"
},
{
"n": "运动",
"v": "运动"
},
{
"n": "历史",
"v": "历史"
},
{
"n": "西部",
"v": "西部"
},
{
"n": "家庭",
"v": "家庭"
},
{
"n": "音乐",
"v": "音乐"
},
{
"n": "同性",
"v": "同性"
}
]
},
{
"name": "年份",
"key": "year",
"value": [
{
"n": "全部",
"v": "0"
},
{
"n": "2024",
"v": "2024"
},
{
"n": "2023",
"v": "2023"
},
{
"n": "2022",
"v": "2022"
},
{
"n": "2021",
"v": "2021"
},
{
"n": "2020",
"v": "2020"
},
{
"n": "2019",
"v": "2019"
},
{
"n": "2018",
"v": "2018"
},
{
"n": "2017",
"v": "2017"
},
{
"n": "2016",
"v": "2016"
},
{
"n": "2015",
"v": "2015"
},
{
"n": "2014",
"v": "2014"
},
{
"n": "2013",
"v": "2013"
},
{
"n": "2012",
"v": "2012"
},
{
"n": "2011",
"v": "2011"
},
{
"n": "2010",
"v": "2010"
},
{
"n": "2009",
"v": "2009"
},
{
"n": "2008",
"v": "2008"
},
{
"n": "更早",
"v": "更早"
}
]
},
{
"name": "地区",
"key": "area",
"value": [
{
"n": "全部",
"v": "0"
},
{
"n": "美国",
"v": "美国"
},
{
"n": "中国大陆",
"v": "中国大陆"
},
{
"n": "韩国",
"v": "韩国"
},
{
"n": "日本",
"v": "日本"
},
{
"n": "英国",
"v": "英国"
},
{
"n": "印度",
"v": "印度"
},
{
"n": "法国",
"v": "法国"
},
{
"n": "俄罗斯",
"v": "俄罗斯"
},
{
"n": "加拿大",
"v": "加拿大"
},
{
"n": "德国",
"v": "德国"
},
{
"n": "泰国",
"v": "泰国"
},
{
"n": "西班牙",
"v": "西班牙"
},
{
"n": "澳大利亚",
"v": "澳大利亚"
},
{
"n": "意大利",
"v": "意大利"
},
{
"n": "比利时",
"v": "比利时"
},
{
"n": "中国台湾",
"v": "中国台湾"
},
{
"n": "中国香港",
"v": "中国香港"
}
]
},
{
"name": "排序",
"key": "sort",
"value": [
{
"n": "最近更新(默认)",
"v": "date"
},
{
"n": "精彩热播",
"v": "hot"
},
{
"n": "高分好评",
"v": "rating"
}
]
}
]
}