mirror of
https://github.com/bizhangjie/CatVodSpider.git
synced 2026-11-04 18:52:12 +00:00
'更新可用状态'
This commit is contained in:
1 parent
5574fc6486
commit
243773db03
3 files changed
+112
-1
No files matched your search
@@ -52,3 +52,8 @@ https://api.buxiangyao.link/tvbox/tv.txt
|
|||||||
```shell
|
```shell
|
||||||
https://api.buxiangyao.link/jinricp
|
https://api.buxiangyao.link/jinricp
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> 安卓app合集 访问key => buxiangyao
|
||||||
|
```shell
|
||||||
|
https://wwl.lanzoue.com/b04xayf7e
|
||||||
|
```
|
||||||
@@ -12,6 +12,7 @@ import com.github.catvod.crawler.Spider;
|
|||||||
import com.github.catvod.spider.CaoLiu;
|
import com.github.catvod.spider.CaoLiu;
|
||||||
import com.github.catvod.spider.Cg51;
|
import com.github.catvod.spider.Cg51;
|
||||||
import com.github.catvod.spider.Douban;
|
import com.github.catvod.spider.Douban;
|
||||||
|
import com.github.catvod.spider.Fpie2;
|
||||||
import com.github.catvod.spider.IQIYI;
|
import com.github.catvod.spider.IQIYI;
|
||||||
import com.github.catvod.spider.Ikanbot;
|
import com.github.catvod.spider.Ikanbot;
|
||||||
import com.github.catvod.spider.Init;
|
import com.github.catvod.spider.Init;
|
||||||
@@ -65,7 +66,7 @@ public class MainActivity extends Activity {
|
|||||||
private void initSpider() {
|
private void initSpider() {
|
||||||
try {
|
try {
|
||||||
Init.init(getApplicationContext());
|
Init.init(getApplicationContext());
|
||||||
spider = new RouVideo();
|
spider = new Fpie2();
|
||||||
spider.init(this, "");
|
spider.init(this, "");
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -0,0 +1,105 @@
|
|||||||
|
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 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.Locale;
|
||||||
|
|
||||||
|
public class Fpie2 extends Spider {
|
||||||
|
|
||||||
|
private static final String siteUrl = "https://fpie2.com";
|
||||||
|
private static final String cateUrl = siteUrl + "/categories/";
|
||||||
|
private static final String detailUrl = siteUrl + "/play-details/";
|
||||||
|
private static final String searchUrl = siteUrl + "/search/";
|
||||||
|
|
||||||
|
private HashMap<String, String> getHeaders() {
|
||||||
|
HashMap<String, String> headers = new HashMap<>();
|
||||||
|
headers.put("User-Agent", Util.CHROME);
|
||||||
|
return headers;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String homeContent(boolean filter) throws Exception {
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
List<Class> classes = new ArrayList<>();
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(cateUrl, getHeaders()));
|
||||||
|
for (Element element : doc.select("div.img-box")) {
|
||||||
|
String typeId = element.select("a").attr("href").split("/")[4];
|
||||||
|
String typeName = element.select("div.absolute-center > h4").text();
|
||||||
|
classes.add(new Class(typeId, typeName));
|
||||||
|
}
|
||||||
|
doc = Jsoup.parse(OkHttp.string(siteUrl, getHeaders()));
|
||||||
|
for (Element element : doc.select("div.video-img-box")) {
|
||||||
|
String pic = element.select("img").attr("data-src");
|
||||||
|
String url = element.select("a").attr("href");
|
||||||
|
String name = element.select("div.detail > h6").text();
|
||||||
|
if (pic.endsWith(".gif") || name.isEmpty()) continue;
|
||||||
|
String id = url.split("/")[4];
|
||||||
|
list.add(new Vod(id, name, pic));
|
||||||
|
}
|
||||||
|
return Result.string(classes, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
String target = cateUrl + tid + "/?mode=async&function=get_block&block_id=list_videos_common_videos_list&sort_by=post_date&from=" + String.format(Locale.getDefault(), "%02d", Integer.parseInt(pg)) + "&_=" + System.currentTimeMillis();
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(target, getHeaders()));
|
||||||
|
for (Element element : doc.select("div.video-img-box")) {
|
||||||
|
String pic = element.select("img").attr("data-src");
|
||||||
|
String url = element.select("a").attr("href");
|
||||||
|
String name = element.select("div.detail > h6").text();
|
||||||
|
String id = url.split("/")[4];
|
||||||
|
list.add(new Vod(id, name, pic));
|
||||||
|
}
|
||||||
|
Integer total = (Integer.parseInt(pg)+1)*20;
|
||||||
|
return Result.string(Integer.parseInt(pg),Integer.parseInt(pg)+1,20,total,list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String detailContent(List<String> ids) throws Exception {
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(detailUrl.concat(ids.get(0)).concat("/"), getHeaders()));
|
||||||
|
String name = doc.select("meta[property=og:title]").attr("content");
|
||||||
|
String pic = doc.select("meta[property=og:image]").attr("content");
|
||||||
|
String year = doc.select("span.inactive-color").get(0).text();
|
||||||
|
Vod vod = new Vod();
|
||||||
|
vod.setVodId(ids.get(0));
|
||||||
|
vod.setVodPic(pic);
|
||||||
|
vod.setVodYear(year.replace("上市於 ", ""));
|
||||||
|
vod.setVodName(name);
|
||||||
|
vod.setVodPlayFrom("Jable");
|
||||||
|
vod.setVodPlayUrl("播放$" + Util.getVar(doc.html(), "hlsUrl"));
|
||||||
|
return Result.string(vod);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String searchContent(String key, boolean quick) throws Exception {
|
||||||
|
List<Vod> list = new ArrayList<>();
|
||||||
|
Document doc = Jsoup.parse(OkHttp.string(searchUrl.concat(URLEncoder.encode(key)).concat("/"), getHeaders()));
|
||||||
|
for (Element element : doc.select("div.video-img-box")) {
|
||||||
|
String pic = element.select("img").attr("data-src");
|
||||||
|
String url = element.select("a").attr("href");
|
||||||
|
String name = element.select("div.detail > h6").text();
|
||||||
|
String id = url.split("/")[4];
|
||||||
|
list.add(new Vod(id, name, pic));
|
||||||
|
}
|
||||||
|
return Result.string(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
|
||||||
|
return Result.get().url(id).header(getHeaders()).string();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user