1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 18:53:21 +01:00

[deviantart] download deviations with no 'content' field

Some deviations (possibly only from sta.sh sources) are downloadable
(i.e. 'is_downloadable' is true and /deviation/download/ works), but
have no 'content' or similar  in their JSON representation.

(fixes #307)
This commit is contained in:
Mike Fährmann 2019-06-13 21:14:12 +02:00
parent 4e07f99e3e
commit f5961ac968
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -87,6 +87,10 @@ class DeviantartExtractor(Extractor):
yield self.commit(deviation, content)
elif deviation["is_downloadable"]:
content = self.api.deviation_download(deviation["deviationid"])
yield self.commit(deviation, content)
if "videos" in deviation:
video = max(deviation["videos"],
key=lambda x: text.parse_int(x["quality"][:-1]))
@ -416,6 +420,10 @@ class DeviantartStashExtractor(DeviantartExtractor):
"pattern": pattern,
"count": 4,
}),
# downloadable, but no "content" field (#307)
("https://sta.sh/024t4coz16mi", {
"count": 1,
}),
("https://sta.sh/abcdefghijkl", {
"exception": exception.HttpError,
}),