From c19241e2998dee23e34194ad5aa9c86eb3cc3c9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 21 Dec 2016 00:08:31 +0100 Subject: [PATCH] [readcomics] add comic extractor --- gallery_dl/extractor/readcomics.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gallery_dl/extractor/readcomics.py b/gallery_dl/extractor/readcomics.py index e24ccf5e..699210ab 100644 --- a/gallery_dl/extractor/readcomics.py +++ b/gallery_dl/extractor/readcomics.py @@ -11,6 +11,27 @@ from .common import Extractor, Message from .. import text +class ReadcomicComicExtractor(Extractor): + """Extractor for comics from readcomics.tv""" + category = "readcomics" + subcategory = "comic" + pattern = [(r"(?:https?://)?(?:www\.)?(readcomics\.(?:tv|net)/" + r"comic/[^/]+)/?$")] + + def __init__(self, match): + Extractor.__init__(self) + self.url = "https://" + match.group(1) + + def items(self): + yield Message.Version, 1 + for issue in self.get_issues(): + yield Message.Queue, issue + + def get_issues(self): + """Return a list of all comic-issue urls""" + page = self.request(self.url).text + return text.extract_iter(page, '