From 48eccd68c538964a66532549e3e6d7284b30bdfe Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Wed, 6 Feb 2019 21:07:57 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20=E6=90=9C=E7=B4=A2=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E9=9D=9EJSON=E5=9B=9E=E5=A4=8D=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=A8=8B=E5=BA=8F=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api.py b/api.py index 85bc3dc..35395db 100644 --- a/api.py +++ b/api.py @@ -103,7 +103,11 @@ class XiGuaLiveApi: else: p = s.get("https://security.snssdk.com/video/app/search/live/?version_code=730&device_platform=android" "&format=json&keyword={}".format(self.name)) - d = p.json() + try: + d = p.json() + except json.decoder.JSONDecodeError as e: + print(p.text()) + return if "data" in d and d["data"] is not None: for i in d["data"]: if i["block_type"] != 0: