|
|
|
|
@ -33,9 +33,9 @@ public class LiveParser { |
|
|
|
|
|
|
|
|
|
public static void start(Live live) { |
|
|
|
|
if (live.getGroups().size() > 0) return; |
|
|
|
|
if (live.getType() == 0) text(live, getText(live.getUrl())); |
|
|
|
|
if (live.getType() == 1) json(live, getText(live.getUrl())); |
|
|
|
|
if (live.getType() == 2) proxy(live, getText(live.getUrl())); |
|
|
|
|
if (live.getType() == 0) text(live, getText(live.getUrl(), live.getHeaders())); |
|
|
|
|
if (live.getType() == 1) json(live, getText(live.getUrl(), live.getHeaders())); |
|
|
|
|
if (live.getType() == 2) proxy(live, getText(live.getUrl(), live.getHeaders())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void text(Live live, String text) { |
|
|
|
|
@ -110,11 +110,11 @@ public class LiveParser { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static String getText(String url) { |
|
|
|
|
private static String getText(String url, Map<String, String> header) { |
|
|
|
|
if (url.startsWith("file")) return Path.read(url); |
|
|
|
|
if (url.startsWith("http")) return OkHttp.string(url); |
|
|
|
|
if (url.startsWith("assets") || url.startsWith("clan") || url.startsWith("proxy")) return getText(UrlUtil.convert(url)); |
|
|
|
|
if (url.length() > 0 && url.length() % 4 == 0) return getText(new String(Base64.decode(url, Base64.DEFAULT))); |
|
|
|
|
if (url.startsWith("http")) return OkHttp.string(url, header); |
|
|
|
|
if (url.startsWith("assets") || url.startsWith("clan") || url.startsWith("proxy")) return getText(UrlUtil.convert(url), header); |
|
|
|
|
if (url.length() > 0 && url.length() % 4 == 0) return getText(new String(Base64.decode(url, Base64.DEFAULT)), header); |
|
|
|
|
return ""; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|