Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bypy info 一直授权失败,linux服务器上和windows本地都不行,之前没有使用过,没有进行过授权;并且按照给的建议到百度网站上移除授权,重新授权,试了一下午也没有解决。 #621

Closed
Thegallophorse opened this issue Aug 28, 2022 · 10 comments

Comments

@Thegallophorse
Copy link

Please visit:
https://openapi.baidu.com/oauth/2.0/authorize?client_id=q8WE4EpCsau1oS0MplgMKNBn&response_type=code&redirect_uri=oob&scope=basic+netdisk
And authorize this app
Paste the Authorization Code here within 10 minutes.
Press [Enter] when you are done
xxxxxxxxxxxxxxxxxxx
Authorizing, please be patient, it may take upto 300 seconds...
Authorizing with the Vercel server ...
Vercel server failed, Authorizing with the cloudendpoint server ...
Vercel server failed. Last resort: authorizing with the Aliyun server ...
[19:45:27] Fatal: All server authorizations failed.
[19:45:27] ----------------------------------------------------------------
[19:45:27] This is most likely caused by authorization errors.
Possible causes:

  • You didn't run this program for a long time (more than a month).
  • You changed your Baidu password after authorizing this program.
  • You didn't give this program the 'netdisk' access while authorizing.
  • ...
    Possible fixes:
  1. Remove the authorization token by running with the parameter '-c', and then re-run this program.
  2. If (1) still doesn't solve the problem, you may have to go to:
    https://passport.baidu.com/accountbind
    and remove the authorization of this program, and then re-run this program.
@Thegallophorse
Copy link
Author

bypy.py info -dv之后会输出这些内容,麻烦帮忙看一下

Auth servers loaded: {'AuthServerList': [['https://bypyoa.vercel.app/api/auth', False, 'Authorizing with the Vercel server ...'], ['https://qcfpba.api.cloudendpoint.cn/auth', False, 'Vercel server failed, Authorizing with the cloudendpoint server ...'], ['https://8.142.131.12/auth', False, 'Vercel server failed. Last resort: authorizing with the Aliyun server ...']], 'RefreshServerList': [['https://bypyoa.vercel.app/api/refresh', False, 'Refreshing with the Vercel server ...'], ['https://qcfpba.api.cloudendpoint.cn/refresh', False, 'Vercel server failed, Refreshing with the cloudendpoint server ...'], ['https://8.142.131.12/refresh', False, 'Vercel server failed. Last resort: refreshing with the Aliyun server ...']]}
[19:53:14] Using requests.packages.urllib3 to disable warnings
[19:53:14] Using urllib3 to disable warnings
Loading Hash Cache File '/home/wang/.bypy/bypy.hashcache.json'...
Hash Cache File '/home/wang/.bypy/bypy.hashcache.json' not found, no caching

Verbose level = 1
Debug level = 1
Config directory: '/home/wang/.bypy'
Token file: '/home/wang/.bypy/bypy.json'
Hash Cache file: '/home/wang/.bypy/bypy.hashcache.json'
App root path at Baidu Yun '/apps/bypy'
sys.stdin.encoding = utf-8
sys.stdout.encoding = utf-8
sys.stderr.encoding = utf-8

Error while loading baidu pcs token.
Exception:
<class 'FileNotFoundError'> - [Errno 2] No such file or directory: '/home/wang/.bypy/bypy.json'
Stack:
File "/usr/local/bin/bypy", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/bypy/bypy.py", line 3815, in main
by = ByPy(**bypyopt)
File "/usr/local/lib/python3.8/site-packages/bypy/bypy.py", line 466, in init
if not self.__load_local_json():
File "/usr/local/lib/python3.8/site-packages/bypy/bypy.py", line 941, in __load_local_json
self.pd("Error while loading baidu pcs token.\n{}".format(formatex(ex)))
File "/usr/local/lib/python3.8/site-packages/bypy/util.py", line 73, in formatex
type(ex), ex, ''.join(traceback.format_stack()))

@Thegallophorse
Copy link
Author

