add - douban yiso

This commit is contained in:
yangqiang3504
2022-09-14 10:16:58 +08:00
parent 346c5accb5
commit e5942f3294
4 changed files with 9 additions and 22 deletions
@@ -125,7 +125,7 @@ public class PushAgent extends Spider {
return callback.getResult(); return callback.getResult();
} }
private static void getRefreshTk() { public static void getRefreshTk() {
long timeSys = Time(); long timeSys = Time();
if (accessToken.isEmpty() || timeToken - timeSys <= 600) { if (accessToken.isEmpty() || timeToken - timeSys <= 600) {
try { try {
@@ -793,6 +793,7 @@ public class PushAgent extends Spider {
} else result.put("header", Misc.jHeaders(Misc.type,id).toString()); } else result.put("header", Misc.jHeaders(Misc.type,id).toString());
return result.toString(); return result.toString();
} }
case "magnet":
case "player": { case "player": {
result.put("parse", 0); result.put("parse", 0);
result.put("playUrl", ""); result.put("playUrl", "");
@@ -801,7 +802,6 @@ public class PushAgent extends Spider {
return result.toString(); return result.toString();
} }
case "AliYun": case "AliYun":
getRefreshTk();
String[] split = id.split("\\+"); String[] split = id.split("\\+");
String str3 = split[0]; String str3 = split[0];
String str5 = split[2]; String str5 = split[2];
@@ -133,10 +133,6 @@ public class PushAgentQQ extends Spider {
Misc.jsonUrl = extend; Misc.jsonUrl = extend;
} }
} }
if (Misc.pushAgent == null) {
Misc.pushAgent = new PushAgent();
Misc.pushAgent.init(context, extend);
}
} }
@@ -273,13 +269,13 @@ public class PushAgentQQ extends Spider {
@Override @Override
public String detailContent(List<String> list) { public String detailContent(List<String> list) {
return Misc.pushAgent.getDetail(list); return PushAgent.getDetail(list);
} }
@Override @Override
public String playerContent(String str, String str2, List<String> list) { public String playerContent(String str, String str2, List<String> list) {
return Misc.pushAgent.player(str, str2, list); return PushAgent.player(str, str2, list);
} }
@Override @Override
@@ -17,16 +17,12 @@ public class Upyunso extends Spider {
@Override @Override
public void init(Context context, String extend) { public void init(Context context, String extend) {
super.init(context, extend); super.init(context, extend);
if (Misc.pushAgent == null) {
Misc.pushAgent = new PushAgent();
Misc.pushAgent.init(context, extend);
}
} }
@Override @Override
public String detailContent(List<String> list) { public String detailContent(List<String> list) {
try { try {
return Misc.pushAgent.getDetail(list); return PushAgent.getDetail(list);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return ""; return "";
@@ -42,7 +38,7 @@ public class Upyunso extends Spider {
@Override @Override
public String playerContent(String str, String str2, List<String> list) { public String playerContent(String str, String str2, List<String> list) {
return Misc.pushAgent.player(str, str2, list); return PushAgent.player(str, str2, list);
} }
@Override @Override
@@ -20,16 +20,12 @@ public class Yiso extends Spider {
@Override @Override
public void init(Context context, String extend) { public void init(Context context, String extend) {
super.init(context); super.init(context);
if (Misc.pushAgent == null) {
Misc.pushAgent = new PushAgent();
Misc.pushAgent.init(context, extend);
}
} }
@Override @Override
public String detailContent(List<String> list) { public String detailContent(List<String> list) {
try { try {
return Misc.pushAgent.getDetail(list); return PushAgent.getDetail(list);
} catch (Exception e) { } catch (Exception e) {
SpiderDebug.log(e); SpiderDebug.log(e);
} }
@@ -37,7 +33,7 @@ public class Yiso extends Spider {
} }
public String playerContent(String str, String str2, List<String> list) { public String playerContent(String str, String str2, List<String> list) {
return Misc.pushAgent.player(str, str2, list); return PushAgent.player(str, str2, list);
} }
protected static HashMap<String, String> sHeaders() { protected static HashMap<String, String> sHeaders() {
@@ -52,7 +48,7 @@ public class Yiso extends Spider {
@Override @Override
public String searchContent(String key, boolean quick) { public String searchContent(String key, boolean quick) {
try { try {
HashMap hashMap = new HashMap(); PushAgent.getRefreshTk();
HashMap<String, String> LT = sHeaders(); HashMap<String, String> LT = sHeaders();
String url = "https://yiso.fun/api/search?name=" + URLEncoder.encode(key) + "&from=ali"; String url = "https://yiso.fun/api/search?name=" + URLEncoder.encode(key) + "&from=ali";
@@ -62,7 +58,6 @@ public class Yiso extends Spider {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
JSONArray videos = new JSONArray(); JSONArray videos = new JSONArray();
for (int i = 0; i < list.length(); i++) { for (int i = 0; i < list.length(); i++) {
JSONObject jSONObject = list.getJSONObject(i); JSONObject jSONObject = list.getJSONObject(i);
String sourceName = jSONObject.getJSONArray("fileInfos").getJSONObject(0).getString("fileName"); String sourceName = jSONObject.getJSONArray("fileInfos").getJSONObject(0).getString("fileName");