diff --git a/docs/configuration.rst b/docs/configuration.rst index c3cff2cd..73664df2 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -1081,17 +1081,6 @@ Description Minimum wait time in seconds before API requests. -extractor.exhentai.limits -------------------------- -Type - ``integer`` -Default - ``null`` -Description - Sets a custom image download limit and - stops extraction when it gets exceeded. - - extractor.exhentai.domain ------------------------- Type @@ -1105,6 +1094,17 @@ Description * ``"exhentai.org"``: Use ``exhentai.org`` for all URLs +extractor.exhentai.limits +------------------------- +Type + ``integer`` +Default + ``null`` +Description + Sets a custom image download limit and + stops extraction when it gets exceeded. + + extractor.exhentai.metadata --------------------------- Type @@ -1129,6 +1129,18 @@ Description Download full-sized original images if available. +extractor.exhentai.source +------------------------- +Type + ``string`` +Default + ``"gallery"`` +Description + Selects an alternative source to download files from. + + * ``"hitomi"``: Download the corresponding gallery from ``hitomi.la`` + + extractor.fanbox.embeds ----------------------- Type diff --git a/gallery_dl/extractor/exhentai.py b/gallery_dl/extractor/exhentai.py index 7ffb2148..cf9706bc 100644 --- a/gallery_dl/extractor/exhentai.py +++ b/gallery_dl/extractor/exhentai.py @@ -176,6 +176,10 @@ class ExhentaiGalleryExtractor(ExhentaiExtractor): self.image_token = match.group(4) self.image_num = text.parse_int(match.group(6), 1) + source = self.config("source") + if source == "hitomi": + self.items = self._items_hitomi + def items(self): self.login() @@ -221,6 +225,18 @@ class ExhentaiGalleryExtractor(ExhentaiExtractor): data["_http_validate"] = None yield Message.Url, url, data + def _items_hitomi(self): + if self.config("metadata", False): + data = self.metadata_from_api() + data["date"] = text.parse_timestamp(data["posted"]) + else: + data = {} + + from .hitomi import HitomiGalleryExtractor + url = "https://hitomi.la/galleries/{}.html".format(self.gallery_id) + data["_extractor"] = HitomiGalleryExtractor + yield Message.Queue, url, data + def get_metadata(self, page): """Extract gallery metadata""" data = self.metadata_from_page(page)