Example #1
0
  @Override
  protected Manga parseHtmlToManga(String mangaUrl, String unparsedHtml) {
    Document parsedDocument = Jsoup.parse(unparsedHtml);
    Element infoElement = parsedDocument.select("div.barContent").first();

    Manga manga = Manga.create(mangaUrl);
    manga.title = Parser.text(infoElement, "a.bigChar");
    manga.author = Parser.text(infoElement, "p:has(span:contains(Author:)) > a");
    manga.genre = Parser.allText(infoElement, "p:has(span:contains(Genres:)) > *:gt(0)");
    manga.description = Parser.allText(infoElement, "p:has(span:contains(Summary:)) ~ p");
    manga.status = parseStatus(Parser.text(infoElement, "p:has(span:contains(Status:))"));

    String thumbnail = Parser.src(parsedDocument, ".rightBox:eq(0) img");
    if (thumbnail != null) {
      manga.thumbnail_url = Uri.parse(thumbnail).buildUpon().authority(IP).toString();
    }

    manga.initialized = true;
    return manga;
  }
Example #2
0
  private Chapter constructChapterFromHtmlBlock(Element chapterElement) {
    Chapter chapter = Chapter.create();

    Element urlElement = Parser.element(chapterElement, "a");
    String date = Parser.text(chapterElement, "td:eq(1)");

    if (urlElement != null) {
      chapter.setUrl(urlElement.attr("href"));
      chapter.name = urlElement.text();
    }
    if (date != null) {
      try {
        chapter.date_upload =
            new SimpleDateFormat("MM/dd/yyyy", Locale.ENGLISH).parse(date).getTime();
      } catch (ParseException e) {
        /* Ignore */
      }
    }
    return chapter;
  }