diff --git a/docs/configuration.rst b/docs/configuration.rst index 623727af95..53c058401e 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -1270,6 +1270,19 @@ Description the first in the list gets chosen (usually `mp3`). +extractor.luscious.gif +-------------------------- +Type + ``bool`` +Default + ``false`` +Description + Format in which to download animated images. + + Use ``true`` to download animated images as gifs and ``false`` + to download as mp4 videos. + + extractor.mangadex.api-server ----------------------------- Type @@ -1558,6 +1571,19 @@ Description Also search Plurk comments for URLs. +extractor.reactor.gif +-------------------------- +Type + ``bool`` +Default + ``false`` +Description + Format in which to download animated images. + + Use ``true`` to download animated images as gifs and ``false`` + to download as mp4 videos. + + extractor.readcomiconline.captcha --------------------------------- Type diff --git a/docs/gallery-dl.conf b/docs/gallery-dl.conf index 5eab0fa969..671c7a4ae3 100644 --- a/docs/gallery-dl.conf +++ b/docs/gallery-dl.conf @@ -146,6 +146,10 @@ { "format": "mp3" }, + "luscious": + { + "gif": false + }, "mangadex": { "api-server": "https://api.mangadex.org", @@ -196,6 +200,7 @@ }, "reactor": { + "gif": false, "sleep-request": 5.0 }, "reddit": diff --git a/gallery_dl/extractor/luscious.py b/gallery_dl/extractor/luscious.py index 852c49fece..de90d95634 100644 --- a/gallery_dl/extractor/luscious.py +++ b/gallery_dl/extractor/luscious.py @@ -116,6 +116,7 @@ class LusciousAlbumExtractor(LusciousExtractor): def __init__(self, match): LusciousExtractor.__init__(self, match) self.album_id = match.group(1) + self.gif = self.config("gif", False) def items(self): album = self.metadata() @@ -130,7 +131,8 @@ def items(self): image["date"] = text.parse_timestamp(image["created"]) image["id"] = text.parse_int(image["id"]) - url = image["url_to_video"] or image["url_to_original"] + url = image["url_to_original"] or image["url_to_video"] \ + if self.gif else image["url_to_video"] or image["url_to_original"] yield Message.Url, url, text.nameext_from_url(url, image) def metadata(self): diff --git a/gallery_dl/extractor/reactor.py b/gallery_dl/extractor/reactor.py index 104dc23e9a..bbbdd3f416 100644 --- a/gallery_dl/extractor/reactor.py +++ b/gallery_dl/extractor/reactor.py @@ -28,6 +28,7 @@ def __init__(self, match): Extractor.__init__(self, match) self.root = "http://" + match.group(1) self.session.headers["Referer"] = self.root + self.gif = self.config("gif", False) if not self.category: # set category based on domain name @@ -124,6 +125,12 @@ def _parse_post(self, post): elif "/post/webm/" not in url and "/post/mp4/" not in url: url = url.replace("/post/", "/post/full/") + if self.gif and ("/post/webm/" in url or "/post/mp4/" in url): + gif_url = text.extract(image, '