AppYsV2 rule change。
This commit is contained in:
parent
3ae3586776
commit
f3ba35f7ad
|
@ -83,10 +83,10 @@
|
|||
<summary>配置代码示例 点我展开</summary>
|
||||
|
||||
```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"},
|
||||
```
|
||||
</details>
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -349,10 +349,6 @@ public class AppYsV2 extends Spider {
|
|||
ArrayList<String> 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<String, JSONObject> 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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue