From 30d10cf5951e44a3fcbb1e184a7c0f2ae8c5c2af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 28 Aug 2016 16:49:49 +0200 Subject: [PATCH] [pixiv] fix KeyError if no status is present --- gallery_dl/extractor/pixiv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gallery_dl/extractor/pixiv.py b/gallery_dl/extractor/pixiv.py index a25a8290..0611fab8 100644 --- a/gallery_dl/extractor/pixiv.py +++ b/gallery_dl/extractor/pixiv.py @@ -306,6 +306,6 @@ class PixivAPI(): def _parse(response, empty=[None]): """Parse a Pixiv Public-API response""" data = json.loads(response.text) - if data["status"] == "failure" or data["response"] == empty: + if data.get("status") == "failure" or data.get("response", empty) == empty: raise exception.NotFoundError() return data