# -*- coding: utf-8 -*- # Copyright 2016 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. """Extract comic-issues and entire comics from http://readcomiconline.to/""" from .common import Extractor from .. import text from . import kissmanga import re class ReadcomiconlineExtractor(Extractor): """Base class for readcomiconline extractors""" category = "readcomiconline" directory_fmt = ["{category}", "{comic}", "{issue:>03}"] filename_fmt = "{comic}_{issue:>03}_{page:>03}.{extension}" url_base = "http://readcomiconline.to" def __init__(self, match): Extractor.__init__(self) self.url = match.group(0) class ReadcomiconlineComicExtractor(ReadcomiconlineExtractor, kissmanga.KissmangaMangaExtractor): """Extractor for comics from readcomiconline.to""" subcategory = "comic" pattern = [r"(?:https?://)?(?:www\.)?readcomiconline\.to/Comic/[^/]+/?$"] test = [("http://readcomiconline.to/Comic/W-i-t-c-h", { "url": "c5a530538a30b176916e30cbe223a93d83cb2691", })] def get_chapters(self): """Return a list of all chapter urls""" page = self.request(self.url).text return reversed(list( text.extract_iter(page, '