Merge branch 'main' of https://github.com/FongMi/CatVodSpider
This commit is contained in:
commit
0ca474ecf8
|
|
@ -43,5 +43,6 @@ dependencies {
|
|||
implementation 'com.google.code.gson:gson:2.8.6'
|
||||
implementation 'cn.wanghaomiao:JsoupXpath:2.5.1'
|
||||
implementation 'com.google.zxing:core:3.3.0'
|
||||
//implementation 'com.orhanobut:logger:2.2.0'
|
||||
implementation 'org.jsoup:jsoup:1.15.3'
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.github.catvod.bean.star;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.github.catvod.bean.Vod;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class Card {
|
||||
|
||||
@SerializedName("name")
|
||||
private String name;
|
||||
@SerializedName("img")
|
||||
private String img;
|
||||
@SerializedName("id")
|
||||
private String id;
|
||||
@SerializedName("countStr")
|
||||
private String countStr;
|
||||
@SerializedName("url")
|
||||
private String url;
|
||||
@SerializedName("cards")
|
||||
private List<Card> cards;
|
||||
|
||||
public static List<Card> arrayFrom(String str) {
|
||||
Type listType = new TypeToken<List<Card>>() {}.getType();
|
||||
return new Gson().fromJson(str, listType);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return TextUtils.isEmpty(name) ? "" : name;
|
||||
}
|
||||
|
||||
public String getImg() {
|
||||
return TextUtils.isEmpty(img) ? "" : img;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return TextUtils.isEmpty(id) ? "" : id;
|
||||
}
|
||||
|
||||
public String getCountStr() {
|
||||
return TextUtils.isEmpty(countStr) ? "" : countStr;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return TextUtils.isEmpty(url) ? "" : url;
|
||||
}
|
||||
|
||||
public List<Card> getCards() {
|
||||
return cards == null ? Collections.emptyList() : cards;
|
||||
}
|
||||
|
||||
public Vod vod() {
|
||||
return new Vod(getId(), getName(), getImg(), getCountStr());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.github.catvod.bean.star;
|
||||
|
||||
import com.github.catvod.bean.Filter;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class Condition {
|
||||
|
||||
@SerializedName("label")
|
||||
private List<List<String>> label;
|
||||
@SerializedName("country")
|
||||
private List<String> country;
|
||||
@SerializedName("time")
|
||||
private List<Integer> time;
|
||||
|
||||
public static Condition objectFrom(String str) {
|
||||
return new Gson().fromJson(str, Condition.class);
|
||||
}
|
||||
|
||||
public List<List<String>> getLabel() {
|
||||
return label == null ? Collections.emptyList() : label;
|
||||
}
|
||||
|
||||
public List<String> getCountry() {
|
||||
return country == null ? Collections.emptyList() : country;
|
||||
}
|
||||
|
||||
public List<Integer> getTime() {
|
||||
return time == null ? Collections.emptyList() : time;
|
||||
}
|
||||
|
||||
public List<Filter> getFilter() {
|
||||
List<Filter> filters = new ArrayList<>();
|
||||
filters.add(new Filter("type", "類型", getTypeValues()));
|
||||
filters.add(new Filter("area", "地區", getAreaValues()));
|
||||
filters.add(new Filter("year", "年份", getYearValues()));
|
||||
return filters;
|
||||
}
|
||||
|
||||
private List<Filter.Value> getTypeValues() {
|
||||
List<Filter.Value> values = new ArrayList<>();
|
||||
values.add(new Filter.Value("全部", ""));
|
||||
for (List<String> list : getLabel()) values.add(new Filter.Value(list.get(0)));
|
||||
return values;
|
||||
}
|
||||
|
||||
private List<Filter.Value> getAreaValues() {
|
||||
List<Filter.Value> values = new ArrayList<>();
|
||||
values.add(new Filter.Value("全部", ""));
|
||||
for (String text : getCountry()) values.add(new Filter.Value(text));
|
||||
return values;
|
||||
}
|
||||
|
||||
private List<Filter.Value> getYearValues() {
|
||||
List<Filter.Value> values = new ArrayList<>();
|
||||
values.add(new Filter.Value("全部", ""));
|
||||
Collections.sort(getTime(), Collections.reverseOrder());
|
||||
for (Integer year : getTime()) if (year >= 2010) values.add(new Filter.Value(String.valueOf(year)));
|
||||
return values;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
package com.github.catvod.bean.star;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Detail {
|
||||
|
||||
@SerializedName("id")
|
||||
private Integer id;
|
||||
@SerializedName("videos")
|
||||
private List<Video> videos;
|
||||
@SerializedName("actor")
|
||||
private String actor;
|
||||
@SerializedName("country")
|
||||
private String country;
|
||||
@SerializedName("desc")
|
||||
private String desc;
|
||||
@SerializedName("label")
|
||||
private String label;
|
||||
@SerializedName("director")
|
||||
private String director;
|
||||
@SerializedName("name")
|
||||
private String name;
|
||||
@SerializedName("picurl")
|
||||
private String picurl;
|
||||
@SerializedName("time")
|
||||
private String time;
|
||||
@SerializedName("countStr")
|
||||
private String countStr;
|
||||
|
||||
public static Detail objectFrom(String str) {
|
||||
return new Gson().fromJson(str, Detail.class);
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public List<Video> getVideos() {
|
||||
return videos;
|
||||
}
|
||||
|
||||
public String getActor() {
|
||||
return actor;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public String getDirector() {
|
||||
return director;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getPicurl() {
|
||||
return picurl;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public String getCountStr() {
|
||||
return countStr;
|
||||
}
|
||||
|
||||
public static class Video {
|
||||
|
||||
@SerializedName("eporder")
|
||||
private Integer eporder;
|
||||
@SerializedName("purl")
|
||||
private String purl;
|
||||
|
||||
public Integer getEporder() {
|
||||
return eporder;
|
||||
}
|
||||
|
||||
public String getPurl() {
|
||||
return purl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.github.catvod.bean.star;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class Query {
|
||||
|
||||
@SerializedName("country")
|
||||
private String country;
|
||||
@SerializedName("label")
|
||||
private String label;
|
||||
@SerializedName("chName")
|
||||
private String chName;
|
||||
@SerializedName("startTime")
|
||||
private Integer startTime;
|
||||
@SerializedName("endTime")
|
||||
private Integer endTime;
|
||||
@SerializedName("pageSize")
|
||||
private Integer pageSize;
|
||||
@SerializedName("page")
|
||||
private Integer page;
|
||||
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public void setChName(String chName) {
|
||||
this.chName = chName;
|
||||
}
|
||||
|
||||
public void setStartTime(Integer startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public void setEndTime(Integer endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public void setPage(Integer page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public void setYear(String year) {
|
||||
setStartTime(Integer.parseInt(year));
|
||||
setEndTime(Integer.parseInt(year));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new Gson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -12,6 +12,7 @@ public class MainActivity extends Activity {
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
//Logger.addLogAdapter(new AndroidLogAdapter());
|
||||
Init.init(getApplicationContext());
|
||||
new Thread(() -> {
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
8ec09a67799714aff2e28dccca59ccfa
|
||||
762da1e25500a10f2bd1c672a145b836
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;8ec09a67799714aff2e28dccca59ccfa",
|
||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;762da1e25500a10f2bd1c672a145b836",
|
||||
"wallpaper": "https://gao.chuqiuyu.tk",
|
||||
"sites": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;8ec09a67799714aff2e28dccca59ccfa",
|
||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;762da1e25500a10f2bd1c672a145b836",
|
||||
"wallpaper": "http://饭太硬.ga/深色壁纸/api.php",
|
||||
"sites": [
|
||||
{
|
||||
|
|
@ -45,6 +45,14 @@
|
|||
"searchable": 1,
|
||||
"changeable": 1
|
||||
},
|
||||
{
|
||||
"key": "星星",
|
||||
"name": "星星",
|
||||
"type": 3,
|
||||
"api": "csp_Star",
|
||||
"searchable": 1,
|
||||
"changeable": 1
|
||||
},
|
||||
{
|
||||
"key": "獨播",
|
||||
"name": "獨播",
|
||||
|
|
|
|||
Loading…
Reference in New Issue