# -*- coding: utf-8 -*- # Copyright 2020-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 Moebooru based sites""" from .booru import BooruExtractor from .. import text, dt import collections class MoebooruExtractor(BooruExtractor): """Base class for Moebooru extractors""" basecategory = "moebooru" filename_fmt = "{category}_{id}_{md5}.{extension}" page_start = 1 def _prepare(self, post): post["date"] = dt.parse_ts(post["created_at"]) def _html(self, post): url = f"{self.root}/post/show/{post['id']}" return self.request(url).text def _tags(self, post, page): tag_container = text.extr(page, '