use of ar.rulosoft.mimanganu.componentes.Chapter in project MiMangaNu by raulhaag.
the class KissManga method loadMangaInformation.
@Override
public void loadMangaInformation(Manga manga, boolean forceReload) throws Exception {
if (manga.getChapters().isEmpty() || forceReload) {
String source = getNavigatorAndFlushParameters().get(HOST + manga.getPath());
// Summary
manga.setSynopsis(getFirstMatchDefault("<span " + "class=\"info\">Summary:</span>(.+?)</div>", source, context.getString(R.string.nodisponible)));
// Cover Image
manga.setImages(getFirstMatchDefault("rel=\"image_src\" href=\"(.+?)" + "\"", source, ""));
// Author
manga.setAuthor(getFirstMatchDefault("Author:</span> (.+?)</p>", source, context.getString(R.string.nodisponible)));
// Genre
manga.setGenre(getFirstMatchDefault("Genres:</span> (.+?)</p>", source, context.getString(R.string.nodisponible)));
// Status
manga.setFinished(source.contains("Status:</span> Completed"));
// Chapter
Pattern p = Pattern.compile(PATTERN_CHAPTER, Pattern.DOTALL);
Matcher matcher = p.matcher(source);
while (matcher.find()) {
manga.addChapterFirst(new Chapter(matcher.group(2).replace(" Read Online", ""), matcher.group(1)));
}
}
}
use of ar.rulosoft.mimanganu.componentes.Chapter in project MiMangaNu by raulhaag.
the class LeoManga method loadMangaInformation.
@Override
public void loadMangaInformation(Manga manga, boolean forceReload) throws Exception {
if (manga.getChapters().isEmpty() || forceReload) {
String data = getNavigatorAndFlushParameters().get(manga.getPath());
// Summary
manga.setSynopsis(getFirstMatchDefault("<p class=\"text-justify\">(.+?)</p>", data, context.getString(R.string.nodisponible)));
// Cover
String image = getFirstMatchDefault("<img data-original=\"(.+?)\"", data, "");
if (image.length() > 4) {
manga.setImages(HOST + image);
} else {
manga.setImages("");
}
// Author
manga.setAuthor(getFirstMatchDefault("<a href=\"/autor.+?\">(.+?)<", data, context.getString(R.string.nodisponible)));
// Genre
manga.setGenre(getFirstMatchDefault("GĂ©neros:.+?</div>(.+?)</div>", data, context.getString(R.string.nodisponible)));
// Status
manga.setFinished(getFirstMatchDefault("-state\">(.+?)</div>", data, "").contains("Finalizado"));
// Chapters
Pattern pattern = Pattern.compile("<li>[\\s]*<a href=\"(/manga/.+?)\">(.+?)</a>", Pattern.DOTALL);
Matcher matcher = pattern.matcher(data);
while (matcher.find()) {
manga.addChapterFirst(new Chapter(matcher.group(2), HOST + matcher.group(1)));
}
}
}
Aggregations