From 51e0e9242915e4238d8486129b2f579566a114df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 5 May 2019 20:57:04 +0200 Subject: [PATCH] [deviantart] fix GIF downloads (#242) The "original" download URL for GIF animations is only a preview version of the original file. --- CHANGELOG.md | 4 ++++ gallery_dl/extractor/deviantart.py | 12 +++++++++++- gallery_dl/version.py | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12b57d13..b1e7b33b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unreleased +### Fixes +- Download original GIF animations from `deviantart` (#242) + ## 1.8.3 - 2019-05-04 ### Additions - Support for diff --git a/gallery_dl/extractor/deviantart.py b/gallery_dl/extractor/deviantart.py index 96a8d3ce..025cbb74 100644 --- a/gallery_dl/extractor/deviantart.py +++ b/gallery_dl/extractor/deviantart.py @@ -68,14 +68,18 @@ class DeviantartExtractor(Extractor): if "content" in deviation: content = deviation["content"] - if self.original and deviation["is_downloadable"]: + + if self.original and deviation["is_downloadable"] and \ + text.ext_from_url(content["src"]) != "gif": self._update_content(deviation, content) + if deviation["index"] <= 790677560 and \ content["src"].startswith("https://images-wixmp-"): # https://github.com/r888888888/danbooru/issues/4069 content["src"] = re.sub( r"(/f/[^/]+/[^/]+)/v\d+/.*", r"/intermediary\1", content["src"]) + yield self.commit(deviation, content) if "videos" in deviation: @@ -339,6 +343,12 @@ class DeviantartDeviationExtractor(DeviantartExtractor): "pattern": (r"https://images-wixmp-\w+\.wixmp\.com" r"/intermediary/f/[^/]+/[^.]+\.jpg$") }), + # non-download URL for GIFs (#242) + (("https://www.deviantart.com/skatergators/art/" + "COM-Monique-Model-781571783"), { + "pattern": (r"https://images-wixmp-\w+\.wixmp\.com" + r"/f/[^/]+/[^.]+\.gif\?token="), + }), # old-style URLs ("https://shimoda7.deviantart.com" "/art/For-the-sake-of-a-memory-10073852"), diff --git a/gallery_dl/version.py b/gallery_dl/version.py index 85c1e318..598263bb 100644 --- a/gallery_dl/version.py +++ b/gallery_dl/version.py @@ -6,4 +6,4 @@ # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. -__version__ = "1.8.3" +__version__ = "1.8.4-dev"