diff options
| author | 2020-03-28 23:01:51 -0400 | |
|---|---|---|
| committer | 2020-03-28 23:01:51 -0400 | |
| commit | e4887ae6b00c50fbbde531cc274c77b076bd821d (patch) | |
| tree | 051849d0ce8ed35aa229ba828a2dfe1faf10c5c0 /gallery_dl/extractor/deviantart.py | |
| parent | e8cc000750de972384f2f34d02d42222b4018ae9 (diff) | |
New upstream version 1.13.3upstream/1.13.3
Diffstat (limited to 'gallery_dl/extractor/deviantart.py')
| -rw-r--r-- | gallery_dl/extractor/deviantart.py | 12 |
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""" |
