This commit is contained in:
jhengazuki 2025-07-02 17:30:13 +08:00
parent a56912b23c
commit a1324dfd13
6 changed files with 480 additions and 103 deletions

View File

@ -6,6 +6,7 @@ import com.github.catvod.bean.Vod;
import com.github.catvod.utils.Util; import com.github.catvod.utils.Util;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -36,9 +37,9 @@ public class Data {
@SerializedName("directors") @SerializedName("directors")
private List<Value> directors; private List<Value> directors;
@SerializedName("source_list_source") @SerializedName("source_list_source")
private List<SourceListSource> source_list_source; private List<SourceListSource> source;
@SerializedName("dataList") @SerializedName("dataList")
private List<DataList> dataList; private List<Data> dataList;
public String getJumpId() { public String getJumpId() {
return TextUtils.isEmpty(jumpId) ? "" : jumpId; return TextUtils.isEmpty(jumpId) ? "" : jumpId;
@ -88,11 +89,11 @@ public class Data {
return directors == null ? "" : getValues(directors, true); return directors == null ? "" : getValues(directors, true);
} }
public List<SourceListSource> getSourcelistsource() { public List<SourceListSource> getSource() {
return source_list_source == null ? Collections.emptyList() : source_list_source; return source == null ? Collections.emptyList() : source;
} }
public List<DataList> getDataList() { public List<Data> getDataList() {
return dataList == null ? Collections.emptyList() : dataList; return dataList == null ? Collections.emptyList() : dataList;
} }
@ -111,6 +112,7 @@ public class Data {
} }
public static class Value { public static class Value {
@SerializedName(value = "title", alternate = "name") @SerializedName(value = "title", alternate = "name")
private String title; private String title;
@ -128,28 +130,30 @@ public class Data {
} }
public static class SourceListSource { public static class SourceListSource {
@SerializedName("name") @SerializedName("name")
private String name; private String name;
@SerializedName("source_list") @SerializedName("source_list")
private List<SourceList> source_list; private List<SourceList> list;
public String getName() { public String getName() {
return TextUtils.isEmpty(name) ? "" : name; return TextUtils.isEmpty(name) ? "" : name;
} }
public List<SourceList> getSourcelist() { public List<SourceList> getList() {
return source_list == null ? Collections.emptyList() : source_list; return list == null ? Collections.emptyList() : list;
} }
} }
public static class SourceList { public static class SourceList {
@SerializedName("source_name") @SerializedName("source_name")
private String source_name; private String name;
@SerializedName("url") @SerializedName("url")
private String url; private String url;
public String getSource_name() { public String getName() {
return TextUtils.isEmpty(source_name) ? "" : source_name; return TextUtils.isEmpty(name) ? "" : name;
} }
public String getUrl() { public String getUrl() {
@ -158,76 +162,18 @@ public class Data {
} }
public String getVodFrom() { public String getVodFrom() {
StringBuilder result = new StringBuilder(); List<String> items = new ArrayList<>();
List<SourceListSource> sources = getSourcelistsource(); for (SourceListSource source : getSource()) items.add(source.getName());
return TextUtils.join("$$$", items);
if (sources != null && !sources.isEmpty()) {
for (int i = 0; i < sources.size(); i++) {
if (i > 0) {
result.append("$$$");
}
result.append(sources.get(i).getName());
}
}
return result.toString();
} }
public String getVodUrl() { public String getVodUrl() {
StringBuilder result = new StringBuilder(); List<String> items = new ArrayList<>();
List<SourceListSource> sources = getSourcelistsource(); for (SourceListSource source : getSource()) {
List<String> urls = new ArrayList<>();
if (sources != null && !sources.isEmpty()) { for (SourceList item : source.getList()) urls.add(item.getName() + "$" + item.getUrl());
for (SourceListSource source : sources) { items.add(TextUtils.join("#", urls));
List<SourceList> sourceLists = source.getSourcelist();
if (sourceLists != null && !sourceLists.isEmpty()) {
for (SourceList item : sourceLists) {
result.append(item.getSource_name())
.append("$")
.append(item.getUrl())
.append("#");
}
if (result.length() > 0) {
result.deleteCharAt(result.length() - 1);
}
result.append("$$$");
}
}
if (result.length() >= 3) {
result.delete(result.length() - 3, result.length());
}
}
return result.toString();
}
public static class DataList {
@SerializedName("id")
private String id;
@SerializedName(value = "thumbnail", alternate = "path")
private String thumbnail;
@SerializedName("title")
private String title;
@SerializedName("mask")
private String mask;
public String getId() {
return TextUtils.isEmpty(id) ? "" : id;
}
public String getThumbnail() {
return TextUtils.isEmpty(thumbnail) ? "" : "http://img1.vbwus.com" + thumbnail;
}
public String getTitle() {
return TextUtils.isEmpty(title) ? "" : title;
}
public String getMask() {
return TextUtils.isEmpty(mask) ? "" : mask;
}
public Vod vod() {
return new Vod(getId(), getTitle(), getThumbnail(), getMask());
} }
return TextUtils.join("$$$", items);
} }
} }

View File

@ -10,9 +10,6 @@ import java.util.Collections;
import java.util.List; import java.util.List;
public class Search { public class Search {
public static Search objectFrom(String str) {
return new Gson().fromJson(str, Search.class);
}
@SerializedName("data") @SerializedName("data")
private List<Search> data; private List<Search> data;
@ -25,6 +22,10 @@ public class Search {
@SerializedName("mask") @SerializedName("mask")
private String mask; private String mask;
public static Search objectFrom(String str) {
return new Gson().fromJson(str, Search.class);
}
public String getId() { public String getId() {
return TextUtils.isEmpty(id) ? "" : id; return TextUtils.isEmpty(id) ? "" : id;
} }

View File

@ -11,11 +11,11 @@ import com.github.catvod.bean.jianpian.Resp;
import com.github.catvod.bean.jianpian.Search; import com.github.catvod.bean.jianpian.Search;
import com.github.catvod.crawler.Spider; import com.github.catvod.crawler.Spider;
import com.github.catvod.net.OkHttp; import com.github.catvod.net.OkHttp;
import com.google.gson.JsonParser;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -24,7 +24,9 @@ import java.util.Map;
* Qile * Qile
*/ */
public class Jianpian extends Spider { public class Jianpian extends Spider {
private static String siteUrl = "http://api.ubj83.com";
private final String siteUrl = "http://api.ubj83.com";
private String extend;
private Map<String, String> getHeader() { private Map<String, String> getHeader() {
Map<String, String> headers = new HashMap<>(); Map<String, String> headers = new HashMap<>();
@ -36,18 +38,16 @@ public class Jianpian extends Spider {
@Override @Override
public void init(Context context, String extend) throws Exception { public void init(Context context, String extend) throws Exception {
if (!extend.isEmpty()) siteUrl = extend; this.extend = extend;
} }
@Override @Override
public String homeContent(boolean filter) throws Exception { public String homeContent(boolean filter) throws Exception {
List<Class> classes = new ArrayList<>(); List<Class> classes = new ArrayList<>();
List<String> typeIds = Arrays.asList("1", "2", "3", "4", "50", "99"); List<String> typeIds = Arrays.asList("1", "2", "3", "4", "50", "99");
List<String> typeNames = Arrays.asList("电影", "电视剧", "动漫", "综艺", "纪录片", "Netflix"); List<String> typeNames = Arrays.asList("電影", "電視劇", "動漫", "綜藝", "紀錄片", "Netflix");
for (int i = 0; i < typeIds.size(); i++) for (int i = 0; i < typeIds.size(); i++) classes.add(new Class(typeIds.get(i), typeNames.get(i)));
classes.add(new Class(typeIds.get(i), typeNames.get(i))); return Result.string(classes, JsonParser.parseString(OkHttp.string(extend)));
return Result.string(classes, Collections.emptyList());
} }
@Override @Override
@ -61,21 +61,25 @@ public class Jianpian extends Spider {
@Override @Override
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception { public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {
List<Vod> list = new ArrayList<>(); if (tid.endsWith("/{pg}")) return searchContent(tid.split("/")[0], pg);
String url; if (tid.equals("50") || tid.equals("99") || tid.equals("111")) {
if (tid.equals("50") || tid.equals("99")) { List<Vod> list = new ArrayList<>();
url = siteUrl + String.format("/api/dyTag/list?category_id=%s", tid); String url = siteUrl + String.format("/api/dyTag/list?category_id=%s&page=%s", tid, pg);
Resp resp = Resp.objectFrom(OkHttp.string(url, getHeader())); Resp resp = Resp.objectFrom(OkHttp.string(url, getHeader()));
for (Data data : resp.getData()) { for (Data data : resp.getData()) for (Data dataList : data.getDataList()) list.add(dataList.vod());
for (Data.DataList dataList : data.getDataList()) list.add(dataList.vod()); return Result.get().page().vod(list).string();
}
return Result.string(list);
} else { } else {
url = siteUrl + String.format("/api/crumb/list?fcate_pid=%s&category_id=&area=&year=&type=&sort=&page=%s", tid, pg); List<Vod> list = new ArrayList<>();
HashMap<String, String> ext = new HashMap<>();
if (extend != null && !extend.isEmpty()) ext.putAll(extend);
String area = ext.get("area") == null ? "0" : ext.get("area");
String year = ext.get("year") == null ? "0" : ext.get("year");
String by = ext.get("by") == null ? "updata" : ext.get("by");
String url = siteUrl + String.format("/api/crumb/list?fcate_pid=%s&area=%s&year=%s&type=0&sort=%s&page=%s&category_id=", tid, area, year, by, pg);
Resp resp = Resp.objectFrom(OkHttp.string(url, getHeader()));
for (Data data : resp.getData()) list.add(data.vod());
return Result.string(list);
} }
Resp resp = Resp.objectFrom(OkHttp.string(url, getHeader()));
for (Data data : resp.getData()) list.add(data.vod());
return Result.string(list);
} }
@Override @Override
@ -89,7 +93,7 @@ public class Jianpian extends Spider {
vod.setTypeName(data.getTypes()); vod.setTypeName(data.getTypes());
vod.setVodActor(data.getActors()); vod.setVodActor(data.getActors());
vod.setVodPlayUrl(data.getVodUrl()); vod.setVodPlayUrl(data.getVodUrl());
vod.setVodDirector("Qile"); vod.setVodDirector(data.getDirectors());
vod.setVodContent(data.getDescription()); vod.setVodContent(data.getDescription());
return Result.string(vod); return Result.string(vod);
} }

Binary file not shown.

View File

@ -1 +1 @@
bcbe9599e27e6b4145eaa583b88b9955 eaaa2de0f1e4946be155e3130ef4fdf3

426
json/jianpian.json Normal file
View File

@ -0,0 +1,426 @@
{
"1": [
{
"key": "area",
"name": "地區",
"init": "1",
"value": [
{
"n": "全部",
"v": "0"
},
{
"n": "国产",
"v": "1"
},
{
"n": "中国香港",
"v": "3"
},
{
"n": "中国台湾",
"v": "6"
},
{
"n": "美国",
"v": "5"
},
{
"n": "韩国",
"v": "18"
},
{
"n": "日本",
"v": "2"
}
]
},
{
"key": "year",
"name": "年份",
"value": [
{
"n": "全部",
"v": "0"
},
{
"n": "2025",
"v": "107"
},
{
"n": "2024",
"v": "119"
},
{
"n": "2023",
"v": "153"
},
{
"n": "2022",
"v": "101"
},
{
"n": "2021",
"v": "118"
},
{
"n": "2020",
"v": "16"
},
{
"n": "2019",
"v": "7"
},
{
"n": "2018",
"v": "2"
},
{
"n": "2017",
"v": "3"
},
{
"n": "2016",
"v": "22"
}
]
},
{
"key": "by",
"name": "排序",
"init": "updata",
"value": [
{
"n": "热门",
"v": "hot"
},
{
"n": "更新",
"v": "updata"
},
{
"n": "评分",
"v": "rating"
}
]
}
],
"2": [
{
"key": "area",
"name": "地區",
"init": "1",
"value": [
{
"n": "全部",
"v": "0"
},
{
"n": "国产",
"v": "1"
},
{
"n": "中国香港",
"v": "3"
},
{
"n": "中国台湾",
"v": "6"
},
{
"n": "美国",
"v": "5"
},
{
"n": "韩国",
"v": "18"
},
{
"n": "日本",
"v": "2"
}
]
},
{
"key": "year",
"name": "年份",
"value": [
{
"n": "全部",
"v": "0"
},
{
"n": "2025",
"v": "107"
},
{
"n": "2024",
"v": "119"
},
{
"n": "2023",
"v": "153"
},
{
"n": "2022",
"v": "101"
},
{
"n": "2021",
"v": "118"
},
{
"n": "2020",
"v": "16"
},
{
"n": "2019",
"v": "7"
},
{
"n": "2018",
"v": "2"
},
{
"n": "2017",
"v": "3"
},
{
"n": "2016",
"v": "22"
}
]
},
{
"key": "by",
"name": "排序",
"init": "updata",
"value": [
{
"n": "热门",
"v": "hot"
},
{
"n": "更新",
"v": "updata"
},
{
"n": "评分",
"v": "rating"
}
]
}
],
"3": [
{
"key": "area",
"name": "地區",
"init": "1",
"value": [
{
"n": "全部",
"v": "0"
},
{
"n": "国产",
"v": "1"
},
{
"n": "中国香港",
"v": "3"
},
{
"n": "中国台湾",
"v": "6"
},
{
"n": "美国",
"v": "5"
},
{
"n": "韩国",
"v": "18"
},
{
"n": "日本",
"v": "2"
}
]
},
{
"key": "year",
"name": "年份",
"value": [
{
"n": "全部",
"v": "0"
},
{
"n": "2025",
"v": "107"
},
{
"n": "2024",
"v": "119"
},
{
"n": "2023",
"v": "153"
},
{
"n": "2022",
"v": "101"
},
{
"n": "2021",
"v": "118"
},
{
"n": "2020",
"v": "16"
},
{
"n": "2019",
"v": "7"
},
{
"n": "2018",
"v": "2"
},
{
"n": "2017",
"v": "3"
},
{
"n": "2016",
"v": "22"
}
]
},
{
"key": "by",
"name": "排序",
"init": "updata",
"value": [
{
"n": "热门",
"v": "hot"
},
{
"n": "更新",
"v": "updata"
},
{
"n": "评分",
"v": "rating"
}
]
}
],
"4": [
{
"key": "area",
"name": "地區",
"init": "1",
"value": [
{
"n": "全部",
"v": "0"
},
{
"n": "国产",
"v": "1"
},
{
"n": "中国香港",
"v": "3"
},
{
"n": "中国台湾",
"v": "6"
},
{
"n": "美国",
"v": "5"
},
{
"n": "韩国",
"v": "18"
},
{
"n": "日本",
"v": "2"
}
]
},
{
"key": "year",
"name": "年份",
"value": [
{
"n": "全部",
"v": "0"
},
{
"n": "2025",
"v": "107"
},
{
"n": "2024",
"v": "119"
},
{
"n": "2023",
"v": "153"
},
{
"n": "2022",
"v": "101"
},
{
"n": "2021",
"v": "118"
},
{
"n": "2020",
"v": "16"
},
{
"n": "2019",
"v": "7"
},
{
"n": "2018",
"v": "2"
},
{
"n": "2017",
"v": "3"
},
{
"n": "2016",
"v": "22"
}
]
},
{
"key": "by",
"name": "排序",
"init": "updata",
"value": [
{
"n": "热门",
"v": "hot"
},
{
"n": "更新",
"v": "updata"
},
{
"n": "评分",
"v": "rating"
}
]
}
]
}