Please visit:
https://openapi.baidu.com/oauth/2.0/authorize?client_id=q8WE4EpCsau1oS0MplgMKNBn&response_type=code&redirect_uri=oob&scope=basic+netdisk
And authorize this app
Paste the Authorization Code here within 10 minutes.
Press [Enter] when you are done
xxxxxxxxxxxxxxxxxxx
auth_code: daa5ee2d079e8016e999e33df3eea461
Authorizing, please be patient, it may take upto 300 seconds...
Auth servers updated: {'AuthServerList': [['https://bypyoa.vercel.app/api/auth', False, 'Authorizing with the Vercel server ...'], ['https://qcfpba.api.cloudendpoint.cn/auth', False, 'Vercel server failed, Authorizing with the cloudendpoint server ...'], ['https://8.142.131.12/auth', False, 'Vercel server failed. Last resort: authorizing with the Aliyun server ...']], 'RefreshServerList': [['https://bypyoa.vercel.app/api/refresh', False, 'Refreshing with the Vercel server ...'], ['https://qcfpba.api.cloudendpoint.cn/refresh', False, 'Vercel server failed, Refreshing with the cloudendpoint server ...'], ['https://8.142.131.12/refresh', False, 'Vercel server failed. Last resort: refreshing with the Aliyun server ...']]}
Authorizing with the Vercel server ...
GET https://bypyoa.vercel.app/api/auth
actargs: None
Params: {'code': 'daa5ee2d079e8016e999e33df3eea461', 'bypy_version': '1.7.12', 'redirect_uri': 'oob'}
[19:56:12] Error accessing 'https://bypyoa.vercel.app/api/auth'
[19:56:12] Exception:
<class 'requests.exceptions.ConnectionError'> - HTTPSConnectionPool(host='bypyoa.vercel.app', port=443): Max retries exceeded with url: /api/auth?code=daa5ee2d079e8016e999e33df3eea461&bypy_version=1.7.12&redirect_uri=oob (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fe71c212700>: Failed to establish a new connection: [Errno 101] Network is unreachable'))
Stack:
File "/usr/local/bin/bypy", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/bypy/bypy.py", line 3815, in main
by = ByPy(**bypyopt)
File "/usr/local/lib/python3.8/site-packages/bypy/bypy.py", line 468, in init
result = self.__auth()
File "/usr/local/lib/python3.8/site-packages/bypy/bypy.py", line 1052, in __auth
result = self.__get(url, pars, self.__server_auth_act, retry = retry, addtoken = False)
File "/usr/local/lib/python3.8/site-packages/bypy/bypy.py", line 882, in __get
return self.__request(url, pars, act, 'GET', actargs, retry, addtoken, dumpex, **kwargs)
File "/usr/local/lib/python3.8/site-packages/bypy/bypy.py", line 860, in __request
result = self.__request_work(url, pars, act, method, actargs, addtoken, dumpex, **kwnew)
File "/usr/local/lib/python3.8/site-packages/bypy/bypy.py", line 812, in __request_work
self.__dump_exception(ex, url, pars, r, act)
File "/usr/local/lib/python3.8/site-packages/bypy/bypy.py", line 615, in __dump_exception
perr(formatex(ex))
File "/usr/local/lib/python3.8/site-packages/bypy/util.py", line 73, in formatex
type(ex), ex, ''.join(traceback.format_stack()))

[19:56:12] Function: __server_auth_act
[19:56:12] Website parameters: {'code': 'daa5ee2d079e8016e999e33df3eea461', 'bypy_version': '1.7.12', 'redirect_uri': 'oob'}
[19:56:12] Maximum number (1) of tries failed.
Vercel server failed, Authorizing with the cloudendpoint server ...
GET https://qcfpba.api.cloudendpoint.cn/auth
actargs: None
Params: {'code': 'daa5ee2d079e8016e999e33df3eea461', 'bypy_version': '1.7.12', 'redirect_uri': 'oob'}
Full URL: https://qcfpba.api.cloudendpoint.cn/auth?code=daa5ee2d079e8016e999e33df3eea461&bypy_version=1.7.12&redirect_uri=oob
HTTP Status Code: 503
Website returned JSON: {'errorCode': '503SS', 'errorMessage': 'Service Unavailable'}
[19:56:12] Error accessing 'https://qcfpba.api.cloudendpoint.cn/auth'
[19:56:12]
[19:56:12] Function: __server_auth_act
[19:56:12] Website parameters: {'code': 'daa5ee2d079e8016e999e33df3eea461', 'bypy_version': '1.7.12', 'redirect_uri': 'oob'}
[19:56:12] Full URL: https://qcfpba.api.cloudendpoint.cn/auth?code=daa5ee2d079e8016e999e33df3eea461&bypy_version=1.7.12&redirect_uri=oob
[19:56:12] HTTP Response Status Code: 503
[19:56:12] Website returned: {"errorCode":"503SS","errorMessage":"Service Unavailable"}
[19:56:12] Maximum number (1) of tries failed.
Vercel server failed. Last resort: authorizing with the Aliyun server ...
GET https://8.142.131.12/auth
actargs: None
Params: {'code': 'daa5ee2d079e8016e999e33df3eea461', 'bypy_version': '1.7.12', 'redirect_uri': 'oob'}
[19:56:19] Error accessing 'https://8.142.131.12/auth'
[19:56:19] Exception:
<class 'requests.exceptions.ConnectionError'> - HTTPSConnectionPool(host='8.142.131.12', port=443): Max retries exceeded with url: /auth?code=daa5ee2d079e8016e999e33df3eea461&bypy_version=1.7.12&redirect_uri=oob (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fe71c1aca00>: Failed to establish a new connection: [Errno 110] Connection timed out'))
Stack:
File "/usr/local/bin/bypy", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/bypy/bypy.py", line 3815, in main
by = ByPy(**bypyopt)
File "/usr/local/lib/python3.8/site-packages/bypy/bypy.py", line 468, in init
result = self.__auth()
File "/usr/local/lib/python3.8/site-packages/bypy/bypy.py", line 1052, in __auth
result = self.__get(url, pars, self.__server_auth_act, retry = retry, addtoken = False)
File "/usr/local/lib/python3.8/site-packages/bypy/bypy.py", line 882, in __get
return self.__request(url, pars, act, 'GET', actargs, retry, addtoken, dumpex, **kwargs)
File "/usr/local/lib/python3.8/site-packages/bypy/bypy.py", line 860, in __request
result = self.__request_work(url, pars, act, method, actargs, addtoken, dumpex, **kwnew)
File "/usr/local/lib/python3.8/site-packages/bypy/bypy.py", line 812, in __request_work
self.__dump_exception(ex, url, pars, r, act)
File "/usr/local/lib/python3.8/site-packages/bypy/bypy.py", line 615, in __dump_exception
perr(formatex(ex))
File "/usr/local/lib/python3.8/site-packages/bypy/util.py", line 73, in formatex
type(ex), ex, ''.join(traceback.format_stack()))

[19:56:19] Function: __server_auth_act
[19:56:19] Website parameters: {'code': 'daa5ee2d079e8016e999e33df3eea461', 'bypy_version': '1.7.12', 'redirect_uri': 'oob'}
[19:56:19] Maximum number (1) of tries failed.
[19:56:19] Fatal: All server authorizations failed.
[19:56:19] ----------------------------------------------------------------
[19:56:19] This is most likely caused by authorization errors.
Possible causes:

  • You didn't run this program for a long time (more than a month).
  • You changed your Baidu password after authorizing this program.
  • You didn't give this program the 'netdisk' access while authorizing.
  • ...
    Possible fixes:
  1. Remove the authorization token by running with the parameter '-c', and then re-run this program.
  2. If (1) still doesn't solve the problem, you may have to go to:
    https://passport.baidu.com/accountbind
    and remove the authorization of this program, and then re-run this program.
    Skip saving Hash Cache since it has not been updated.

@Thegallophorse
Copy link
Author

image
我测了一下三台服务器的接口,第一台错误码500, 第二台Service Unavailable, 第三台直接访问不到了,希望可以帮忙看一下,没有secretId真的好难搞,我见代码里面secretId是直接写到环境变量里面了,这个值未知的怎么export进去,可以私聊单发一下么,感谢

@AlbertLuk
Copy link

我同样遇到这个问题,我觉得是服务器崩了,希望作者能搭回去

@yisuo2015
Copy link

我也遇到同样的问题,试了两台电脑都一样,估计授权服务器被qiang了

@JuewenPeng
Copy link

@ZoidbergPi
Copy link

同样的问题,另外如果是楼上的方案,还是要走验证服务器的,部署验证服务器之后提示{"error_code": 150, "error_msg": "ERROR: Auth failed, please retry.\nHTTP status code: 400\nDetails: Baidu returned:\nb'{"error":"invalid_client","error_description":"Invalid client_id"}

@JuewenPeng
Copy link

我自己试的没什么问题呀

@ZoidbergPi
Copy link

不太清楚,暂时先用另一个替代了:elixonmars/BaiduPCS-Go

@houtianze
Copy link
Owner

谢谢反馈。最新版1.8应该不会有这个问题了。
之前加了三个服务器,结果字节的服务关停了,阿里的重刷过系统没运行服务,而以前挺稳定的Vercel貌似最近被墙了。。
这次应该算是一次解决这个问题了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants