# -*- coding: utf-8 -*- # Copyright 2025 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. """Extractors for https://simpcity.cr/""" from .common import Extractor, Message from .. import text, exception from ..cache import cache BASE_PATTERN = r"(?:https?://)?(?:www\.)?simpcity\.(?:cr|su)" class SimpcityExtractor(Extractor): """Base class for simpcity extractors""" category = "simpcity" cookies_domain = "simpcity.cr" cookies_names = ("ogaddgmetaprof_user",) root = "https://simpcity.cr" directory_fmt = ("{category}", "{thread[section]}", "{thread[title]} ({thread[id]})") filename_fmt = "{post[id]}_{num:>02}_{id}_{filename}.{extension}" archive_fmt = "{post[id]}/{type[0]}{id}_{filename}" def items(self): self.login() extract_urls = text.re( r'(?s)(?:' r'