diff --git a/gallery_dl/extractor/hentai2read.py b/gallery_dl/extractor/hentai2read.py index b0d93dca..8c01cfa2 100644 --- a/gallery_dl/extractor/hentai2read.py +++ b/gallery_dl/extractor/hentai2read.py @@ -6,17 +6,15 @@ # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. -"""Extract images from https://hentai2read.com/""" +"""Extract hentaimanga from https://hentai2read.com/""" -from .common import Extractor, Message from .. import text -import json +from . import hentaicdn import re -class Hentai2readMangaExtractor(Extractor): +class Hentai2readMangaExtractor(hentaicdn.HentaicdnMangaExtractor): """Extractor for mangas from hentai2read.com""" category = "hentai2read" - subcategory = "manga" pattern = [r"(?:https?://)?(?:www\.)?hentai2read\.com/([^/]+)/?$"] test = [ ("http://hentai2read.com/amazon_elixir/", { @@ -28,29 +26,20 @@ class Hentai2readMangaExtractor(Extractor): ] def __init__(self, match): - Extractor.__init__(self) + hentaicdn.HentaicdnMangaExtractor.__init__(self) self.url_title = match.group(1) - def items(self): - yield Message.Version, 1 - for chapter in self.get_chapters(): - yield Message.Queue, chapter - def get_chapters(self): - """Return a list of all chapter urls""" - page = self.request("http://hentai2read.com/" + self.url_title).text - page = text.extract(page, '
\n')[0] - needle = '