MCPcopy Create free account
hub / github.com/FongMi/TV / getJson

Method getJson

app/src/main/java/com/fongmi/android/tv/api/Decoder.java:25–32  ·  view source on GitHub ↗
(String url, String tag)

Source from the content-addressed store, hash-verified

23 private static final Pattern JS_URI = Pattern.compile("\"(\\.|\\.\\.)/(.?|.+?)\\.js\\?(.?|.+?)\"");
24
25 public static String getJson(String url, String tag) throws Exception {
26 try (Response res = OkHttp.newCall(url, tag).execute()) {
27 HttpUrl httpUrl = res.request().url();
28 int size = HttpUrl.parse(url).querySize();
29 if (httpUrl.querySize() == size) url = httpUrl.toString();
30 return verify(url, res.body().string());
31 }
32 }
33
34 private static String verify(String url, String data) throws Exception {
35 if (data.isEmpty()) throw new Exception();

Callers 2

loadMethod · 0.95
loadMethod · 0.95

Calls 9

newCallMethod · 0.95
verifyMethod · 0.95
requestMethod · 0.80
stringMethod · 0.80
bodyMethod · 0.80
executeMethod · 0.45
urlMethod · 0.45
parseMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected