houtianze / bypy

Python client for Baidu Yun (Personal Cloud Storage) 百度云/百度网盘Python客户端
MIT License
7.86k stars 1.4k forks source link

授权不了,需要手动越墙么? #26

Closed Huangsir closed 10 years ago

Huangsir commented 10 years ago

Authorizing, please be patient, it may take upto 60.0 seconds...

[09:23:38] Maximum number (1) of tries failed. I think you are WALLed, trying OpenShift server to auth... [09:23:54] Fatal Exception. Quitting...
houtianze commented 10 years ago

应该不用翻墙,这个看起来有点怪。你能命令行加 -d -v跑一下,然后再贴一下输出吗?

Huangsir commented 10 years ago

Loading Hash Cache File '/home/cubie/.bypy.pickle'... Hash Cache File not found, no caching

[12:53:39] Error while loading baidu pcs token: [12:53:39] Traceback (most recent call last): File "bypy.py", line 1016, in __load_local_json with open(TokenFilePath, 'rb') as infile: IOError: [Errno 2] No such file or directory: u'/home/cubie/.bypy.json' Please visit: https://openapi.baidu.com/oauth/2.0/authorize?scope=basic+netdisk&redirect_uri=oob&response_type=code&client_id=q8WE4EpCsau1oS0MplgMKNBn And authorize this app Paste the Authorization Code here and then press [Enter] within 10 minutes. 4074256a553f06b722580e2d8a295da4 auth_code: 4074256a553f06b722580e2d8a295da4 Authorizing, please be patient, it may take upto 60.0 seconds... GET https://bypyoauth.appspot.com/auth actargs: None Params: {u'code': '4074256a553f06b722580e2d8a295da4', u'redirect_uri': u'oob'} [12:54:57] Error accessing 'https://bypyoauth.appspot.com/auth' [12:54:57] Exception: Request timed out. Traceback (most recent call last): File "bypy.py", line 899, in __request_work params = parsnew, timeout = self.__timeout, verify = False, *_kwargs) File "/usr/lib/python2.7/dist-packages/requests/api.py", line 52, in get return request('get', url, *_kwargs) File "/usr/lib/python2.7/dist-packages/requests/api.py", line 40, in request return s.request(method=method, url=url, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 229, in request r.send(prefetch=prefetch) File "/usr/lib/python2.7/dist-packages/requests/models.py", line 611, in send raise Timeout('Request timed out.') Timeout: Request timed out. [12:54:57] Function: __server_auth_act [12:54:57] Website parameters: {u'code': '4074256a553f06b722580e2d8a295da4', u'redirect_uri': u'oob'} [12:54:57] Maximum number (1) of tries failed. I think you are WALLed, trying OpenShift server to auth... GET https://bypy-tianze.rhcloud.com/auth actargs: None Params: {u'code': '4074256a553f06b722580e2d8a295da4', u'redirect_uri': u'oob'} HTTP Status Code: 200 Request OK, processing action [12:55:09] Error accessing 'https://bypy-tianze.rhcloud.com/auth' [12:55:09] Exception: 'dict' object is not callable Traceback (most recent call last): File "bypy.py", line 918, in __request_work result = act(r, actargs) File "bypy.py", line 1046, in __server_auth_act return self.__store_json(r) File "bypy.py", line 1043, in __store_json return self.__store_json_only(r.json()) TypeError: 'dict' object is not callable [12:55:09] Function: __server_auth_act [12:55:09] Website parameters: {u'code': '4074256a553f06b722580e2d8a295da4', u'redirect_uri': u'oob'} [12:55:09] HTTP Status Code: 200 [12:55:09] Error parsing JSON Error Code from: {"expires_in":2592000,"refresh_token":"22.a1dac77b456d8b9f4887df6652b0c33f.315360000.1711889711.1862768342-1572671","access_token":"21.29582efb7f5aeb66dbc4a9ce274e9497.2592000.1399121711.1862768342-1572671","session_secret":"118647d63f3fbd332a6baff438e08c60","session_key":"9mnRdvuTW26HJWFz/GxIJVGSuC4k9FrmR/NKh0VIOihKSB+BPSi2Bw4ESP2fLfsgBLM2S1cgzyStQ1usgbguXnrd21p5KPDmfQ==","scope":"basic netdisk"} [12:55:09] Exception: Traceback (most recent call last): File "bypy.py", line 853, in __print_error_json dj = r.json() TypeError: 'dict' object is not callable [12:55:09] Website returned: {"expires_in":2592000,"refresh_token":"22.a1dac77b456d8b9f4887df6652b0c33f.315360000.1711889711.1862768342-1572671","access_token":"21.29582efb7f5aeb66dbc4a9ce274e9497.2592000.1399121711.1862768342-1572671","session_secret":"118647d63f3fbd332a6baff438e08c60","session_key":"9mnRdvuTW26HJWFz/GxIJVGSuC4k9FrmR/NKh0VIOihKSB+BPSi2Bw4ESP2fLfsgBLM2S1cgzyStQ1usgbguXnrd21p5KPDmfQ==","scope":"basic netdisk"} [12:55:09] Fatal Exception. Quitting... Not saving Hash Cache since 'dirty' is 'False' and 'force_saving' is 'False'
Huangsir commented 10 years ago

Debian GNU/Linux 7 \n \l Linux version 3.4.75-sun7i (root@ubtu) (gcc version 4.8.2 20130603 (prerelease) (crosstool-NG linaro-1.13.1-4.8-2013.06 - Linaro GCC 2013.06) ) #36 SMP PREEMPT Mon Feb 10 02:47:28 CST 2014 Python 2.7.3

Linux版本,内核版本,python版本

sdnian commented 10 years ago

會不會是 python requests library 版本太舊? ... 我有一部電腦是用 Ubuntu 12.04.4 LTS, 它的 python-requests 版本是 0.8.2, 也是類似的狀況. 後來改用 pip 安裝 requests, 版本是 2.2.1.. 問題就解決了.

Huangsir commented 10 years ago

看来真的是requests的问题,不单是requests版本第,pip的版本也低,所以第一次-U的时候他并未帮我更新好requests,我升级了pip之后再升级requests才能成功的升级到2.2.1.... 感谢你的解答,麻烦了:)

houtianze commented 10 years ago

Google了一下,嗯,应该是Requests太旧的问题。不客气:)