1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 10:42:34 +01:00

[deviantart] fix GIF downloads (#242)

The "original" download URL for GIF animations is only a preview version
of the original file.
This commit is contained in:
Mike Fährmann 2019-05-05 20:57:04 +02:00
parent f347d2d152
commit 51e0e92429
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
3 changed files with 16 additions and 2 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## Unreleased
### Fixes
- Download original GIF animations from `deviantart` (#242)
## 1.8.3 - 2019-05-04
### Additions
- Support for

View File

@ -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"),

View File

@ -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"