ly0 / baidupcsapi

百度网盘api
MIT License
1.21k stars 234 forks source link

基于已保存的cookie文件发送请求时报错 KeyError: 'token' #64

Closed lazygunner closed 7 years ago

lazygunner commented 7 years ago

第一次成功登陆并保存cookie到文件没有问题, 第二次基于已保存的cookie文件发送请求时报错:

Traceback (most recent call last):
  File "show_update.py", line 159, in <module>
    su.show_update()
  File "show_update.py", line 100, in show_update
    rsp = pcs.list_files(path)
  File "/Users/gunner/Documents/workspace/baidupcsapi/baidupcsapi/api.py", line 1237, in list_files
    return self._request('list', 'list', extra_params=params, **kwargs)
  File "/Users/gunner/Documents/workspace/baidupcsapi/baidupcsapi/api.py", line 126, in wrapper
    ret = func(*args, **kwargs)
  File "/Users/gunner/Documents/workspace/baidupcsapi/baidupcsapi/api.py", line 432, in _request
    'bdstoken': self.user['token']
KeyError: 'token'

操作系统: macOS 10.13