[exhentai] implement '"source": "metadata"' (#4902)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user