[exhentai] implement '"source": "metadata"' (#4902)

This commit is contained in:
Mike Fährmann
2025-06-08 12:57:23 +02:00
parent 967af5eede
commit 17d39c06e3
2 changed files with 7 additions and 0 deletions

View File

@@ -2557,6 +2557,8 @@ Description
Selects an alternative source to download files from.
* ``"hitomi"``: Download the corresponding gallery from ``hitomi.la``
* ``"metadata"``: Load only a gallery's metadata from the
`API <https://ehwiki.org/wiki/API#Gallery_Metadata>`_
extractor.exhentai.tags

View File

@@ -136,6 +136,8 @@ class ExhentaiGalleryExtractor(ExhentaiExtractor):
source = self.config("source")
if source == "hitomi":
self.items = self._items_hitomi
elif source == "metadata":
self.items = self._items_metadata
limits = self.config("limits", False)
if limits and limits.__class__ is int:
@@ -223,6 +225,9 @@ class ExhentaiGalleryExtractor(ExhentaiExtractor):
data["_extractor"] = HitomiGalleryExtractor
yield Message.Queue, url, data
def _items_metadata(self):
yield Message.Directory, self.metadata_from_api()
def get_metadata(self, page):
"""Extract gallery metadata"""
data = self.metadata_from_page(page)