|
|
|
|
@ -639,8 +639,12 @@ public class ApiConfig { |
|
|
|
|
bReader.close(); |
|
|
|
|
parseLiveJson(apiUrl, sb.toString()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private String liveSpider=""; |
|
|
|
|
private void parseLiveJson(String apiUrl, String jsonStr) { |
|
|
|
|
JsonObject infoJson = gson.fromJson(jsonStr, JsonObject.class); |
|
|
|
|
// spider
|
|
|
|
|
liveSpider = DefaultConfig.safeJsonString(infoJson, "spider", ""); |
|
|
|
|
// 直播源
|
|
|
|
|
initLiveSettings(); |
|
|
|
|
if(infoJson.has("lives")){ |
|
|
|
|
@ -789,7 +793,7 @@ public class ApiConfig { |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
String type= livesOBJ.get("type").getAsString(); |
|
|
|
|
if(type.equals("0")){ |
|
|
|
|
if(type.equals("0") || type.equals("3")){ |
|
|
|
|
url = livesOBJ.get("url").getAsString(); |
|
|
|
|
if(!url.startsWith("http://127.0.0.1")){ |
|
|
|
|
if(url.startsWith("http")){ |
|
|
|
|
@ -797,6 +801,14 @@ public class ApiConfig { |
|
|
|
|
} |
|
|
|
|
url ="http://127.0.0.1:9978/proxy?do=live&type=txt&ext="+url; |
|
|
|
|
} |
|
|
|
|
if(type.equals("3")){ |
|
|
|
|
String jarUrl = livesOBJ.get("jar").getAsString().trim(); |
|
|
|
|
if(!jarUrl.isEmpty()){ |
|
|
|
|
jarLoader.loadLiveJar(jarUrl); |
|
|
|
|
}else if(!liveSpider.isEmpty()){ |
|
|
|
|
jarLoader.loadLiveJar(liveSpider); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
LOG.i("echo-live-proxy-url:"+url); |
|
|
|
|
}else { |
|
|
|
|
return; |
|
|
|
|
@ -830,6 +842,12 @@ public class ApiConfig { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setLiveJar(String liveJar) |
|
|
|
|
{ |
|
|
|
|
String jarUrl=!liveJar.isEmpty()?liveJar:liveSpider; |
|
|
|
|
jarLoader.setRecentJarKey(MD5.string2MD5(jarUrl)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getSpider() { |
|
|
|
|
return spider; |
|
|
|
|
} |
|
|
|
|
|