We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 130401c + bf62c76 commit 0d01e2aCopy full SHA for 0d01e2a
1 file changed
auth.py
@@ -139,7 +139,14 @@ def upload_form(form):
139
raise NetworkError(u"表单上传失败!")
140
141
if r.headers['content-type'].lower() == "application/json":
142
- result = r.json()
+ try:
143
+ # 修正 justkg 提出的问题: https://github.com/egrcc/zhihu-python/issues/30
144
+ result = json.loads(r.content)
145
+ except Exception as e:
146
+ Logging.error(u"JSON解析失败!")
147
+ Logging.debug(e)
148
+ Logging.debug(r.content)
149
+ result = {}
150
if result["r"] == 0:
151
Logging.success(u"登录成功!" )
152
return {"result": True}
0 commit comments