Search in sources :

Example 16 with Chapter

use of ar.rulosoft.mimanganu.componentes.Chapter in project MiMangaNu by raulhaag.

the class HeavenManga method loadMangaInformation.

@Override
public void loadMangaInformation(Manga manga, boolean forceReload) throws Exception {
    String source = getNavigatorAndFlushParameters().get(manga.getPath());
    // portada
    manga.setImages(getFirstMatchDefault("<meta property=\"og:image\" content=\"(.+?)\"", source, ""));
    // sinopsis
    manga.setSynopsis(getFirstMatchDefault("<div class=\"sinopsis\">(.+?)<div", source, context.getString(R.string.nodisponible)));
    // estado no soportado
    // autor no soportado
    manga.setAuthor(context.getString(R.string.nodisponible));
    // genero
    manga.setGenre(getFirstMatchDefault("nero\\(s\\) :(.+?)</div>", source, context.getString(R.string.nodisponible)));
    // capitulos
    Pattern p = Pattern.compile("<li><span class=\"capfec\">.+?><a href=\"(http://heavenmanga.com/.+?)\" title=\"(.+?)\"", Pattern.DOTALL);
    Matcher matcher = p.matcher(source);
    while (matcher.find()) {
        manga.addChapterFirst(new Chapter(matcher.group(2), matcher.group(1)));
    }
    if (manga.getChapters().isEmpty()) {
        throw new Exception(context.getString(R.string.server_failed_loading_chapter));
    }
}
Also used : Pattern(java.util.regex.Pattern) Matcher(java.util.regex.Matcher) Chapter(ar.rulosoft.mimanganu.componentes.Chapter)

Example 17 with Chapter

use of ar.rulosoft.mimanganu.componentes.Chapter in project MiMangaNu by raulhaag.

the class JapScan method loadMangaInformation.

@Override
public void loadMangaInformation(Manga manga, boolean forceReload) throws Exception {
    if (manga.getChapters().isEmpty() || forceReload) {
        String source = getNavigatorAndFlushParameters().get(manga.getPath());
        // Cover Image
        // JapScan has no cover images ...
        manga.setImages("");
        // Summary
        manga.setSynopsis(getFirstMatchDefault("<div id=\"synopsis\">(.+?)</div>", source, context.getString(R.string.nodisponible)));
        // Status
        manga.setFinished(!getFirstMatchDefault("<div class=\"row\">.+?<div class=\"cell\">.+?<div class=\"cell\">.+?<div class=\"cell\">.+?<div class=\"cell\">.+?<div class=\"cell\">(.+?)</div>", source, "").contains("En Cours"));
        // Author
        manga.setAuthor(getFirstMatchDefault("<div class=\"row\">(.+?)</div>", source, context.getString(R.string.nodisponible)));
        // Genres
        manga.setGenre(getFirstMatchDefault("<div class=\"row\">.+?<div class=\"cell\">.+?<div class=\"cell\">.+?<div class=\"cell\">(.+?)</div>", source, context.getString(R.string.nodisponible)));
        // Chapters
        Pattern pattern = Pattern.compile("<a href=\"(//www\\.japscan\\.cc/lecture-en-ligne/[^\"]+?)\">(Scan.+?)</a>", Pattern.DOTALL);
        Matcher matcher = pattern.matcher(source);
        while (matcher.find()) {
            manga.addChapterFirst(new Chapter(matcher.group(2), "http:" + matcher.group(1)));
        }
    }
}
Also used : Pattern(java.util.regex.Pattern) Matcher(java.util.regex.Matcher) Chapter(ar.rulosoft.mimanganu.componentes.Chapter)

Example 18 with Chapter

use of ar.rulosoft.mimanganu.componentes.Chapter in project MiMangaNu by raulhaag.

the class Kumanga method loadMangaInformation.

@Override
public void loadMangaInformation(Manga manga, boolean forceReload) throws Exception {
    if (manga.getChapters().isEmpty() || forceReload) {
        String data = getNavigatorAndFlushParameters().get(manga.getPath());
        // Cover
        manga.setImages(getFirstMatchDefault("</div>\\s*<img src=\"([^\"]+)\"", data, ""));
        // Author
        manga.setAuthor(getFirstMatchDefault("<p><b>Autor: </b>(.+?)</p>", data, context.getString(R.string.nodisponible)));
        // Genre
        manga.setGenre(getFirstMatchDefault("GĂ©neros:(.+?)</div>", data, context.getString(R.string.nodisponible)).replaceAll("</a>\\s*<a", "</a>, <a"));
        // Summary
        manga.setSynopsis(getFirstMatchDefault("id=\"tab1\"><p>(.+?)</p>", data, context.getString(R.string.nodisponible)));
        // Status
        manga.setFinished(!getFirstMatchDefault("<p><b>Estado: </b>(.+?)</p>", data, "Activo").contains("Activo"));
        // Chapters
        Pattern pattern = Pattern.compile("<h4 class=\"title\">\\s*<a href=\"(manga[^\"]+).+?>(.+?)</i>", Pattern.DOTALL);
        Matcher matcher = pattern.matcher(data);
        while (matcher.find()) {
            manga.addChapterFirst(new Chapter(matcher.group(2), HOST + "/" + matcher.group(1)));
        }
    }
}
Also used : Pattern(java.util.regex.Pattern) Matcher(java.util.regex.Matcher) Chapter(ar.rulosoft.mimanganu.componentes.Chapter)

