From 1b82d36ab236b864cba681f40c17aa4b4d3579a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 24 Mar 2020 20:49:54 +0100 Subject: [PATCH] [deviantart] handle decode errors for extended_fetch results (#655) This isn't going to solve the underlying problem, but it should at least provide the server response when those errors happen. --- gallery_dl/extractor/deviantart.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gallery_dl/extractor/deviantart.py b/gallery_dl/extractor/deviantart.py index 90b27d15..d8a5fc61 100644 --- a/gallery_dl/extractor/deviantart.py +++ b/gallery_dl/extractor/deviantart.py @@ -1044,7 +1044,10 @@ class DeviantartAPI(): if response.status_code == 404: raise exception.StopExtraction( "Your account must use the Eclipse interface.") - return response.json() + try: + return response.json() + except Exception: + return {"error": response.text} def deviation_metadata(self, deviations): """ Fetch deviation metadata for a set of deviations"""