[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)
pull/359/head
Mike Fährmann 5 years ago
parent 4e07f99e3e
commit f5961ac968
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

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

Loading…
Cancel
Save