@Test public void getsCorrectVideoUrl() { String document=null; String correctURL="http: try { document = getDocument("episode.html"); } catch (IOException e) { fail("Could not load html test file"); } assertThat(SiteTools.getVideoURL(document).equals(correctURL),is(true)); }
public static String getVideoURL(String response) { String js = ""; Document document = Jsoup.parse(response); Element divElement = document.getElementById("Movie"); for (Element javascript : divElement.children()) { if (javascript.tagName().equals("script")) { js = javascript.html(); } } int firstIndex = js.indexOf("\"", js.indexOf("file")); int secondIndex = js.indexOf("\"", firstIndex + 1); String result = js.substring(firstIndex + 1, secondIndex); return result; }
SiteTools { public static String getVideoURL(String response) { String js = ""; Document document = Jsoup.parse(response); Element divElement = document.getElementById("Movie"); for (Element javascript : divElement.children()) { if (javascript.tagName().equals("script")) { js = javascript.html(); } } int firstIndex = js.indexOf("\"", js.indexOf("file")); int secondIndex = js.indexOf("\"", firstIndex + 1); String result = js.substring(firstIndex + 1, secondIndex); return result; } }
SiteTools { public static String getVideoURL(String response) { String js = ""; Document document = Jsoup.parse(response); Element divElement = document.getElementById("Movie"); for (Element javascript : divElement.children()) { if (javascript.tagName().equals("script")) { js = javascript.html(); } } int firstIndex = js.indexOf("\"", js.indexOf("file")); int secondIndex = js.indexOf("\"", firstIndex + 1); String result = js.substring(firstIndex + 1, secondIndex); return result; }  }
SiteTools { public static String getVideoURL(String response) { String js = ""; Document document = Jsoup.parse(response); Element divElement = document.getElementById("Movie"); for (Element javascript : divElement.children()) { if (javascript.tagName().equals("script")) { js = javascript.html(); } } int firstIndex = js.indexOf("\"", js.indexOf("file")); int secondIndex = js.indexOf("\"", firstIndex + 1); String result = js.substring(firstIndex + 1, secondIndex); return result; }  static List<List<String>> getAnimeList(String response); static List<List<String>> getOngoingAnimeList(String string_document); static List<List<String>> getGenreList(String response); static Element getAnimeByGenreElement(String url, String genre, int page); static List<List<String>> getAnimeByGenre(String url); static List<List<String>> getAnimeByGenreElementParse(Element div); static List<List<String>> getAlternateEpisodeLinks(String response); static String getVideoURL(String response); }
SiteTools { public static String getVideoURL(String response) { String js = ""; Document document = Jsoup.parse(response); Element divElement = document.getElementById("Movie"); for (Element javascript : divElement.children()) { if (javascript.tagName().equals("script")) { js = javascript.html(); } } int firstIndex = js.indexOf("\"", js.indexOf("file")); int secondIndex = js.indexOf("\"", firstIndex + 1); String result = js.substring(firstIndex + 1, secondIndex); return result; }  static List<List<String>> getAnimeList(String response); static List<List<String>> getOngoingAnimeList(String string_document); static List<List<String>> getGenreList(String response); static Element getAnimeByGenreElement(String url, String genre, int page); static List<List<String>> getAnimeByGenre(String url); static List<List<String>> getAnimeByGenreElementParse(Element div); static List<List<String>> getAlternateEpisodeLinks(String response); static String getVideoURL(String response);  }