[exhentai] add 'source' option
setting it to "hitomi" downloads the corresponding gallery from hitomi.la; might be extended to other sources in the future
This commit is contained in:
@@ -1081,17 +1081,6 @@ Description
|
|||||||
Minimum wait time in seconds before API requests.
|
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
|
extractor.exhentai.domain
|
||||||
-------------------------
|
-------------------------
|
||||||
Type
|
Type
|
||||||
@@ -1105,6 +1094,17 @@ Description
|
|||||||
* ``"exhentai.org"``: Use ``exhentai.org`` for all URLs
|
* ``"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
|
extractor.exhentai.metadata
|
||||||
---------------------------
|
---------------------------
|
||||||
Type
|
Type
|
||||||
@@ -1129,6 +1129,18 @@ Description
|
|||||||
Download full-sized original images if available.
|
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
|
extractor.fanbox.embeds
|
||||||
-----------------------
|
-----------------------
|
||||||
Type
|
Type
|
||||||
|
|||||||
@@ -176,6 +176,10 @@ class ExhentaiGalleryExtractor(ExhentaiExtractor):
|
|||||||
self.image_token = match.group(4)
|
self.image_token = match.group(4)
|
||||||
self.image_num = text.parse_int(match.group(6), 1)
|
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):
|
def items(self):
|
||||||
self.login()
|
self.login()
|
||||||
|
|
||||||
@@ -221,6 +225,18 @@ class ExhentaiGalleryExtractor(ExhentaiExtractor):
|
|||||||
data["_http_validate"] = None
|
data["_http_validate"] = None
|
||||||
yield Message.Url, url, data
|
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):
|
def get_metadata(self, page):
|
||||||
"""Extract gallery metadata"""
|
"""Extract gallery metadata"""
|
||||||
data = self.metadata_from_page(page)
|
data = self.metadata_from_page(page)
|
||||||
|
|||||||
Reference in New Issue
Block a user