summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/deviantart.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/deviantart.py')
-rw-r--r--gallery_dl/extractor/deviantart.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/gallery_dl/extractor/deviantart.py b/gallery_dl/extractor/deviantart.py
index 90b27d1..d6669d1 100644
--- a/gallery_dl/extractor/deviantart.py
+++ b/gallery_dl/extractor/deviantart.py
@@ -1041,10 +1041,18 @@ class DeviantartAPI():
}
response = self.extractor.request(
url, headers=headers, params=params, fatal=None)
- if response.status_code == 404:
+ code = response.status_code
+
+ if code == 404:
raise exception.StopExtraction(
"Your account must use the Eclipse interface.")
- return response.json()
+ elif code == 403 and b"Request blocked." in response.content:
+ raise exception.StopExtraction(
+ "Requests to deviantart.com blocked due to too much traffic.")
+ try:
+ return response.json()
+ except Exception:
+ return {"error": response.text}
def deviation_metadata(self, deviations):
""" Fetch deviation metadata for a set of deviations"""