Example 19 with Chapter

use of ar.rulosoft.mimanganu.componentes.Chapter in project MiMangaNu by raulhaag.

the class MangaEden method loadMangaInformation.

@Override
public void loadMangaInformation(Manga manga, boolean forceReload) throws Exception {
    if (manga.getChapters().isEmpty() || forceReload) {
        String source = getNavigatorAndFlushParameters().get(manga.getPath());
        // Front
        String image = getFirstMatchDefault("<div class=\"mangaImage2\"><img src=\"(.+?)\"", source, "");
        if (image.length() > 2) {
            image = "http:" + image;
        }
        manga.setImages(image);
        // Summary
        manga.setSynopsis(getFirstMatchDefault("mangaDescription\">(.+?)</h", source, context.getString(R.string.nodisponible)));
        // Status
        manga.setFinished(getFirstMatchDefault("Status</h(.+?)<h", source, "").contains("Completed"));
        // Author
        manga.setAuthor(getFirstMatchDefault("Author</h4>(.+?)<h4>", source, context.getString(R.string.nodisponible)));
        // Genres
        manga.setGenre(getFirstMatchDefault("Genres</h4>(.+?)<h4>", source, context.getString(R.string.nodisponible)));
        // Chapters
        Pattern pattern = Pattern.compile("<tr.+?href=\"(/en/en-manga/.+?)\".+?>(.+?)</a", Pattern.DOTALL);
        Matcher matcher = pattern.matcher(source);
        while (matcher.find()) {
            manga.addChapterFirst(new Chapter(matcher.group(2).replaceAll("Chapter", " Ch "), HOST + matcher.group(1)));
        }
    }
}
Also used : Pattern(java.util.regex.Pattern) Matcher(java.util.regex.Matcher) Chapter(ar.rulosoft.mimanganu.componentes.Chapter)

Example 20 with Chapter

use of ar.rulosoft.mimanganu.componentes.Chapter in project MiMangaNu by raulhaag.

the class MangaEdenIt method loadMangaInformation.

@Override
public void loadMangaInformation(Manga manga, boolean forceReload) throws Exception {
    if (manga.getChapters().isEmpty() || forceReload) {
        String source = getNavigatorAndFlushParameters().get(manga.getPath());
        // Front
        String image = getFirstMatchDefault("<div class=\"mangaImage2\"><img src=\"(.+?)\"", source, "");
        if (image.length() > 2) {
            image = "http:" + image;
        }
        manga.setImages(image);
        // Summary
        manga.setSynopsis(getFirstMatchDefault("mangaDescription\">(.+?)</h", source, context.getString(R.string.nodisponible)));
        // Status
        manga.setFinished(getFirstMatchDefault("Stato</h(.+?)<h", source, "").contains("Completato"));
        // Author
        manga.setAuthor(getFirstMatchDefault("Autore</h4>(.+?)<h4>", source, context.getString(R.string.nodisponible)));
        // Genres
        manga.setGenre(getFirstMatchDefault("Genere</h4>(.+?)<h4>", source, context.getString(R.string.nodisponible)));
        // Chapters
        Pattern pattern = Pattern.compile("<a href=\"(/it/it-manga/[^\"]+)\" class=\"chapterLink\">(.+?)</a>", Pattern.DOTALL);
        Matcher matcher = pattern.matcher(source);
        while (matcher.find()) {
            manga.addChapterFirst(new Chapter(matcher.group(2).replaceAll("Capitolo", " Cap "), HOST + matcher.group(1)));
        }
    }
}
Also used : Pattern(java.util.regex.Pattern) Matcher(java.util.regex.Matcher) Chapter(ar.rulosoft.mimanganu.componentes.Chapter)

Aggregations

Chapter (ar.rulosoft.mimanganu.componentes.Chapter)37 Matcher (java.util.regex.Matcher)27 Pattern (java.util.regex.Pattern)27 ArrayList (java.util.ArrayList)5 Manga (ar.rulosoft.mimanganu.componentes.Manga)4 DialogInterface (android.content.DialogInterface)3 View (android.view.View)3 AlertDialog (android.app.AlertDialog)2 SharedPreferences (android.content.SharedPreferences)2 TextView (android.widget.TextView)2 ServerBase (ar.rulosoft.mimanganu.servers.ServerBase)2 JSONException (org.json.JSONException)2 JSONObject (org.json.JSONObject)2 SuppressLint (android.annotation.SuppressLint)1 ColorDrawable (android.graphics.drawable.ColorDrawable)1 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)1 SparseBooleanArray (android.util.SparseBooleanArray)1 ActionMode (android.view.ActionMode)1 LayoutInflater (android.view.LayoutInflater)1 Menu (android.view.Menu)1