# -*- 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://nudecollect.com/""" from .common import GalleryExtractor from .. import text class NudecollectExtractor(GalleryExtractor): """Base class for Nudecollect extractors""" category = "nudecollect" directory_fmt = ("{category}", "{title}") filename_fmt = "{slug}_{num:>03}.{extension}" archive_fmt = "{slug}_{num}" root = "https://www.nudecollect.com" def request(self, url, **kwargs): kwargs["allow_redirects"] = False return GalleryExtractor.request(self, url, **kwargs) @staticmethod def get_title(page): return text.unescape(text.extr(page, "", ""))[31:] @staticmethod def get_image(page): return text.extr(page, '05}" + p2[4:] return [(ufmt.format(num), None) for num in range(1, self.count + 1)]