You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 6, 2024. It is now read-only.
from baidupcsapi import PCS pcs = PCS(username, password) pcs.download("/abc.txt")
执行之后会报错:
Traceback (most recent call last):
File "/home/hehe/.local/lib/python3.5/site-packages/baidupcsapi/api.py", line 130, in wrapper
foo = json.loads(ret.content.decode('utf-8'))
File "/usr/lib/python3.5/json/init.py", line 319, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "t.py", line 5, in
pcs.download('/recovery_key.txt')
File "/home/hehe/.local/lib/python3.5/site-packages/baidupcsapi/api.py", line 1133, in download
extra_params=params, **kwargs)
File "/home/lalala/.local/lib/python3.5/site-packages/baidupcsapi/api.py", line 139, in wrapper
raise LoginFailed('User unsigned in.')
baidupcsapi.api.LoginFailed: User unsigned in.
from baidupcsapi import PCS
pcs = PCS(username, password)
pcs.download("/abc.txt")
执行之后会报错:
Traceback (most recent call last):
File "/home/hehe/.local/lib/python3.5/site-packages/baidupcsapi/api.py", line 130, in wrapper
foo = json.loads(ret.content.decode('utf-8'))
File "/usr/lib/python3.5/json/init.py", line 319, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "t.py", line 5, in
pcs.download('/recovery_key.txt')
File "/home/hehe/.local/lib/python3.5/site-packages/baidupcsapi/api.py", line 1133, in download
extra_params=params, **kwargs)
File "/home/lalala/.local/lib/python3.5/site-packages/baidupcsapi/api.py", line 139, in wrapper
raise LoginFailed('User unsigned in.')
baidupcsapi.api.LoginFailed: User unsigned in.
trace了一下代码, 发现在
https://github.com/ly0/baidupcsapi/blob/master/baidupcsapi/api.py#L129
每一个请求都会json.loads一下,包括下载文件的那个请求
然而, 这次返回的是文件的内容, 并不是json
就会导致exception
请问这是个bug么?还是我的姿势不对?
The text was updated successfully, but these errors were encountered: