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

无法获得授权 #689

Open
adfad1 opened this issue May 25, 2024 · 1 comment
Open

无法获得授权 #689

adfad1 opened this issue May 25, 2024 · 1 comment

Comments

@adfad1
Copy link

adfad1 commented May 25, 2024

一直无法获得授权,报这个错,该怎么解决呢

Authorizing, please be patient, it may take upto 300 seconds...
<D> POST https://openapi.baidu.com/oauth/2.0/token
<D> actargs: None
<D> Params: {'grant_type': 'authorization_code', 'code': 'dfce6625df77190d07af36821e2135bc', 'client_id': 'q8WE4EpCsau1oS0MplgMKNBn', 'client_secret': 'PA4MhwB5RE7DacKtoP2i8ikCnNzAqYTD', 'redirect_uri': 'oob'}
<E> [12:18:36] Error accessing 'https://openapi.baidu.com/oauth/2.0/token'
<E> [12:18:36] Exception:
<class 'requests.exceptions.ConnectionError'> - HTTPSConnectionPool(host='openapi.baidu.com', port=443): Max retries exceeded with url: /oauth/2.0/token?grant_type=authorization_code&code=dfce6625df77190d07af36821e2135bc&client_id=q8WE4EpCsau1oS0MplgMKNBn&client_secret=PA4MhwB5RE7DacKtoP2i8ikCnNzAqYTD&redirect_uri=oob (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7faddb2a2f10>: Failed to establish a new connection: [Errno 110] Connection timed out'))
Stack:
  File "/raid/data/zhouy/anaconda3/envs/pc24/bin/bypy", line 8, in <module>
    sys.exit(main())
  File "/raid/data/zhouy/anaconda3/envs/pc24/lib/python3.9/site-packages/bypy/bypy.py", line 3819, in main
    by = ByPy(**bypyopt)
  File "/raid/data/zhouy/anaconda3/envs/pc24/lib/python3.9/site-packages/bypy/bypy.py", line 468, in __init__
    result = self.__auth()
  File "/raid/data/zhouy/anaconda3/envs/pc24/lib/python3.9/site-packages/bypy/bypy.py", line 1072, in __auth
    result = self.__post(const.TokenUrl, pars, self.__local_auth_act, addtoken = False)
  File "/raid/data/zhouy/anaconda3/envs/pc24/lib/python3.9/site-packages/bypy/bypy.py", line 885, in __post
    return self.__request(url, pars, act, 'POST', actargs, retry, addtoken, dumpex, **kwargs)
  File "/raid/data/zhouy/anaconda3/envs/pc24/lib/python3.9/site-packages/bypy/bypy.py", line 860, in __request
    result = self.__request_work(url, pars, act, method, actargs, addtoken, dumpex, **kwnew)
  File "/raid/data/zhouy/anaconda3/envs/pc24/lib/python3.9/site-packages/bypy/bypy.py", line 812, in __request_work
    self.__dump_exception(ex, url, pars, r, act)
  File "/raid/data/zhouy/anaconda3/envs/pc24/lib/python3.9/site-packages/bypy/bypy.py", line 615, in __dump_exception
    perr(formatex(ex))
  File "/raid/data/zhouy/anaconda3/envs/pc24/lib/python3.9/site-packages/bypy/util.py", line 73, in formatex
    type(ex), ex, ''.join(traceback.format_stack()))

