This commit is contained in:
GH Action - Upstream Sync 2023-10-16 12:32:33 +00:00
commit 9f251b3210
16 changed files with 803 additions and 73 deletions

View File

@ -24,7 +24,7 @@ import com.github.catvod.bean.ali.Drive;
import com.github.catvod.bean.ali.Item;
import com.github.catvod.bean.ali.OAuth;
import com.github.catvod.bean.ali.Preview;
import com.github.catvod.bean.ali.Res;
import com.github.catvod.bean.ali.Resp;
import com.github.catvod.bean.ali.Share;
import com.github.catvod.bean.ali.User;
import com.github.catvod.crawler.SpiderDebug;
@ -401,8 +401,8 @@ public class AliYun {
SpiderDebug.log("Copy..." + fileId);
String json = "{\"requests\":[{\"body\":{\"file_id\":\"%s\",\"share_id\":\"%s\",\"auto_rename\":true,\"to_parent_file_id\":\"root\",\"to_drive_id\":\"%s\"},\"headers\":{\"Content-Type\":\"application/json\"},\"id\":\"0\",\"method\":\"POST\",\"url\":\"/file/copy\"}],\"resource\":\"file\"}";
json = String.format(json, fileId, shareId, drive.getDriveId());
Res res = Res.objectFrom(auth("adrive/v2/batch", json, true));
return res.getResponse().getBody().getFileId();
Resp resp = Resp.objectFrom(auth("adrive/v2/batch", json, true));
return resp.getResponse().getBody().getFileId();
}
private void deleteAll() {
@ -417,8 +417,8 @@ public class AliYun {
SpiderDebug.log("Delete..." + fileId);
String json = "{\"requests\":[{\"body\":{\"drive_id\":\"%s\",\"file_id\":\"%s\"},\"headers\":{\"Content-Type\":\"application/json\"},\"id\":\"%s\",\"method\":\"POST\",\"url\":\"/file/delete\"}],\"resource\":\"file\"}";
json = String.format(json, drive.getDriveId(), fileId, fileId);
Res res = Res.objectFrom(auth("adrive/v2/batch", json, true));
return res.getResponse().getStatus() == 404;
Resp resp = Resp.objectFrom(auth("adrive/v2/batch", json, true));
return resp.getResponse().getStatus() == 404;
}
public Object[] proxySub(Map<String, String> params) throws Exception {

View File

@ -65,6 +65,10 @@ public class Result {
return Result.get().classes(classes).filters(filters).string();
}
public static String string(List<Class> classes, JsonElement filters) {
return Result.get().classes(classes).filters(filters).string();
}
public static String string(List<Class> classes, JSONObject filters) {
return Result.get().classes(classes).filters(filters).string();
}
@ -207,6 +211,6 @@ public class Result {
@Override
public String toString() {
return new Gson().toJson(this);
return new Gson().newBuilder().disableHtmlEscaping().create().toJson(this);
}
}

View File

@ -8,10 +8,10 @@ import com.google.gson.annotations.SerializedName;
import java.util.Collections;
import java.util.List;
public class Res {
public class Resp {
@SerializedName("responses")
private List<Res> responses;
private List<Resp> responses;
@SerializedName("body")
private Body body;
@SerializedName("id")
@ -19,16 +19,16 @@ public class Res {
@SerializedName("status")
private int status;
public static Res objectFrom(String str) {
return new Gson().fromJson(str, Res.class);
public static Resp objectFrom(String str) {
return new Gson().fromJson(str, Resp.class);
}
public List<Res> getResponses() {
public List<Resp> getResponses() {
return responses == null ? Collections.emptyList() : responses;
}
public Res getResponse() {
return getResponses().isEmpty() ? new Res() : getResponses().get(0);
public Resp getResponse() {
return getResponses().isEmpty() ? new Resp() : getResponses().get(0);
}
public Body getBody() {

View File

@ -0,0 +1,130 @@
package com.github.catvod.bean.jianpian;
import android.text.TextUtils;
import com.github.catvod.bean.Vod;
import com.github.catvod.utils.Utils;
import com.google.gson.annotations.SerializedName;
import java.util.Collections;
import java.util.List;
public class Data {
@SerializedName(value = "jump_id", alternate = "id")
private String jumpId;
@SerializedName(value = "thumbnail", alternate = "path")
private String thumbnail;
@SerializedName("title")
private String title;
@SerializedName("mask")
private String mask;
@SerializedName("description")
private String description;
@SerializedName("playlist")
private Value playlist;
@SerializedName("year")
private Value year;
@SerializedName("area")
private Value area;
@SerializedName("types")
private List<Value> types;
@SerializedName("actors")
private List<Value> actors;
@SerializedName("directors")
private List<Value> directors;
@SerializedName("btbo_downlist")
private List<BtboDown> btboDownlist;
public String getJumpId() {
return TextUtils.isEmpty(jumpId) ? "" : jumpId;
}
public String getThumbnail() {
return TextUtils.isEmpty(thumbnail) ? "" : thumbnail + "@Referer=www.jianpianapp.com@User-Agent=jianpian-version362";
}
public String getTitle() {
return TextUtils.isEmpty(title) ? "" : title;
}
public String getMask() {
return TextUtils.isEmpty(mask) ? getPlaylist() : mask;
}
public String getDescription() {
return TextUtils.isEmpty(description) ? "" : description.replace(" ", "");
}
public String getPlaylist() {
return playlist == null ? "" : playlist.getTitle();
}
public String getYear() {
return year == null ? "" : year.getTitle();
}
public String getArea() {
return area == null ? "" : area.getTitle();
}
public String getTypes() {
return types == null ? "" : getValues(types, false);
}
public String getActors() {
return actors == null ? "" : getValues(actors, true);
}
public String getDirectors() {
return directors == null ? "" : getValues(directors, true);
}
public List<BtboDown> getBtboDownlist() {
return btboDownlist == null ? Collections.emptyList() : btboDownlist;
}
public Vod vod() {
return new Vod(getJumpId(), getTitle(), getThumbnail(), getMask());
}
public String getValues(List<Value> items, boolean link) {
StringBuilder sb = new StringBuilder();
for (Value value : items) sb.append(value.getValue(link)).append(" ");
return Utils.substring(sb.toString());
}
public String getPlayUrl() {
StringBuilder sb = new StringBuilder();
for (BtboDown value : getBtboDownlist()) sb.append(value.getVal()).append("#");
return Utils.substring(sb.toString());
}
public static class Value {
@SerializedName(value = "title", alternate = "name")
private String title;
private String getTitle() {
return TextUtils.isEmpty(title) ? "" : title;
}
private String getLink() {
return String.format("[a=cr:{\"id\":\"%s\",\"name\":\"%s\"}/]%s[/a]", getTitle() + "/{pg}", getTitle(), getTitle());
}
public String getValue(boolean link) {
return link ? getLink() : getTitle();
}
}
public static class BtboDown {
@SerializedName("val")
private String val;
public String getVal() {
return TextUtils.isEmpty(val) ? "" : val.replaceAll("ftp", "tvbox-xg:ftp");
}
}
}

View File

@ -0,0 +1,18 @@
package com.github.catvod.bean.jianpian;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
public class Detail {
@SerializedName("data")
private Data data;
public static Detail objectFrom(String str) {
return new Gson().fromJson(str, Detail.class);
}
public Data getData() {
return data == null ? new Data() : data;
}
}

View File

@ -0,0 +1,21 @@
package com.github.catvod.bean.jianpian;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import java.util.Collections;
import java.util.List;
public class Resp {
@SerializedName("data")
private List<Data> data;
public static Resp objectFrom(String str) {
return new Gson().fromJson(str, Resp.class);
}
public List<Data> getData() {
return data == null ? Collections.emptyList() : data;
}
}

View File

@ -1,46 +0,0 @@
package com.github.catvod.bean.paper;
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.List;
public class Data {
@SerializedName("key")
private String key;
@SerializedName("cat")
private String cat;
@SerializedName("title")
private String title;
@SerializedName("date")
private String date;
public static List<Data> arrayFrom(String str) {
Type listType = new TypeToken<List<Data>>() {}.getType();
return new Gson().fromJson(str, listType);
}
public String getKey() {
return key;
}
public String getCat() {
return cat;
}
public String getTitle() {
return title;
}
public String getDate() {
return date;
}
public Vod getVod() {
return new Vod("https://www.aliyundrive.com/s/" + getKey(), getTitle(), "https://www.lgstatic.com/i/image2/M01/15/7E/CgoB5lysLXCADg6ZAABapAHUnQM321.jpg", getDate());
}
}

View File

@ -58,7 +58,7 @@ public class OkHttp {
}
public static String string(OkHttpClient client, String url, Map<String, String> params, Map<String, String> header) {
return new OkRequest(GET, url, params, header).execute(client).getBody();
return url.startsWith("http") ? new OkRequest(GET, url, params, header).execute(client).getBody() : "";
}
public static String post(String url, Map<String, String> params) {

View File

@ -0,0 +1,114 @@
package com.github.catvod.spider;
import android.content.Context;
import com.github.catvod.bean.Class;
import com.github.catvod.bean.Result;
import com.github.catvod.bean.Vod;
import com.github.catvod.bean.jianpian.Data;
import com.github.catvod.bean.jianpian.Detail;
import com.github.catvod.bean.jianpian.Resp;
import com.github.catvod.crawler.Spider;
import com.github.catvod.net.OkHttp;
import com.google.gson.JsonParser;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Qile
*/
public class Jianpian extends Spider {
private final String siteUrl = "http://api2.rinhome.com";
private String extend;
private Map<String, String> getHeader() {
Map<String, String> headers = new HashMap<>();
headers.put("User-Agent", "jianpian-android/360");
headers.put("JPAUTH", "y261ow7kF2dtzlxh1GS9EB8nbTxNmaK/QQIAjctlKiEv");
return headers;
}
@Override
public void init(Context context, String extend) throws Exception {
this.extend = extend;
}
@Override
public String homeContent(boolean filter) throws Exception {
List<Class> classes = new ArrayList<>();
List<String> typeIds = Arrays.asList("0", "1", "2", "3", "4");
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, JsonParser.parseString(OkHttp.string(extend)));
}
@Override
public String homeVideoContent() {
List<Vod> list = new ArrayList<>();
String url = siteUrl + "/api/slide/list?code=unknown9039b6856c3a3306&pos_id=888&channel=wandoujia";
Resp resp = Resp.objectFrom(OkHttp.string(url, getHeader()));
for (Data data : resp.getData()) list.add(data.vod());
return Result.string(list);
}
@Override
public String categoryContent(String tid, String pg, boolean filter, HashMap<String, String> extend) throws Exception {
if (tid.endsWith("/{pg}")) return searchContent(tid.split("/")[0], pg);
List<Vod> list = new ArrayList<>();
HashMap<String, String> ext = new HashMap<>();
if (extend != null && extend.size() > 0) ext.putAll(extend);
String cateId = ext.get("cateId") == null ? tid : ext.get("cateId");
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 ? "hot" : ext.get("by");
String url = siteUrl + String.format("/api/crumb/list?area=%s&category_id=%s&page=%s&type=0&limit=24&sort=%s&year=%s", area, cateId, pg, by, year);
Resp resp = Resp.objectFrom(OkHttp.string(url, getHeader()));
for (Data data : resp.getData()) list.add(data.vod());
return Result.string(list);
}
@Override
public String detailContent(List<String> ids) throws Exception {
String url = siteUrl + "/api/node/detail?channel=wandoujia&token=&id=" + ids.get(0);
Data data = Detail.objectFrom(OkHttp.string(url, getHeader())).getData();
Vod vod = data.vod();
vod.setVodPlayFrom("Jianpian");
vod.setVodYear(data.getYear());
vod.setVodArea(data.getArea());
vod.setTypeName(data.getTypes());
vod.setVodActor(data.getActors());
vod.setVodPlayUrl(data.getPlayUrl());
vod.setVodDirector(data.getDirectors());
vod.setVodContent(data.getDescription());
return Result.string(vod);
}
@Override
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
return Result.get().url(id).header(getHeader()).string();
}
@Override
public String searchContent(String key, boolean quick) throws Exception {
return searchContent(key, "1");
}
@Override
public String searchContent(String key, boolean quick, String pg) throws Exception {
return searchContent(key, pg);
}
public String searchContent(String key, String pg) throws Exception {
List<Vod> list = new ArrayList<>();
String url = siteUrl + "/api/video/search?page=" + pg + "&key=" + URLEncoder.encode(key);
Resp resp = Resp.objectFrom(OkHttp.string(url, getHeader()));
for (Data data : resp.getData()) list.add(data.vod());
return Result.string(list);
}
}

View File

@ -68,7 +68,7 @@ public class Zhaozy extends Ali {
@Override
public String searchContent(String key, boolean quick) throws Exception {
String url = siteUrl + "sox?filename=" + URLEncoder.encode(key);
String url = siteUrl + "sok?filename=" + URLEncoder.encode(key);
Document doc = Jsoup.parse(OkHttp.string(url, getHeader()));
List<Vod> list = new ArrayList<>();
for (Element element : doc.select("div.li_con div.news_text")) {

View File

@ -2,12 +2,11 @@ package com.github.catvod.utils;
import com.github.catvod.spider.Init;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
public class FileUtil {
@ -56,13 +55,12 @@ public class FileUtil {
public static String read(InputStream is) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(is));
StringBuilder sb = new StringBuilder();
String text;
while ((text = br.readLine()) != null) sb.append(text).append("\n");
br.close();
return Utils.substring(sb.toString());
} catch (Exception e) {
byte[] data = new byte[is.available()];
is.read(data);
is.close();
return new String(data, "UTF-8");
} catch (IOException e) {
e.printStackTrace();
return "";
}
}

Binary file not shown.

View File

@ -1 +1 @@
badfd75846df45e8cf06b53654312ccf
6aa99ddfd99dd2e5b68615edd29ddb43

View File

@ -1,5 +1,5 @@
{
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;badfd75846df45e8cf06b53654312ccf",
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;6aa99ddfd99dd2e5b68615edd29ddb43",
"wallpaper": "https://gao.chuqiuyu.tk",
"sites": [
{

View File

@ -1,5 +1,5 @@
{
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;badfd75846df45e8cf06b53654312ccf",
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;6aa99ddfd99dd2e5b68615edd29ddb43",
"wallpaper": "http://饭太硬.top/深色壁纸/api.php",
"sites": [
{
@ -30,6 +30,15 @@
"filter": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/json/wogg.json"
}
},
{
"key": "賤賤",
"name": "賤賤",
"type": 3,
"api": "csp_Jianpian",
"searchable": 1,
"changeable": 1,
"ext": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/json/jianpian.json"
},
{
"key": "獨播",
"name": "獨播",

482
json/jianpian.json Normal file
View File

@ -0,0 +1,482 @@
{
"0": [
{
"key": "area",
"name": "地區",
"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": "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": "排序",
"value": [
{
"n": "热门",
"v": "hot"
},
{
"n": "更新",
"v": "updata"
},
{
"n": "评分",
"v": "rating"
}
]
}
],
"1": [
{
"key": "area",
"name": "地區",
"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": "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": "排序",
"value": [
{
"n": "热门",
"v": "hot"
},
{
"n": "更新",
"v": "updata"
},
{
"n": "评分",
"v": "rating"
}
]
}
],
"2": [
{
"key": "area",
"name": "地區",
"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": "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": "排序",
"value": [
{
"n": "热门",
"v": "hot"
},
{
"n": "更新",
"v": "updata"
},
{
"n": "评分",
"v": "rating"
}
]
}
],
"3": [
{
"key": "area",
"name": "地區",
"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": "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": "排序",
"value": [
{
"n": "热门",
"v": "hot"
},
{
"n": "更新",
"v": "updata"
},
{
"n": "评分",
"v": "rating"
}
]
}
],
"4": [
{
"key": "area",
"name": "地區",
"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": "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": "排序",
"value": [
{
"n": "热门",
"v": "hot"
},
{
"n": "更新",
"v": "updata"
},
{
"n": "评分",
"v": "rating"
}
]
}
]
}