Search in sources :

Example 11 with Navigator

use of ar.rulosoft.navegadores.Navigator in project MiMangaNu by raulhaag.

the class NineManga method getImageFrom.

@Override
public String getImageFrom(Chapter chapter, int page) throws Exception {
    Navigator nav = getNavigatorWithNeededHeader();
    if (page == 1)
        nav.addHeader("Referer", HOST + chapter.getPath());
    else
        nav.addHeader("Referer", HOST + chapter.getPath().replace(".html", "-" + (page - 1) + ".html"));
    String data = nav.get(HOST + chapter.getPath().replace(".html", "-" + page + ".html"));
    data = getFirstMatch(PATTERN_IMAGE, data, context.getString(R.string.server_failed_loading_image));
    if (data.contains("////")) {
        throw new Exception(context.getString(R.string.server_failed_loading_image));
    }
    return data;
}
Also used : Navigator(ar.rulosoft.navegadores.Navigator)

Example 12 with Navigator

use of ar.rulosoft.navegadores.Navigator in project MiMangaNu by raulhaag.

the class ReadMangaMe method search.

@Override
public ArrayList<Manga> search(String term) throws Exception {
    Navigator nav = getNavigatorAndFlushParameters();
    nav.addPost("q", term);
    String data = nav.post(HOST + "/search");
    return getMangasFromSource(data);
}
Also used : Navigator(ar.rulosoft.navegadores.Navigator)

Example 13 with Navigator

use of ar.rulosoft.navegadores.Navigator in project MiMangaNu by raulhaag.

the class ReadMangaToday method search.

@Override
public ArrayList<Manga> search(String term) throws Exception {
    ArrayList<Manga> mangas = new ArrayList<>();
    Navigator nav = getNavigatorAndFlushParameters();
    nav.addHeader("x-requested-with", "XMLHttpRequest");
    String data = getNavigatorAndFlushParameters().get(HOST + "/service/search?q=" + term.toLowerCase());
    if (!data.equals("false")) {
        JSONArray arr = new JSONArray(data);
        for (int i = 0; i < arr.length(); i++) {
            JSONObject m = arr.getJSONObject(i);
            Manga manga = new Manga(getServerID(), m.getString("title"), m.getString("url"), false);
            mangas.add(manga);
        }
    }
    return mangas;
}
Also used : JSONObject(org.json.JSONObject) Navigator(ar.rulosoft.navegadores.Navigator) ArrayList(java.util.ArrayList) JSONArray(org.json.JSONArray) Manga(ar.rulosoft.mimanganu.componentes.Manga)

Example 14 with Navigator

use of ar.rulosoft.navegadores.Navigator in project MiMangaNu by raulhaag.

the class Taadd method getImageFrom.

@Override
public String getImageFrom(Chapter chapter, int page) throws Exception {
    Navigator nav = getNavigatorAndFlushParameters();
    nav.addHeader("Referer", chapter.getPath());
    String source = nav.get(chapter.getPath() + "-" + page + ".html");
    return getFirstMatch("src=\"(http[s]?://pic\\.taadd\\.com/comics/[^\"]+?|http[s]?://pic\\d+\\.taadd\\.com/comics/[^\"]+?)\"", source, context.getString(R.string.server_failed_loading_image));
}
Also used : Navigator(ar.rulosoft.navegadores.Navigator)

Example 15 with Navigator

use of ar.rulosoft.navegadores.Navigator in project MiMangaNu by raulhaag.

the class TuMangaOnline method getNavWithNeededHeaders.

private Navigator getNavWithNeededHeaders() {
    Navigator nav = getNavigatorAndFlushParameters();
    nav.addHeader("Cache-mode", "no-cache");
    nav.addHeader("Referer", "https://www.tumangaonline.com/biblioteca");
    return nav;
}
Also used : Navigator(ar.rulosoft.navegadores.Navigator)

Aggregations

Navigator (ar.rulosoft.navegadores.Navigator)21 ArrayList (java.util.ArrayList)6 JSONObject (org.json.JSONObject)6 Manga (ar.rulosoft.mimanganu.componentes.Manga)5 Matcher (java.util.regex.Matcher)2 Pattern (java.util.regex.Pattern)2 RequestBody (okhttp3.RequestBody)2 JSONArray (org.json.JSONArray)2 JSONException (org.json.JSONException)2 Bitmap (android.graphics.Bitmap)1 LargeTest (android.support.test.filters.LargeTest)1 Chapter (ar.rulosoft.mimanganu.componentes.Chapter)1 VolatileCookieJar (ar.rulosoft.navegadores.VolatileCookieJar)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 InputStream (java.io.InputStream)1 Cookie (okhttp3.Cookie)1 CookieJar (okhttp3.CookieJar)1 MultipartBody (okhttp3.MultipartBody)1 Test (org.junit.Test)1