summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/reddit.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2020-06-16 02:01:17 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2020-06-16 02:01:17 -0400
commit8c911e3d62a430f5630c13d51b47201fa8ff3cd1 (patch)
tree6e0e6f65abc37d7f35ea96d323031a52c7fa966d /gallery_dl/extractor/reddit.py
parenta70a3246927b72f1ded37acd55ee719515441b5b (diff)
New upstream version 1.14.1.upstream/1.14.1
Diffstat (limited to 'gallery_dl/extractor/reddit.py')
-rw-r--r--gallery_dl/extractor/reddit.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/gallery_dl/extractor/reddit.py b/gallery_dl/extractor/reddit.py
index 2e3864a..6331b77 100644
--- a/gallery_dl/extractor/reddit.py
+++ b/gallery_dl/extractor/reddit.py
@@ -324,7 +324,11 @@ class RedditAPI():
self.extractor.wait(seconds=response.headers["x-ratelimit-reset"])
return self._call(endpoint, params)
- data = response.json()
+ try:
+ data = response.json()
+ except ValueError:
+ raise exception.StopExtraction(text.remove_html(response.text))
+
if "error" in data:
if data["error"] == 403:
raise exception.AuthorizationError()