[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:
@@ -87,6 +87,10 @@ class DeviantartExtractor(Extractor):
|
|||||||
|
|
||||||
yield self.commit(deviation, content)
|
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:
|
if "videos" in deviation:
|
||||||
video = max(deviation["videos"],
|
video = max(deviation["videos"],
|
||||||
key=lambda x: text.parse_int(x["quality"][:-1]))
|
key=lambda x: text.parse_int(x["quality"][:-1]))
|
||||||
@@ -416,6 +420,10 @@ class DeviantartStashExtractor(DeviantartExtractor):
|
|||||||
"pattern": pattern,
|
"pattern": pattern,
|
||||||
"count": 4,
|
"count": 4,
|
||||||
}),
|
}),
|
||||||
|
# downloadable, but no "content" field (#307)
|
||||||
|
("https://sta.sh/024t4coz16mi", {
|
||||||
|
"count": 1,
|
||||||
|
}),
|
||||||
("https://sta.sh/abcdefghijkl", {
|
("https://sta.sh/abcdefghijkl", {
|
||||||
"exception": exception.HttpError,
|
"exception": exception.HttpError,
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user