Merge branch 'main' of https://github.com/FongMi/CatVodSpider
This commit is contained in:
commit
248d8c2501
|
|
@ -37,6 +37,7 @@
|
|||
-keep class net.engio.mbassy.** { *; }
|
||||
|
||||
# Zxing
|
||||
-keep class com.google.zxing.** { *; }
|
||||
-keepclassmembers enum * {
|
||||
public static **[] values();
|
||||
public static ** valueOf(java.lang.String);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import android.content.DialogInterface;
|
|||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Build;
|
||||
import android.os.SystemClock;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
|
|
@ -132,8 +131,12 @@ public class API {
|
|||
}
|
||||
|
||||
private boolean alist(String url, JSONObject body) {
|
||||
OkResult result = OkHttp.postJson(url, body.toString(), getHeader());
|
||||
SpiderDebug.log(result.getCode() + "," + url + "," + result.getBody());
|
||||
//https://api-cf.nn.ci/alist/ali_open/
|
||||
//https://api.xhofe.top/alist/ali_open/
|
||||
//https://sni_api_nn_ci.cooluc.com/alist/ali_open/
|
||||
String api = "https://api.xhofe.top/alist/ali_open/" + url;
|
||||
OkResult result = OkHttp.postJson(api, body.toString(), getHeader());
|
||||
SpiderDebug.log(result.getCode() + "," + api + "," + result.getBody());
|
||||
if (isManyRequest(result.getBody())) return false;
|
||||
oauth = OAuth.objectFrom(result.getBody()).save();
|
||||
return true;
|
||||
|
|
@ -235,7 +238,7 @@ public class API {
|
|||
JSONObject body = new JSONObject();
|
||||
body.put("code", code);
|
||||
body.put("grant_type", "authorization_code");
|
||||
return alist("https://api-cf.nn.ci/alist/ali_open/code", body);
|
||||
return alist("code", body);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
oauth.clean().save();
|
||||
|
|
@ -250,7 +253,7 @@ public class API {
|
|||
JSONObject body = new JSONObject();
|
||||
body.put("grant_type", "refresh_token");
|
||||
body.put("refresh_token", oauth.getRefreshToken());
|
||||
return alist("https://api-cf.nn.ci/alist/ali_open/token", body);
|
||||
return alist("token", body);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
oauth.clean().save();
|
||||
|
|
@ -532,9 +535,9 @@ public class API {
|
|||
FrameLayout frame = new FrameLayout(Init.context());
|
||||
params.gravity = Gravity.CENTER;
|
||||
frame.addView(image, params);
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(Init.getActivity()).setView(frame);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) builder.setOnDismissListener(this::dismiss);
|
||||
dialog = builder.show();
|
||||
dialog = new AlertDialog.Builder(Init.getActivity()).setView(frame).create();
|
||||
dialog.setOnDismissListener(this::dismiss);
|
||||
dialog.show();
|
||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
Init.show("請使用阿里雲盤 App 掃描二維碼");
|
||||
} catch (Exception ignored) {
|
||||
|
|
|
|||
|
|
@ -1,59 +0,0 @@
|
|||
package com.github.catvod.spider;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.github.catvod.bean.Result;
|
||||
import com.github.catvod.bean.Vod;
|
||||
import com.github.catvod.net.OkHttp;
|
||||
import com.github.catvod.utils.Utils;
|
||||
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Element;
|
||||
import org.jsoup.select.Elements;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author zhixc
|
||||
*/
|
||||
public class TuGou extends Ali {
|
||||
|
||||
private final String URL = "https://tugousou.com";
|
||||
|
||||
private Map<String, String> getHeader() {
|
||||
Map<String, String> header = new HashMap<>();
|
||||
header.put("User-Agent", Utils.CHROME);
|
||||
header.put("Host", "tugousou.com");
|
||||
header.put("Origin", URL);
|
||||
header.put("Referer", URL + "/");
|
||||
return header;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context, String extend) {
|
||||
super.init(context, extend);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String searchContent(String key, boolean quick) {
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("keyword", key);
|
||||
String html = OkHttp.post(URL + "/search", params, getHeader());
|
||||
Element container = Jsoup.parse(html).select(".layui-container").get(1);
|
||||
Elements aElements = container.select("p[class=layui-font-16] > a");
|
||||
Elements pElements = container.select("p[class=layui-font-14 layui-font-gray text-align-right]");
|
||||
List<Vod> list = new ArrayList<>();
|
||||
for (int i = 0; i < aElements.size(); i++) {
|
||||
Element item = aElements.get(i);
|
||||
String vodId = item.attr("href");
|
||||
String name = item.text();
|
||||
String pic = "https://inews.gtimg.com/newsapp_bt/0/13263837859/1000";
|
||||
String remark = pElements.get(i).text();
|
||||
list.add(new Vod(vodId, name, pic, remark));
|
||||
}
|
||||
return Result.string(list);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.github.catvod.spider;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.github.catvod.bean.Result;
|
||||
import com.github.catvod.bean.Vod;
|
||||
import com.github.catvod.net.OkHttp;
|
||||
import com.github.catvod.utils.Utils;
|
||||
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Element;
|
||||
import org.jsoup.select.Elements;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Arrays;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author zhixc
|
||||
*/
|
||||
public class Wogg extends Ali {
|
||||
|
||||
private final String siteURL = "https://tvfan.xxooo.cf";
|
||||
|
||||
private final Pattern regexAli = Pattern.compile("(https://www.aliyundrive.com/s/[^\"]+)");
|
||||
|
||||
private Map<String, String> getHeader() {
|
||||
Map<String, String> header = new HashMap<>();
|
||||
header.put("User-Agent", Utils.CHROME);
|
||||
return header;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context, String extend) {
|
||||
super.init(context, extend);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String detailContent(List<String> ids) throws Exception {
|
||||
Matcher matcher = regexAli.matcher(OkHttp.string(siteURL + ids.get(0), getHeader()));
|
||||
if (matcher.find()) return super.detailContent(Arrays.asList(matcher.group(1)));
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String searchContent(String key, boolean quick) throws Exception {
|
||||
String searchURL = siteURL + "/index.php/vodsearch/-------------.html?wd=" + URLEncoder.encode(key);
|
||||
String html = OkHttp.string(searchURL, getHeader());
|
||||
Elements items = Jsoup.parse(html).select(".module-search-item");
|
||||
List<Vod> list = new ArrayList<>();
|
||||
for (Element item : items) {
|
||||
String vodId = item.select(".video-serial").attr("href");
|
||||
String name = item.select(".video-serial").attr("title");
|
||||
String pic = item.select(".module-item-pic > img").attr("data-src");
|
||||
String remark = item.select(".video-tag-icon").text();
|
||||
list.add(new Vod(vodId, name, pic, remark));
|
||||
}
|
||||
return Result.string(list);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
16f9147da64cbbc596831e87ebcafd79
|
||||
16f80f13f3bd4b6fedfb3af5f5b3d3d0
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;16f9147da64cbbc596831e87ebcafd79",
|
||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;16f80f13f3bd4b6fedfb3af5f5b3d3d0",
|
||||
"wallpaper": "https://gao.chuqiuyu.tk",
|
||||
"sites": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;16f9147da64cbbc596831e87ebcafd79",
|
||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;16f80f13f3bd4b6fedfb3af5f5b3d3d0",
|
||||
"wallpaper": "http://饭太硬.top/深色壁纸/api.php",
|
||||
"sites": [
|
||||
{
|
||||
|
|
@ -170,10 +170,10 @@
|
|||
"changeable": 1
|
||||
},
|
||||
{
|
||||
"key": "土狗",
|
||||
"name": "土狗",
|
||||
"key": "玩偶",
|
||||
"name": "玩偶",
|
||||
"type": 3,
|
||||
"api": "csp_TuGou",
|
||||
"api": "csp_Wogg",
|
||||
"searchable": 1,
|
||||
"changeable": 0
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue