# -*- 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 XenForo forums""" from .common import BaseExtractor, Message from .. import text, exception from ..cache import cache class XenforoExtractor(BaseExtractor): """Base class for xenforo extractors""" basecategory = "xenforo" 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 __init__(self, match): BaseExtractor.__init__(self, match) self.cookies_domain = "." + self.root.split("/")[2] self.cookies_names = self.config_instance("cookies") def items(self): self.login() extract_urls = text.re( r'(?s)(?:' r'