use of ar.rulosoft.navegadores.Navigator in project MiMangaNu by raulhaag.
the class MangaKawaii method search.
@Override
public ArrayList<Manga> search(String search) throws Exception {
Navigator nav = getNavigatorAndFlushParameters();
String data = nav.get("https://www.mangakawaii.com/recherche?query=" + URLEncoder.encode(search, "UTF-8"));
JSONArray array = new JSONObject(data).getJSONArray("suggestions");
ArrayList<Manga> mangas = new ArrayList<>();
for (int i = 0, n = array.length(); i < n; i++) {
mangas.add(new Manga(getServerID(), array.getJSONObject(i).getString("value"), "https://www.mangakawaii.com/manga/" + array.getJSONObject(i).getString("data"), false));
}
return mangas;
}
use of ar.rulosoft.navegadores.Navigator in project MiMangaNu by raulhaag.
the class MyMangaIo method getMangasFiltered.
@Override
public ArrayList<Manga> getMangasFiltered(int[][] filters, int pageNumber) throws Exception {
String web = HOST + "/search?name=&author=&illustrator=&parution_span=0&parution=";
for (int i = 0; i < filters[0].length; i++) {
web = web + valDemographic[filters[0][i]];
}
for (int i = 0; i < filters[1].length; i++) {
web = web + valStatus[filters[1][i]];
}
for (int i = 0; i < filters[2].length; i++) {
web = web + valType[filters[2][i]];
}
for (int i = 0; i < filters[3].length; i++) {
web = web + valGenre[filters[3][i]];
}
Navigator nav = getNavigatorWithNeededHeader();
web = web + "&chapter_span=0&chapter_count=&last_update=&like_span=0&like=&dislike_span=0&dislike=&search=Rechercher";
String source = nav.get(web);
return getMangasFromSource(source);
}
use of ar.rulosoft.navegadores.Navigator in project MiMangaNu by raulhaag.
the class KissManga method getMangasFiltered.
@Override
public ArrayList<Manga> getMangasFiltered(int[][] filters, int pageNumber) throws Exception {
Navigator nav = getNavigatorAndFlushParameters();
String source;
// do not hide Doujinshi in result
nav.addHeader("Cookie", "vns_doujinshi=1; ");
// no filtering is active - use MangaList (much faster as it is smaller)
if ((filters[0].length + filters[1].length + filters[2][0]) == 0) {
String web = HOST + "/MangaList" + valOrder[filters[3][0]] + "?page=" + pageNumber;
source = nav.get(web);
} else // filtering is active, use advanced search (slow, as the whole result set is returned)
{
if (pageNumber > 1) {
// there is only one result page for the advanced search
return new ArrayList<>();
} else {
nav.addPost("mangaName", "");
nav.addPost("authorArtist", "");
for (int i = 0; i < fltGenre.length; i++) {
int result = 0;
if (Util.getInstance().contains(filters[0], i)) {
result++;
}
if (Util.getInstance().contains(filters[1], i)) {
result--;
}
// map exclude to "2"
if (result < 0) {
result = 2;
}
nav.addPost("genres", Integer.toString(result));
}
nav.addPost("status", valStatus[filters[2][0]]);
source = nav.post(HOST + "/AdvanceSearch");
}
}
return getMangasSource(source);
}
use of ar.rulosoft.navegadores.Navigator in project MiMangaNu by raulhaag.
the class Kumanga method search.
@Override
public ArrayList<Manga> search(String term) throws Exception {
Navigator nav = getNavigatorAndFlushParameters();
String web = "contentType=manga&page=1&perPage=30&keywords=";
web += URLEncoder.encode(term, "UTF-8");
web += "&retrieveCategories=true&retrieveAuthors=true";
nav.addHeader("Accept-Language", "es-AR,es;q=0.8,en-US;q=0.5,en;q=0.3");
nav.addHeader("Accept-Encoding", "deflate");
nav.addHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
nav.addHeader("X-Requested-With", "XMLHttpRequest");
RequestBody body = RequestBody.create(MediaType.parse("application/x-www-form-urlencoded; charset=UTF-8"), web);
String data = nav.post(HOST + "/backend/ajax/searchengine.php", body);
return getMangasFromJson(new JSONObject(data));
}
use of ar.rulosoft.navegadores.Navigator in project MiMangaNu by raulhaag.
the class ImageLoader method getBitmap.
private Bitmap getBitmap(String url) {
File f = mFileCache.getFile(url);
// Second, try to get image from local storage, i.e. SD card
Bitmap imgFile = decodeFile(f);
if (imgFile != null)
return imgFile;
try {
if (url.indexOf("|") > 0) {
Navigator nav = Navigator.getInstance();
String[] parts = url.split("\\|");
nav.addHeader("Referer", parts[1]);
FileCache.writeFile(nav.getStream(parts[0]), f);
} else if (url.startsWith("/")) {
// FromFolder sets url as an absolute local path, so load file directly
InputStream is;
is = new FileInputStream(url);
FileCache.writeFile(is, f);
is.close();
} else {
FileCache.writeFile(Navigator.getInstance().getStream(url), f);
}
return decodeFile(f);
} catch (Throwable ex) {
if (ex instanceof OutOfMemoryError)
mMemCache.clearMem();
return null;
}
}
Aggregations