# -*- coding: utf-8 -*- # 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. """Extractors for https://www.eporner.com/""" from .common import GalleryExtractor from .. import text class EpornerGalleryExtractor(GalleryExtractor): """Extractor for image galleries from eporner.com""" category = "eporner" root = "https://www.eporner.com" pattern = (r"(?:https?://)?(?:www\.)?eporner\.com" r"/gallery/(\w+)(?:/([\w-]+))?") example = "https://www.eporner.com/gallery/GID/SLUG/" def __init__(self, match): url = f"{self.root}/gallery/{match[1]}/{match[2]}/" GalleryExtractor.__init__(self, match, url) def metadata(self, page): if page.find("Age Verification<", 0, 240) >= 0: raise self.exc.AuthRequired("Age Verification", "gallery") title = text.extr(page, "