Merge branch 'main' of github.com:FongMi/CatVodSpider
This commit is contained in:
commit
d1c040c9c0
|
|
@ -7,6 +7,8 @@ import android.graphics.drawable.ColorDrawable;
|
|||
import android.os.SystemClock;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
|
||||
|
|
@ -21,6 +23,7 @@ import com.github.catvod.bean.ali.Sorter;
|
|||
import com.github.catvod.bean.ali.User;
|
||||
import com.github.catvod.crawler.SpiderDebug;
|
||||
import com.github.catvod.net.OkHttp;
|
||||
import com.github.catvod.net.OkResult;
|
||||
import com.github.catvod.spider.Init;
|
||||
import com.github.catvod.spider.Proxy;
|
||||
import com.github.catvod.utils.Prefers;
|
||||
|
|
@ -41,6 +44,7 @@ import java.util.Map;
|
|||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
public class API {
|
||||
|
||||
|
|
@ -79,6 +83,14 @@ public class API {
|
|||
this.refreshToken = token;
|
||||
}
|
||||
|
||||
public Object[] getToken() {
|
||||
Object[] result = new Object[3];
|
||||
result[0] = 200;
|
||||
result[1] = "text/plain";
|
||||
result[2] = new ByteArrayInputStream(user.getRefreshToken().getBytes());
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setShareId(String shareId) {
|
||||
this.shareId = shareId;
|
||||
refreshShareToken();
|
||||
|
|
@ -105,42 +117,31 @@ public class API {
|
|||
return headers;
|
||||
}
|
||||
|
||||
private String alist(String url, JSONObject body) throws Exception {
|
||||
url = "https://api.nn.ci/alist/ali_open/" + url;
|
||||
OkResult result = OkHttp.postJson(url, body.toString(), getHeader());
|
||||
if (isManyRequest(result.getBody())) return "";
|
||||
if (result.getCode() == 200) return result.getBody();
|
||||
throw new Exception(result.getBody());
|
||||
}
|
||||
|
||||
private String post(String url, JSONObject body) {
|
||||
url = url.startsWith("https") ? url : "https://api.aliyundrive.com/" + url;
|
||||
return OkHttp.postJson(url, body.toString(), getHeader());
|
||||
return OkHttp.postJson(url, body.toString(), getHeader()).getBody();
|
||||
}
|
||||
|
||||
private String auth(String url, String json, boolean retry) {
|
||||
url = url.startsWith("https") ? url : "https://api.aliyundrive.com/" + url;
|
||||
String result = OkHttp.postJson(url, json, getHeaderAuth());
|
||||
if (retry && checkAuth(result)) return auth(url, json, false);
|
||||
return result;
|
||||
OkResult result = OkHttp.postJson(url, json, getHeaderAuth());
|
||||
if (retry && result.getCode() != 200 && refreshAccessToken()) return auth(url, json, false);
|
||||
return result.getBody();
|
||||
}
|
||||
|
||||
private String oauth(String url, String json, boolean retry) {
|
||||
url = url.startsWith("https") ? url : "https://open.aliyundrive.com/adrive/v1.0/" + url;
|
||||
String result = OkHttp.postJson(url, json, getHeaderOpen());
|
||||
if (retry && checkOpen(result)) return oauth(url, json, false);
|
||||
return result;
|
||||
}
|
||||
|
||||
private boolean checkAuth(String result) {
|
||||
if (result.contains("AccessTokenInvalid")) return refreshAccessToken();
|
||||
if (result.contains("ShareLinkTokenInvalid") || result.contains("InvalidParameterNotMatch")) return refreshShareToken();
|
||||
return checkQuotaExhausted(result);
|
||||
}
|
||||
|
||||
private boolean checkOpen(String result) {
|
||||
if (result.contains("AccessTokenInvalid")) return refreshOpenToken();
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean checkQuotaExhausted(String result) {
|
||||
if (!result.contains("QuotaExhausted")) return false;
|
||||
Init.show("容量不夠拉。");
|
||||
user.clean().save();
|
||||
refreshAccessToken();
|
||||
return false;
|
||||
OkResult result = OkHttp.postJson(url, json, getHeaderOpen());
|
||||
if (retry && result.getCode() != 200 && refreshOpenToken()) return oauth(url, json, false);
|
||||
return result.getBody();
|
||||
}
|
||||
|
||||
private boolean isManyRequest(String result) {
|
||||
|
|
@ -151,11 +152,9 @@ public class API {
|
|||
return true;
|
||||
}
|
||||
|
||||
private boolean isInvalidOpenToken(String result) {
|
||||
if (!result.contains("invalid refresh_token")) return false;
|
||||
oauth.clean().save();
|
||||
oauthRequest();
|
||||
return true;
|
||||
private boolean onTimeout() {
|
||||
stopService();
|
||||
return false;
|
||||
}
|
||||
|
||||
public void checkAccessToken() {
|
||||
|
|
@ -178,10 +177,11 @@ public class API {
|
|||
if (oauth.getAccessToken().isEmpty()) oauthRequest();
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
if (e instanceof TimeoutException) return onTimeout();
|
||||
e.printStackTrace();
|
||||
user.clean().save();
|
||||
SpiderDebug.log(e);
|
||||
stopService();
|
||||
getQRCode();
|
||||
startFlow();
|
||||
return true;
|
||||
} finally {
|
||||
while (user.getAccessToken().isEmpty()) SystemClock.sleep(250);
|
||||
|
|
@ -198,7 +198,7 @@ public class API {
|
|||
String result = auth(url, body.toString(), true);
|
||||
oauthRedirect(Code.objectFrom(result).getCode());
|
||||
} catch (Exception e) {
|
||||
SpiderDebug.log(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -208,12 +208,10 @@ public class API {
|
|||
JSONObject body = new JSONObject();
|
||||
body.put("code", code);
|
||||
body.put("grant_type", "authorization_code");
|
||||
String result = post("https://api.nn.ci/alist/ali_open/code", body);
|
||||
if (isManyRequest(result)) return;
|
||||
oauth = OAuth.objectFrom(result).save();
|
||||
SpiderDebug.log(oauth.toString());
|
||||
oauth = OAuth.objectFrom(alist("code", body)).save();
|
||||
} catch (Exception e) {
|
||||
SpiderDebug.log(e);
|
||||
e.printStackTrace();
|
||||
oauth.clean().save();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -223,39 +221,35 @@ public class API {
|
|||
JSONObject body = new JSONObject();
|
||||
body.put("grant_type", "refresh_token");
|
||||
body.put("refresh_token", oauth.getRefreshToken());
|
||||
String result = post("https://api.nn.ci/alist/ali_open/token", body);
|
||||
if (isManyRequest(result)) return false;
|
||||
if (isInvalidOpenToken(result)) return true;
|
||||
oauth = OAuth.objectFrom(result).save();
|
||||
SpiderDebug.log(oauth.toString());
|
||||
oauth = OAuth.objectFrom(alist("token", body)).save();
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
SpiderDebug.log(e);
|
||||
return false;
|
||||
e.printStackTrace();
|
||||
oauth.clean().save();
|
||||
oauthRequest();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean refreshShareToken() {
|
||||
private void refreshShareToken() {
|
||||
try {
|
||||
SpiderDebug.log("refreshShareToken...");
|
||||
JSONObject body = new JSONObject();
|
||||
body.put("share_id", shareId);
|
||||
body.put("share_pwd", "");
|
||||
JSONObject object = new JSONObject(post("v2/share_link/get_share_token", body));
|
||||
shareToken = object.getString("share_token");
|
||||
return true;
|
||||
String result = post("v2/share_link/get_share_token", body);
|
||||
shareToken = new JSONObject(result).getString("share_token");
|
||||
} catch (Exception e) {
|
||||
Init.show("來晚啦,該分享已失效。");
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
Init.show("來晚啦,該分享已失效。");
|
||||
}
|
||||
}
|
||||
|
||||
public Vod getVod(String url, String fileId) throws Exception {
|
||||
JSONObject body = new JSONObject();
|
||||
body.put("share_id", shareId);
|
||||
String json = post("adrive/v3/share_link/get_share_by_anonymous", body);
|
||||
JSONObject object = new JSONObject(json);
|
||||
String result = post("adrive/v3/share_link/get_share_by_anonymous", body);
|
||||
JSONObject object = new JSONObject(result);
|
||||
List<Item> files = new ArrayList<>();
|
||||
LinkedHashMap<String, List<String>> subMap = new LinkedHashMap<>();
|
||||
listFiles(new Item(getParentFileId(fileId, object)), files, subMap);
|
||||
|
|
@ -434,16 +428,37 @@ public class API {
|
|||
return result;
|
||||
}
|
||||
|
||||
private void getQRCode() {
|
||||
private void startFlow() {
|
||||
if (Utils.isMobile()) {
|
||||
user.setRefreshToken(refreshToken);
|
||||
refreshAccessToken();
|
||||
Init.run(this::showInput);
|
||||
} else {
|
||||
Data data = Data.objectFrom(OkHttp.string("https://passport.aliyundrive.com/newlogin/qrcode/generate.do?appName=aliyun_drive&fromSite=52&appName=aliyun_drive&appEntrance=web&isMobile=false&lang=zh_CN&returnUrl=&bizParams=&_bx-v=2.2.3")).getContent().getData();
|
||||
String url = "https://passport.aliyundrive.com/newlogin/qrcode/generate.do?appName=aliyun_drive&fromSite=52&appName=aliyun_drive&appEntrance=web&isMobile=false&lang=zh_CN&returnUrl=&bizParams=&_bx-v=2.2.3";
|
||||
Data data = Data.objectFrom(OkHttp.string(url)).getContent().getData();
|
||||
Init.run(() -> showQRCode(data));
|
||||
}
|
||||
}
|
||||
|
||||
private void showInput() {
|
||||
try {
|
||||
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
params.setMargins(Utils.dp2px(16), Utils.dp2px(16), Utils.dp2px(16), Utils.dp2px(16));
|
||||
FrameLayout frame = new FrameLayout(Init.context());
|
||||
EditText input = new EditText(Init.context());
|
||||
frame.addView(input, params);
|
||||
dialog = new AlertDialog.Builder(Init.getActivity()).setTitle("請輸入Token").setView(frame).setNegativeButton(android.R.string.cancel, null).setPositiveButton(android.R.string.ok, (dialog, which) -> onPositive(input.getText().toString())).show();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
private void onPositive(String text) {
|
||||
dialog.dismiss();
|
||||
Init.execute(() -> {
|
||||
if (text.startsWith("http")) setToken(OkHttp.string(text));
|
||||
else if (text.length() == 32) setToken(text);
|
||||
else if (text.contains(":")) setToken(OkHttp.string("http://" + text + "/proxy?do=ali&type=token"));
|
||||
});
|
||||
}
|
||||
|
||||
private void showQRCode(Data data) {
|
||||
try {
|
||||
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(Utils.dp2px(240), Utils.dp2px(240));
|
||||
|
|
@ -470,7 +485,8 @@ public class API {
|
|||
}
|
||||
|
||||
private void setToken(String value) {
|
||||
Init.show("請重新進入播放頁");
|
||||
SpiderDebug.log("Token:" + value);
|
||||
Init.show("Token:" + value);
|
||||
this.refreshToken = value;
|
||||
refreshAccessToken();
|
||||
stopService();
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class Cronet {
|
|||
}
|
||||
|
||||
public static String string(OkHttpClient client, String method, String url, String tag, Map<String, String> params, Map<String, String> header, Map<String, List<String>> respHeader) {
|
||||
return new OkRequest(method, url, params, header, respHeader).tag(tag).execute(client);
|
||||
return new OkRequest(method, url, params, header, respHeader).tag(tag).execute(client).getBody();
|
||||
}
|
||||
|
||||
public static String string(String url) {
|
||||
|
|
@ -107,11 +107,11 @@ public class Cronet {
|
|||
return string(client(), POST, url, null, params, header, respHeader);
|
||||
}
|
||||
|
||||
public static String postJson(String url, String json) {
|
||||
public static OkResult postJson(String url, String json) {
|
||||
return postJson(url, json, null);
|
||||
}
|
||||
|
||||
public static String postJson(String url, String json, Map<String, String> header) {
|
||||
public static OkResult postJson(String url, String json, Map<String, String> header) {
|
||||
return new OkRequest(POST, url, json, header).execute(client());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public class OkHttp {
|
|||
}
|
||||
|
||||
public static String string(OkHttpClient client, String method, String url, String tag, Map<String, String> params, Map<String, String> header, Map<String, List<String>> respHeader) {
|
||||
return new OkRequest(method, url, params, header, respHeader).tag(tag).execute(client);
|
||||
return new OkRequest(method, url, params, header, respHeader).tag(tag).execute(client).getBody();
|
||||
}
|
||||
|
||||
public static String string(String url) {
|
||||
|
|
@ -103,11 +103,11 @@ public class OkHttp {
|
|||
return string(client(), POST, url, null, params, header, respHeader);
|
||||
}
|
||||
|
||||
public static String postJson(String url, String json) {
|
||||
public static OkResult postJson(String url, String json) {
|
||||
return postJson(url, json, null);
|
||||
}
|
||||
|
||||
public static String postJson(String url, String json, Map<String, String> header) {
|
||||
public static OkResult postJson(String url, String json, Map<String, String> header) {
|
||||
return new OkRequest(POST, url, json, header).execute(client());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,14 +71,14 @@ class OkRequest {
|
|||
url = Utils.substring(url);
|
||||
}
|
||||
|
||||
public String execute(OkHttpClient client) {
|
||||
public OkResult execute(OkHttpClient client) {
|
||||
try {
|
||||
Response response = client.newCall(request).execute();
|
||||
if (respHeader != null) respHeader.clear();
|
||||
if (respHeader != null) respHeader.putAll(response.headers().toMultimap());
|
||||
return response.body().string();
|
||||
return new OkResult(response.code(), response.body().string());
|
||||
} catch (IOException e) {
|
||||
return "";
|
||||
return new OkResult();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package com.github.catvod.net;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
public class OkResult {
|
||||
|
||||
private final int code;
|
||||
private final String body;
|
||||
|
||||
public OkResult() {
|
||||
this.code = 500;
|
||||
this.body = "";
|
||||
}
|
||||
|
||||
public OkResult(int code, String body) {
|
||||
this.code = code;
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getBody() {
|
||||
return TextUtils.isEmpty(body) ? "" : body;
|
||||
}
|
||||
}
|
||||
|
|
@ -142,7 +142,7 @@ public class AList extends Spider {
|
|||
JSONObject params = new JSONObject();
|
||||
params.put("password", drive.getPassword());
|
||||
params.put("path", path.startsWith(drive.getPath()) ? path : drive.getPath() + path);
|
||||
String response = OkHttp.postJson(drive.getApi(), params.toString());
|
||||
String response = OkHttp.postJson(drive.getApi(), params.toString()).getBody();
|
||||
return Item.objectFrom(getDetailJson(drive.isNew(), response));
|
||||
} catch (Exception e) {
|
||||
return new Item();
|
||||
|
|
@ -157,7 +157,7 @@ public class AList extends Spider {
|
|||
JSONObject params = new JSONObject();
|
||||
params.put("password", drive.getPassword());
|
||||
params.put("path", path.startsWith(drive.getPath()) ? path : drive.getPath() + path);
|
||||
String response = OkHttp.postJson(drive.listApi(), params.toString());
|
||||
String response = OkHttp.postJson(drive.listApi(), params.toString()).getBody();
|
||||
List<Item> items = Item.arrayFrom(getListJson(drive.isNew(), response));
|
||||
Iterator<Item> iterator = items.iterator();
|
||||
if (filter) while (iterator.hasNext()) if (iterator.next().ignore(drive.isNew())) iterator.remove();
|
||||
|
|
@ -169,7 +169,7 @@ public class AList extends Spider {
|
|||
|
||||
private void search(CountDownLatch cd, List<Vod> list, Drive drive, String keyword) {
|
||||
try {
|
||||
String response = OkHttp.postJson(drive.searchApi(), drive.params(keyword));
|
||||
String response = OkHttp.postJson(drive.searchApi(), drive.params(keyword)).getBody();
|
||||
List<Item> items = Item.arrayFrom(getSearchJson(drive.isNew(), response));
|
||||
for (Item item : items) if (!item.ignore(drive.isNew())) list.add(item.getVod(drive, vodPic));
|
||||
} catch (Exception ignored) {
|
||||
|
|
|
|||
|
|
@ -50,9 +50,10 @@ public class Ali extends Spider {
|
|||
return Result.get().url(url).subs(API.get().getSub(ids)).header(API.get().getHeader()).parse(0).string();
|
||||
}
|
||||
|
||||
public static Object[] vod(Map<String, String> params) {
|
||||
public static Object[] proxy(Map<String, String> params) {
|
||||
String type = params.get("type");
|
||||
if (type.equals("sub")) return API.get().proxySub(params);
|
||||
if (type.equals("token")) return API.get().getToken();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -43,12 +43,12 @@ public class Hanime extends Spider {
|
|||
List<Class> classes = new ArrayList<>();
|
||||
LinkedHashMap<String, List<Filter>> filters = new LinkedHashMap<>();
|
||||
Document doc1 = Jsoup.parse(OkHttp.string(siteUrl.concat("/search?genre=裏番"), getHeaders()));
|
||||
List<String> sorts = doc1.select("div.hentai-sort-options").eachText();
|
||||
List<String> sorts = doc1.select("div.hentai-sort-options-wrapper").eachText();
|
||||
List<String> years = doc1.getElementById("year").select("option").eachAttr("value");
|
||||
Document doc2 = Jsoup.parse(OkHttp.string(siteUrl, getHeaders()));
|
||||
for (Element element : doc2.select("a.nav-item")) {
|
||||
String text = element.text();
|
||||
if (text.equals("新番預告") || text.equals("H漫畫") || text.equals("我的清單")) continue;
|
||||
if (text.equals("新番預告") || text.equals("H漫畫")) continue;
|
||||
classes.add(new Class(text));
|
||||
List<Filter> array = new ArrayList<>();
|
||||
array.add(getFilter("排序", "by", sorts));
|
||||
|
|
@ -76,9 +76,9 @@ public class Hanime extends Spider {
|
|||
String target = siteUrl.concat("/search?genre=").concat(tid).concat("&page=").concat(pg).concat("&sort=").concat(extend.get("by")).concat("&year=").concat(extend.get("year"));
|
||||
Document doc = Jsoup.parse(OkHttp.string(target, getHeaders()));
|
||||
for (Element element : doc.select("div.col-xs-6")) {
|
||||
String pic = element.select("div > a > div >img").get(1).attr("src");
|
||||
String url = element.select("div > div > div > a").attr("href");
|
||||
String name = element.select("div > div > div > a").text();
|
||||
String pic = element.select("img").get(1).attr("src");
|
||||
String url = element.select("a.overlay").attr("href");
|
||||
String name = element.select("div.card-mobile-title").text();
|
||||
String id = url.split("=")[1];
|
||||
list.add(new Vod(id, name, pic));
|
||||
}
|
||||
|
|
@ -101,7 +101,7 @@ public class Hanime extends Spider {
|
|||
public String detailContent(List<String> ids) throws Exception {
|
||||
Document doc = Jsoup.parse(OkHttp.string(siteUrl.concat("/watch?v=").concat(ids.get(0)), getHeaders()));
|
||||
String name = doc.getElementById("shareBtn-title").text();
|
||||
String content = doc.getElementById("caption").text();
|
||||
String content = doc.select("div.video-caption-text").text();
|
||||
String pic = doc.select("meta[property=og:image]").attr("content");
|
||||
String url = doc.getElementById("video-sd").attr("value");
|
||||
Vod vod = new Vod();
|
||||
|
|
@ -120,9 +120,9 @@ public class Hanime extends Spider {
|
|||
String target = siteUrl.concat("/search?query=").concat(key).concat("&genre=&sort=&year=&month=&duration=");
|
||||
Document doc = Jsoup.parse(OkHttp.string(target, getHeaders()));
|
||||
for (Element element : doc.select("div.col-xs-6")) {
|
||||
String pic = element.select("div > a > div >img").get(1).attr("src");
|
||||
String url = element.select("div > div > div > a").attr("href");
|
||||
String name = element.select("div > div > div > a").text();
|
||||
String pic = element.select("img").get(1).attr("src");
|
||||
String url = element.select("a.overlay").attr("href");
|
||||
String name = element.select("div.card-mobile-title").text();
|
||||
String id = url.split("=")[1];
|
||||
list.add(new Vod(id, name, pic));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public class Proxy extends Spider {
|
|||
case "ck":
|
||||
return new Object[]{200, "text/plain; charset=utf-8", new ByteArrayInputStream("ok".getBytes("UTF-8"))};
|
||||
case "ali":
|
||||
return Ali.vod(params);
|
||||
return Ali.proxy(params);
|
||||
case "webdav":
|
||||
return WebDAV.vod(params);
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -1,48 +0,0 @@
|
|||
package com.github.catvod.spider;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.SystemClock;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
|
||||
import com.github.catvod.bean.Result;
|
||||
import com.github.catvod.bean.yiso.Item;
|
||||
import com.github.catvod.utils.Utils;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class YiSo extends Ali {
|
||||
|
||||
@Override
|
||||
public void init(Context context, String extend) {
|
||||
super.init(context, extend);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String searchContent(String key, boolean quick) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return "";
|
||||
String url = "https://yiso.fun/api/search?name=" + URLEncoder.encode(key) + "&from=ali";
|
||||
Map<String, String> result = new HashMap<>();
|
||||
Utils.loadWebView(url, getWebViewClient(result));
|
||||
while (!result.containsKey("json")) SystemClock.sleep(50);
|
||||
String json = JsonParser.parseString(Objects.requireNonNull(result.get("json"))).getAsJsonPrimitive().getAsString();
|
||||
return Result.string(Item.objectFrom(json).getData().getList(key));
|
||||
}
|
||||
|
||||
private WebViewClient getWebViewClient(Map<String, String> result) {
|
||||
return new WebViewClient() {
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return;
|
||||
view.evaluateJavascript("document.getElementsByTagName('pre')[0].textContent", value -> {
|
||||
if (!value.equals("null")) result.put("json", value);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -35,7 +35,10 @@ public class Utils {
|
|||
}
|
||||
|
||||
public static boolean isMobile() {
|
||||
return Init.context().getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
|
||||
boolean hasCamera = Init.context().getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY);
|
||||
boolean hasPhone = Init.context().getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
|
||||
boolean hasBT = Init.context().getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH);
|
||||
return hasCamera && hasPhone && hasBT;
|
||||
}
|
||||
|
||||
public static boolean isSub(String ext) {
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
367befc168a7f12685b9443558dde3a6
|
||||
3943d051cc917b936cbfa116baf94a74
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;dadcea0e365a64c6cd3c48b7dd948772",
|
||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;3943d051cc917b936cbfa116baf94a74",
|
||||
"wallpaper": "https://gao.chuqiuyu.tk",
|
||||
"sites": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,70 +0,0 @@
|
|||
{
|
||||
"sites": [
|
||||
{
|
||||
"key": "紙條",
|
||||
"name": "紙條",
|
||||
"type": 3,
|
||||
"api": "csp_Paper",
|
||||
"searchable": 1,
|
||||
"filterable": 1,
|
||||
"changeable": 0,
|
||||
"ext": "影視天下第一",
|
||||
"jar": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar"
|
||||
},
|
||||
{
|
||||
"key": "易搜",
|
||||
"name": "易搜",
|
||||
"type": 3,
|
||||
"api": "csp_YiSo",
|
||||
"searchable": 1,
|
||||
"filterable": 0,
|
||||
"changeable": 0,
|
||||
"ext": "影視天下第一",
|
||||
"jar": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar"
|
||||
},
|
||||
{
|
||||
"key": "盤搜",
|
||||
"name": "盤搜",
|
||||
"type": 3,
|
||||
"api": "csp_PanSou",
|
||||
"searchable": 1,
|
||||
"filterable": 0,
|
||||
"changeable": 0,
|
||||
"ext": "影視天下第一",
|
||||
"jar": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar"
|
||||
},
|
||||
{
|
||||
"key": "UP雲搜",
|
||||
"name": "UP雲搜",
|
||||
"type": 3,
|
||||
"api": "csp_UpYun",
|
||||
"searchable": 1,
|
||||
"filterable": 0,
|
||||
"changeable": 0,
|
||||
"ext": "影視天下第一",
|
||||
"jar": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar"
|
||||
},
|
||||
{
|
||||
"key": "找資源",
|
||||
"name": "找資源",
|
||||
"type": 3,
|
||||
"api": "csp_Zhaozy",
|
||||
"searchable": 1,
|
||||
"filterable": 0,
|
||||
"changeable": 0,
|
||||
"ext": "影視天下第一$$$test2$$$test2",
|
||||
"jar": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar"
|
||||
},
|
||||
{
|
||||
"key": "push_agent",
|
||||
"name": "推送",
|
||||
"type": 3,
|
||||
"api": "csp_Push",
|
||||
"searchable": 1,
|
||||
"filterable": 0,
|
||||
"changeable": 0,
|
||||
"ext": "影視天下第一",
|
||||
"jar": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;dadcea0e365a64c6cd3c48b7dd948772",
|
||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;3943d051cc917b936cbfa116baf94a74",
|
||||
"wallpaper": "http://饭太硬.ga/深色壁纸/api.php",
|
||||
"sites": [
|
||||
{
|
||||
|
|
@ -88,10 +88,10 @@
|
|||
"changeable": 0
|
||||
},
|
||||
{
|
||||
"key": "易搜",
|
||||
"name": "易搜",
|
||||
"key": "雲搜",
|
||||
"name": "雲搜",
|
||||
"type": 3,
|
||||
"api": "csp_YiSo",
|
||||
"api": "csp_UpYun",
|
||||
"searchable": 1,
|
||||
"filterable": 0,
|
||||
"changeable": 0
|
||||
|
|
@ -114,15 +114,6 @@
|
|||
"filterable": 0,
|
||||
"changeable": 0
|
||||
},
|
||||
{
|
||||
"key": "UP雲搜",
|
||||
"name": "UP雲搜",
|
||||
"type": 3,
|
||||
"api": "csp_UpYun",
|
||||
"searchable": 1,
|
||||
"filterable": 0,
|
||||
"changeable": 0
|
||||
},
|
||||
{
|
||||
"key": "找資源",
|
||||
"name": "找資源",
|
||||
|
|
|
|||
Loading…
Reference in New Issue