Add dolll
This commit is contained in:
parent
ea62b74dec
commit
39df51a8f7
|
|
@ -1,7 +1,21 @@
|
|||
package com.github.catvod.spider;
|
||||
|
||||
import com.github.catvod.crawler.Spider;
|
||||
import android.os.SystemClock;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
|
||||
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.OkHttpUtil;
|
||||
import com.github.catvod.utils.Misc;
|
||||
|
||||
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;
|
||||
|
||||
|
|
@ -11,26 +25,70 @@ public class Doll extends Spider {
|
|||
|
||||
@Override
|
||||
public String homeContent(boolean filter) throws Exception {
|
||||
return super.homeContent(filter);
|
||||
List<Class> classes = new ArrayList<>();
|
||||
List<Vod> list = new ArrayList<>();
|
||||
Document doc = Jsoup.parse(OkHttpUtil.string(url));
|
||||
for (Element a : doc.select("ul#side-menu > li > a")) {
|
||||
String typeName = a.text();
|
||||
String typeId = a.attr("href").replace(url, "");
|
||||
classes.add(new Class(typeId, typeName));
|
||||
}
|
||||
for (Element div : doc.select("div.video-detail")) {
|
||||
String id = div.select("h3.video-title > a").attr("href").replace(url, "");
|
||||
String name = div.select("h3.video-title > a").text();
|
||||
String pic = url + div.select("div.thumb > a > img").attr("data-src");
|
||||
String remark = div.select("div.date").text();
|
||||
list.add(new Vod(id, name, pic, remark));
|
||||
}
|
||||
return Result.string(classes, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {
|
||||
return super.categoryContent(tid, pg, filter, extend);
|
||||
List<Vod> list = new ArrayList<>();
|
||||
String target = pg.equals("1") ? url + tid : url + tid + "/" + pg + ".html";
|
||||
Document doc = Jsoup.parse(OkHttpUtil.string(target));
|
||||
for (Element div : doc.select("div.video-detail")) {
|
||||
String id = div.select("h3.video-title > a").attr("href").replace(url, "");
|
||||
String name = div.select("h3.video-title > a").text();
|
||||
String pic = url + div.select("div.thumb > a > img").attr("data-src");
|
||||
String remark = div.select("div.date").text();
|
||||
list.add(new Vod(id, name, pic, remark));
|
||||
}
|
||||
return Result.string(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String detailContent(List<String> ids) throws Exception {
|
||||
return super.detailContent(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String searchContent(String key, boolean quick) throws Exception {
|
||||
return super.searchContent(key, quick);
|
||||
Document doc = Jsoup.parse(OkHttpUtil.string(url + ids.get(0)));
|
||||
String name = doc.select("meta[property=og:title]").attr("content");
|
||||
String pic = doc.select("meta[property=og:image]").attr("content");
|
||||
Vod vod = new Vod();
|
||||
vod.setVodId(ids.get(0));
|
||||
vod.setVodPic(pic);
|
||||
vod.setVodName(name);
|
||||
vod.setVodPlayFrom("玩偶姐姐");
|
||||
vod.setVodPlayUrl("播放$" + ids.get(0));
|
||||
return Result.string(vod);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
|
||||
return super.playerContent(flag, id, vipFlags);
|
||||
HashMap<String, String> result = new HashMap<>();
|
||||
Misc.loadWebView(url + id, getClient(result));
|
||||
while (result.isEmpty()) SystemClock.sleep(10);
|
||||
return Result.get().url(result.get("url")).string();
|
||||
}
|
||||
|
||||
private WebViewClient getClient(HashMap<String, String> result) {
|
||||
return new WebViewClient() {
|
||||
@Override
|
||||
public void onLoadResource(WebView view, String url) {
|
||||
if (url.endsWith(".m3u8")) {
|
||||
result.put("url", url);
|
||||
view.destroy();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import java.util.List;
|
|||
|
||||
public class Miss extends Spider {
|
||||
|
||||
private final String site = "https://missav.com/";
|
||||
private final String url = "https://missav.com/";
|
||||
|
||||
@Override
|
||||
public String homeContent(boolean filter) throws Exception {
|
||||
|
|
@ -29,16 +29,16 @@ public class Miss extends Spider {
|
|||
List<Class> classes = new ArrayList<>();
|
||||
LinkedHashMap<String, List<Filter>> filters = new LinkedHashMap<>();
|
||||
List<String> typeIds = Arrays.asList("chinese-subtitle", "new", "release", "uncensored-leak", "siro", "luxu", "gana", "maan", "scute", "ara", "uncensored-leak", "fc2", "heyzo", "tokyohot", "1pondo", "caribbeancom", "caribbeancompr", "10musume", "pacopacomama", "gachinco", "xxxav", "marriedslash", "naughty4610", "naughty0930", "madou", "twav");
|
||||
Document doc = Jsoup.parse(OkHttpUtil.string(site));
|
||||
Document doc = Jsoup.parse(OkHttpUtil.string(url));
|
||||
for (Element a : doc.select("nav").select("a")) {
|
||||
String typeName = a.text();
|
||||
String typeId = a.attr("href").replace(site, "");
|
||||
String typeId = a.attr("href").replace(url, "");
|
||||
if (!typeIds.contains(typeId)) continue;
|
||||
classes.add(new Class(typeId, typeName));
|
||||
filters.put(typeId, List.of(new Filter("filters", "過濾", Arrays.asList(new Filter.Value("全部", ""), new Filter.Value("單人作品", "individual"), new Filter.Value("中文字幕", "chinese-subtitle")))));
|
||||
}
|
||||
for (Element div : doc.select("div.thumbnail")) {
|
||||
String id = div.select("a.text-secondary").attr("href").replace(site, "");
|
||||
String id = div.select("a.text-secondary").attr("href").replace(url, "");
|
||||
String name = div.select("a.text-secondary").text();
|
||||
String pic = div.select("img").attr("data-src");
|
||||
if (pic.isEmpty()) pic = div.select("img").attr("src");
|
||||
|
|
@ -51,13 +51,13 @@ public class Miss extends Spider {
|
|||
@Override
|
||||
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {
|
||||
List<Vod> list = new ArrayList<>();
|
||||
String url = site + tid;
|
||||
String target = url + tid;
|
||||
String filters = extend.get("filters");
|
||||
if (TextUtils.isEmpty(filters)) url += "?page=" + pg;
|
||||
else url += "?filters=" + extend.get("filters") + "&page=" + pg;
|
||||
Document doc = Jsoup.parse(OkHttpUtil.string(url));
|
||||
if (TextUtils.isEmpty(filters)) target += "?page=" + pg;
|
||||
else target += "?filters=" + extend.get("filters") + "&page=" + pg;
|
||||
Document doc = Jsoup.parse(OkHttpUtil.string(target));
|
||||
for (Element div : doc.select("div.thumbnail")) {
|
||||
String id = div.select("a.text-secondary").attr("href").replace(site, "");
|
||||
String id = div.select("a.text-secondary").attr("href").replace(url, "");
|
||||
String name = div.select("a.text-secondary").text();
|
||||
String pic = div.select("img").attr("data-src");
|
||||
if (pic.isEmpty()) pic = div.select("img").attr("src");
|
||||
|
|
@ -69,7 +69,7 @@ public class Miss extends Spider {
|
|||
|
||||
@Override
|
||||
public String detailContent(List<String> ids) throws Exception {
|
||||
Document doc = Jsoup.parse(OkHttpUtil.string(site + ids.get(0)));
|
||||
Document doc = Jsoup.parse(OkHttpUtil.string(url + ids.get(0)));
|
||||
String name = doc.select("meta[property=og:title]").attr("content");
|
||||
String pic = doc.select("meta[property=og:image]").attr("content");
|
||||
Vod vod = new Vod();
|
||||
|
|
@ -84,9 +84,9 @@ public class Miss extends Spider {
|
|||
@Override
|
||||
public String searchContent(String key, boolean quick) throws Exception {
|
||||
List<Vod> list = new ArrayList<>();
|
||||
Document doc = Jsoup.parse(OkHttpUtil.string(site + "search/" + key));
|
||||
Document doc = Jsoup.parse(OkHttpUtil.string(url + "search/" + key));
|
||||
for (Element div : doc.select("div.thumbnail")) {
|
||||
String id = div.select("a.text-secondary").attr("href").replace(site, "");
|
||||
String id = div.select("a.text-secondary").attr("href").replace(url, "");
|
||||
String name = div.select("a.text-secondary").text();
|
||||
String pic = div.select("img").attr("data-src");
|
||||
if (pic.isEmpty()) pic = div.select("img").attr("src");
|
||||
|
|
@ -98,6 +98,6 @@ public class Miss extends Spider {
|
|||
|
||||
@Override
|
||||
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
|
||||
return Result.get().parse().url(site + id).string();
|
||||
return Result.get().parse().url(url + id).string();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
0555de475e5d35fba55d58abb5c4568e
|
||||
ba4abbb214c642e38dd0e284fd0e54fe
|
||||
|
|
|
|||
Loading…
Reference in New Issue