From f3ba35f7ad121e1d878c7c79d6159dd2fec23bf6 Mon Sep 17 00:00:00 2001
From: catvod <>
Date: Sat, 5 Mar 2022 15:47:26 +0800
Subject: [PATCH] =?UTF-8?q?AppYsV2=20rule=20change=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 8 +--
.../com/github/catvod/demo/MainActivity.java | 2 +-
.../com/github/catvod/spider/AppYsV2.java | 68 ++-----------------
3 files changed, 12 insertions(+), 66 deletions(-)
diff --git a/README.md b/README.md
index 16b22ee..e5fb66d 100644
--- a/README.md
+++ b/README.md
@@ -83,10 +83,10 @@
配置代码示例 点我展开
```json
-{"key":"csp_appysv2_tkys", "name":"天空影视(M2)", "type":3, "api":"csp_AppYsV2","searchable":1,"quickSearch":0,"filterable":1,"ext":"星空影视###https://litecucumber.coding.net/p/cat/d/config/git/raw/master/appysv2.json"},
-{"key":"csp_appys_南府追剧", "name":"南府追剧(M)", "type":3, "api":"csp_AppYs","searchable":1,"quickSearch":0,"filterable":1,"ext":"http://iapp.nfuxs.club/dnmb.php/v1.vod"},
-{"key":"csp_appys_HG影视", "name":"HG影视(M)", "type":3, "api":"csp_AppYs","searchable":1,"quickSearch":0,"filterable":1,"ext":"http://hgyx.vip/api.php/v1.vod"},
-{"key":"csp_appys_瑞丰资源", "name":"瑞丰资源(M)", "type":3, "api":"csp_AppYs","searchable":1,"quickSearch":0,"filterable":1,"ext":"https://ts.yjhan.com:4433/ruifenglb_api.php/v1.vod"},
+{"key":"csp_appysv2_追剧达人", "name":"追剧推荐(M2)", "type":3,"api":"csp_AppYsV2", "searchable":1, "quickSearch":0, "filterable":1, "ext":"https://vipmv.co/xgapp.php/v1/"},
+{"key":"csp_appysv2_天空影视", "name":"天空推荐(M2)", "type":3,"api":"csp_AppYsV2", "searchable":1, "quickSearch":0, "filterable":1, "ext":"https://tkys.tv/xgapp.php/v1/"},
+{"key":"csp_appys_HG影视", "name":"HG影视(M)", "type":3, "api":"csp_AppYs", "searchable":1, "quickSearch":0, "filterable":1, "ext":"http://hgyx.vip/api.php/v1.vod"},
+{"key":"csp_appys_瑞丰资源", "name":"瑞丰资源(M)", "type":3, "api":"csp_AppYs", "searchable":1, "quickSearch":0, "filterable":1, "ext":"https://ts.yjhan.com:4433/ruifenglb_api.php/v1.vod"},
```
diff --git a/app/src/main/java/com/github/catvod/demo/MainActivity.java b/app/src/main/java/com/github/catvod/demo/MainActivity.java
index 5304a5f..e0f5b5f 100644
--- a/app/src/main/java/com/github/catvod/demo/MainActivity.java
+++ b/app/src/main/java/com/github/catvod/demo/MainActivity.java
@@ -23,7 +23,7 @@ public class MainActivity extends Activity {
@Override
public void run() {
AppYsV2 aidi1 = new AppYsV2();
- aidi1.init(MainActivity.this, "NFTV###https://litecucumber.coding.net/p/cat/d/config/git/raw/master/appysv2.json###nftv");
+ aidi1.init(MainActivity.this, "https://vipmv.co/xgapp.php/v1/");
String json = aidi1.homeContent(true);
System.out.println(json);
JSONObject homeContent = null;
diff --git a/app/src/main/java/com/github/catvod/spider/AppYsV2.java b/app/src/main/java/com/github/catvod/spider/AppYsV2.java
index c0c8212..9aef646 100644
--- a/app/src/main/java/com/github/catvod/spider/AppYsV2.java
+++ b/app/src/main/java/com/github/catvod/spider/AppYsV2.java
@@ -349,10 +349,6 @@ public class AppYsV2 extends Spider {
ArrayList parseUrls = parseUrlMap.get(flag);
if (parseUrls == null)
parseUrls = new ArrayList<>();
- String parseUrl = getCustomJxUrl(flag);
- if (!parseUrl.isEmpty()) {
- parseUrls.add(0, parseUrl);
- }
if (!parseUrls.isEmpty()) {
JSONObject result = getFinalVideo(flag, parseUrls, id);
if (result != null)
@@ -821,69 +817,19 @@ public class AppYsV2 extends Spider {
private String getApiUrl() {
- if (extInfos == null || extInfos.length < 2)
+ if (extInfos == null || extInfos.length < 1)
return "";
- JSONObject siteRule = fetchRule(extInfos[1].trim());
- if (siteRule == null)
- return "";
- try {
- return siteRule.getJSONObject("sites").getJSONObject(extInfos[0].trim()).getString("url");
- } catch (JSONException e) {
- }
- return "";
- }
-
- private String getCustomJxUrl(String flag) {
- if (extInfos == null || extInfos.length < 2)
- return "";
- JSONObject siteRule = fetchRule(extInfos[1].trim());
- if (siteRule == null)
- return "";
- try {
- JSONArray jxArray = siteRule.getJSONObject("sites").getJSONObject(extInfos[0].trim()).optJSONArray("jx");
- if (jxArray != null)
- for (int i = 0; i < jxArray.length(); i++) {
- JSONArray jxUrls = jxArray.getJSONArray(i);
- for (int j = 0; j < jxUrls.length() - 1; j++) {
- if (jxUrls.getString(j).equals(flag))
- return jxUrls.getString(jxUrls.length() - 1);
- }
- }
- jxArray = siteRule.optJSONArray("jx");
- if (jxArray != null)
- for (int i = 0; i < jxArray.length(); i++) {
- JSONArray jxUrls = jxArray.getJSONArray(i);
- for (int j = 0; j < jxUrls.length() - 1; j++) {
- if (jxUrls.getString(j).equals(flag))
- return jxUrls.getString(jxUrls.length() - 1);
- }
- }
- } catch (JSONException e) {
- }
- return "";
+ return extInfos[0].trim();
}
private String[] extInfos = null;
- private static HashMap rules = new HashMap<>();
-
- private synchronized JSONObject fetchRule(String ruleUrl) {
- if (rules.containsKey(ruleUrl))
- return rules.get(ruleUrl);
- JSONObject object = null;
- try {
- String content = OkHttpUtil.string(ruleUrl, null);
- object = new JSONObject(content);
- rules.put(ruleUrl, object);
- } catch (Throwable th) {
-
- }
- return object;
- }
-
protected String desc(String src, byte type) {
- if (extInfos.length > 2) {
- String descFlag = extInfos[2];
+ if (extInfos.length > 1) {
+ String descFlag = extInfos[1];
+ if (descFlag.equals("nftv")) {
+
+ }
}
return src;
}