<E> [12:18:36] Function: __local_auth_act
<E> [12:18:36] Website parameters: {'grant_type': 'authorization_code', 'code': 'dfce6625df77190d07af36821e2135bc', 'client_id': 'q8WE4EpCsau1oS0MplgMKNBn', 'client_secret': 'PA4MhwB5RE7DacKtoP2i8ikCnNzAqYTD', 'redirect_uri': 'oob'}
<E> [12:18:36] Waiting 10 seconds before retrying...
<E> [12:18:46] Request Try #2 / 5
<D> POST https://openapi.baidu.com/oauth/2.0/token
<D> actargs: None
<D> Params: {'grant_type': 'authorization_code', 'code': 'dfce6625df77190d07af36821e2135bc', 'client_id': 'q8WE4EpCsau1oS0MplgMKNBn', 'client_secret': 'PA4MhwB5RE7DacKtoP2i8ikCnNzAqYTD', 'redirect_uri': 'oob'}
<E> [12:20:55] Error accessing 'https://openapi.baidu.com/oauth/2.0/token'
<E> [12:20:55] Exception:
<class 'requests.exceptions.ConnectionError'> - HTTPSConnectionPool(host='openapi.baidu.com', port=443): Max retries exceeded with url: /oauth/2.0/token?grant_type=authorization_code&code=dfce6625df77190d07af36821e2135bc&client_id=q8WE4EpCsau1oS0MplgMKNBn&client_secret=PA4MhwB5RE7DacKtoP2i8ikCnNzAqYTD&redirect_uri=oob (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7faddb21b9a0>: Failed to establish a new connection: [Errno 110] Connection timed out'))
Stack:
  File "/raid/data/zhouy/anaconda3/envs/pc24/bin/bypy", line 8, in <module>
    sys.exit(main())
  File "/raid/data/zhouy/anaconda3/envs/pc24/lib/python3.9/site-packages/bypy/bypy.py", line 3819, in main
    by = ByPy(**bypyopt)
  File "/raid/data/zhouy/anaconda3/envs/pc24/lib/python3.9/site-packages/bypy/bypy.py", line 468, in __init__
    result = self.__auth()
  File "/raid/data/zhouy/anaconda3/envs/pc24/lib/python3.9/site-packages/bypy/bypy.py", line 1072, in __auth
    result = self.__post(const.TokenUrl, pars, self.__local_auth_act, addtoken = False)
  File "/raid/data/zhouy/anaconda3/envs/pc24/lib/python3.9/site-packages/bypy/bypy.py", line 885, in __post
    return self.__request(url, pars, act, 'POST', actargs, retry, addtoken, dumpex, **kwargs)
  File "/raid/data/zhouy/anaconda3/envs/pc24/lib/python3.9/site-packages/bypy/bypy.py", line 860, in __request
    result = self.__request_work(url, pars, act, method, actargs, addtoken, dumpex, **kwnew)
  File "/raid/data/zhouy/anaconda3/envs/pc24/lib/python3.9/site-packages/bypy/bypy.py", line 812, in __request_work
    self.__dump_exception(ex, url, pars, r, act)
  File "/raid/data/zhouy/anaconda3/envs/pc24/lib/python3.9/site-packages/bypy/bypy.py", line 615, in __dump_exception
    perr(formatex(ex))
  File "/raid/data/zhouy/anaconda3/envs/pc24/lib/python3.9/site-packages/bypy/util.py", line 73, in formatex
    type(ex), ex, ''.join(traceback.format_stack()))

<E> [12:20:55] Function: __local_auth_act
<E> [12:20:55] Website parameters: {'grant_type': 'authorization_code', 'code': 'dfce6625df77190d07af36821e2135bc', 'client_id': 'q8WE4EpCsau1oS0MplgMKNBn', 'client_secret': 'PA4MhwB5RE7DacKtoP2i8ikCnNzAqYTD', 'redirect_uri': 'oob'}
<E> [12:20:55] Waiting 20 seconds before retrying...
<E> [12:21:15] Request Try #3 / 5
<D> POST https://openapi.baidu.com/oauth/2.0/token
<D> actargs: None
<D> Params: {'grant_type': 'authorization_code', 'code': 'dfce6625df77190d07af36821e2135bc', 'client_id': 'q8WE4EpCsau1oS0MplgMKNBn', 'client_secret': 'PA4MhwB5RE7DacKtoP2i8ikCnNzAqYTD', 'redirect_uri': 'oob'}
@houtianze
Copy link
Owner

Connection time out 网络超时,这个是网络问题。

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

2 participants