From fbebc58189623416aaa3b56fae8b9d49fb103ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 21 Dec 2023 02:23:22 +0100 Subject: [PATCH] [deviantart] add 'intermediary' option (#4955) --- docs/configuration.rst | 11 +++++++++++ gallery_dl/extractor/deviantart.py | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index c19480e3..12232dd8 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -1373,6 +1373,17 @@ Description It is possible to use ``"all"`` instead of listing all values separately. +extractor.deviantart.intermediary +--------------------------------- +Type + ``bool`` +Default + ``true`` +Description + For older non-downloadable images, + download a higher-quality ``/intermediary/`` version. + + extractor.deviantart.journals ----------------------------- Type diff --git a/gallery_dl/extractor/deviantart.py b/gallery_dl/extractor/deviantart.py index 89cd6d1f..9be5b0df 100644 --- a/gallery_dl/extractor/deviantart.py +++ b/gallery_dl/extractor/deviantart.py @@ -48,6 +48,7 @@ class DeviantartExtractor(Extractor): self.quality = self.config("quality", "100") self.original = self.config("original", True) self.comments = self.config("comments", False) + self.intermediary = self.config("intermediary", True) self.api = DeviantartOAuthAPI(self) self.group = False @@ -136,7 +137,7 @@ class DeviantartExtractor(Extractor): elif self.jwt: self._update_token(deviation, content) elif content["src"].startswith("https://images-wixmp-"): - if deviation["index"] <= 790677560: + if self.intermediary and deviation["index"] <= 790677560: # https://github.com/r888888888/danbooru/issues/4069 intermediary, count = re.subn( r"(/f/[^/]+/[^/]+)/v\d+/.*",