use of ar.rulosoft.mimanganu.componentes.Chapter in project MiMangaNu by raulhaag.
the class MangaRawOnline method loadMangaInformation.
@Override
public void loadMangaInformation(Manga manga, boolean forceReload) throws Exception {
if (manga.getChapters().isEmpty() || forceReload) {
String data = getNavigatorAndFlushParameters().get(HOST + manga.getPath());
manga.setSynopsis(getFirstMatchDefault("<h5><strong>Summary</strong></h5>\\s*<p>(.+?)</p>", data, context.getString(R.string.nodisponible)));
manga.setAuthor(getFirstMatchDefault("<dt>Author\\(s\\)</dt>\\s+<dd>([\\s\\S]+?)</dd>", data, context.getString(R.string.nodisponible)).replaceAll(" <a href=\".+?\">(.+?)</a>", "$1,"));
if (data.contains("<span class=\"label label-success\">Ongoing</span>")) {
manga.setFinished(false);
} else {
manga.setFinished(true);
}
manga.setGenre(getFirstMatchDefault("<dt>Categories</dt>\\s+<dd>([\\s\\S]+?)</dd>", data, context.getString(R.string.nodisponible)).replaceAll(" <a href=\".+?\">(.+?)</a>", "$1"));
manga.setImages(getFirstMatchDefault("class=\"img-responsive\" src='(.+?)'", data, ""));
// chapter
Pattern p = Pattern.compile("<h5 class=\"chapter-title-rtl\">\\s*<a href=\"https?://mangaraw.online(.+?)\">(.+?)<", Pattern.DOTALL);
Matcher m = p.matcher(data);
while (m.find()) {
manga.addChapterFirst(new Chapter(m.group(2), m.group(1)));
}
}
}
use of ar.rulosoft.mimanganu.componentes.Chapter in project MiMangaNu by raulhaag.
the class Mangapedia method loadMangaInformation.
@Override
public void loadMangaInformation(Manga manga, boolean forceReload) throws Exception {
if (manga.getChapters().isEmpty() || forceReload) {
String data = getNavigatorAndFlushParameters().get(manga.getPath());
// Cover
if (manga.getImages() == null) {
manga.setImages(getFirstMatchDefault("<div id=\"mangaImage\">\\s*<img src=\"([^\"]+)\"", data, "") + "|" + HOST + "/mangas/");
}
// Author
manga.setAuthor(getFirstMatchDefault("Auteur : (.+?)</div>", data, context.getString(R.string.nodisponible)));
// Genre
manga.setGenre(getFirstMatchDefault("Sous-genres : (.+?)<\\/div>", data, context.getString(R.string.nodisponible)));
// Summary
manga.setSynopsis(getFirstMatchDefault("Synopsis : (.+?)<\\/div>", data, context.getString(R.string.nodisponible)));
// Status
manga.setFinished(!getFirstMatchDefault("Statut : (.+?)<\\/div>", data, "en cours").contains("en cours"));
// Chapters
Pattern pattern = Pattern.compile("<a href=\"(http[s]*://mangapedia.fr/lel[^\"]+).+?\"nameChapter\">(.+?)<", Pattern.DOTALL);
Matcher matcher = pattern.matcher(data);
while (matcher.find()) {
manga.addChapterFirst(new Chapter(matcher.group(2), matcher.group(1)));
}
}
}
use of ar.rulosoft.mimanganu.componentes.Chapter in project MiMangaNu by raulhaag.
the class BatoTo method loadMangaInformation.
@Override
public void loadMangaInformation(Manga manga, boolean forceReload) throws Exception {
try {
if (manga.getChapters().size() == 0 || forceReload) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
String user = prefs.getString("username_" + getServerName(), "");
String password = prefs.getString("dwp_" + getServerName(), "");
String data = getNavigatorAndFlushParameters().get(manga.getPath(), new BatotoLoginInterceptor(user, password));
String synopsis = getFirstMatchDefault("Description:</td>\\s+<td>(.*?)</td>", data, context.getString(R.string.nodisponible));
manga.setSynopsis(Util.getInstance().fromHtml(synopsis).toString());
manga.setImages(HOST + getFirstMatchDefault("(\\/forums\\/upload.+?)\"", data, ""));
if (manga.getImages().equals(HOST))
manga.setImages("");
manga.setAuthor(getFirstMatchDefault("search\\?artist_name=.+?>([^<]+)", data, "n/a"));
manga.setGenre(getFirstMatchDefault("Genres:</td>\\s+<td>([\\s\\S]+?)<img[^>]+?alt=.edit", data, "").replaceAll("<.*?>", "").replaceAll(",[\\s]*", ",").trim());
manga.setFinished(!getFirstMatchDefault("Status:<\\/td>\\s+<td>([^<]+)", data, "").contains("Ongoing"));
ArrayList<Chapter> chapters = new ArrayList<>();
Pattern pattern = Pattern.compile("<a href=\"([^\"]+)\" title=\"[^\"]+\">.+?>([^<]+).+?title=\"(.+?)\".+?<a[^>]+>([^<]+)", Pattern.DOTALL);
data = getFirstMatchDefault("ipb_table chapters_list\"([\\s\\S]+?)</table", data, "");
Matcher matcher = pattern.matcher(data);
String lang_selection, lang = "";
lang_selection = prefs.getString("batoto_lang_selection", "Automatic");
if (lang_selection.equals("Automatic"))
lang = Locale.getDefault().getDisplayLanguage(new Locale("eng"));
else if (lang_selection.equals("Custom"))
lang = prefs.getString("batoto_custom_lang", "");
else
lang = lang_selection;
while (matcher.find()) {
if (!lang_selection.equals("All") && !lang.isEmpty()) {
if (matcher.group(3).contains(lang))
chapters.add(0, new Chapter("(" + matcher.group(3) + ") " + matcher.group(2) + " [" + matcher.group(4) + "]", matcher.group(1)));
} else if (lang_selection.equals("All"))
chapters.add(0, new Chapter("(" + matcher.group(3) + ") " + matcher.group(2) + " [" + matcher.group(4) + "]", matcher.group(1)));
}
manga.setChapters(chapters);
}
} catch (Exception e) {
e.printStackTrace();
}
}
use of ar.rulosoft.mimanganu.componentes.Chapter in project MiMangaNu by raulhaag.
the class BatoToEs method loadMangaInformation.
@Override
public void loadMangaInformation(Manga manga, boolean forceReload) throws Exception {
if (manga.getChapters().isEmpty() || forceReload) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
String user = prefs.getString("username_" + getServerName(), "");
String password = prefs.getString("dwp_" + getServerName(), "");
String data = getNavigatorAndFlushParameters().get(manga.getPath(), new BatotoLoginInterceptor(user, password));
// Summary
manga.setSynopsis(getFirstMatchDefault("Description:</td>\\s+<td>(.*?)</td>", data, context.getString(R.string.nodisponible)));
// Cover
manga.setImages(HOST + getFirstMatchDefault("<img src=\"(/forums/upload.+?)\"", data, ""));
if (manga.getImages().equals(HOST))
manga.setImages("");
// Author
manga.setAuthor(getFirstMatchDefault("search\\?artist_name=.+?>([^<]+)", data, context.getString(R.string.nodisponible)));
// Genre
manga.setGenre(getFirstMatchDefault("Genres:</td>\\s+<td>([\\s\\S]+?)<img[^>]+?alt=.edit", data, context.getString(R.string.nodisponible)));
// Status
manga.setFinished(!getFirstMatchDefault("Status:<\\/td>\\s+<td>([^<]+)", data, "").contains("Ongoing"));
// Chapters
Pattern pattern = Pattern.compile("<a href=\"([^\"]+)\" title=\"[^\"]+\">.+?>([^<]+).+?title=\"(.+?)\".+?<a[^>]+>([^<]+)", Pattern.DOTALL);
data = getFirstMatchDefault("ipb_table chapters_list\"([\\s\\S]+?)</table", data, "");
Matcher matcher = pattern.matcher(data);
String lang = "Spanish";
while (matcher.find()) {
if (matcher.group(3).contains(lang)) {
manga.addChapterFirst(new Chapter("(" + matcher.group(3) + ") " + matcher.group(2) + " [" + matcher.group(4) + "]", matcher.group(1)));
}
}
}
}
use of ar.rulosoft.mimanganu.componentes.Chapter in project MiMangaNu by raulhaag.
the class DesuMe method loadMangaInformation.
@Override
public void loadMangaInformation(Manga manga, boolean forceReload) throws Exception {
if (manga.getChapters().isEmpty() || forceReload) {
String data = getNavigatorAndFlushParameters().get(HOST + manga.getPath());
// cover image
manga.setImages(HOST + getFirstMatchDefault("src=\"(/data/manga/covers/[^\"]+)", data, ""));
// summary
manga.setSynopsis(getFirstMatchDefault("class=\"prgrph\">([^<]+)", data, context.getString(R.string.nodisponible)));
// ongoing or completed
manga.setFinished(!data.contains("b-anime_status_tag ongoing"));
// author - n/a
manga.setAuthor(context.getString(R.string.nodisponible));
// genre
manga.setGenre(getFirstMatchDefault("(<a class=\"tag Tooltip\".+?)</ul>", data, context.getString(R.string.nodisponible)).replace("</li> <li>", ", "));
// chapter
Pattern p = Pattern.compile("<h4><a href=\"(/manga/[^\"]+).+?title=\"([^\"]+)", Pattern.DOTALL);
Matcher m = p.matcher(data);
while (m.find()) {
// remove 'volume' to ease sorting after chapters
String title = m.group(2).replaceFirst("^Том \\d+.\\s+", "");
manga.addChapterFirst(new Chapter(title, m.group(1)));
}
}
}
Aggregations