-
-
Notifications
You must be signed in to change notification settings - Fork 975
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
oauth reddit attributeerror #1603
Comments
The |
should i close the issue right now or wait till issue with reddit oauth fixed? |
I'd wait till the Reddit error itself is fixed. What error message do you get? |
$ gallery-dl oauth:reddit --verbose [gallery-dl][debug] Version 1.18.0-dev - Git HEAD: bd05b956
[gallery-dl][debug] Python 3.9.5 - Linux-5.11.0-18-generic-x86_64-with-glibc2.33
[gallery-dl][debug] requests 2.25.1 - urllib3 1.26.4
[gallery-dl][debug] Starting DownloadJob for 'oauth:reddit'
[oauth][debug] Using OAuthReddit for 'oauth:reddit'
Waiting for response. (Cancel with Ctrl+c)
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.reddit.com:443
[urllib3.connectionpool][debug] https://www.reddit.com:443 "POST /api/v1/access_token HTTP/1.1" 401 41
Remote server reported an error:
{'message': 'Unauthorized', 'error': 401} |
The issue is that for gallery-dl/gallery_dl/extractor/oauth.py Line 257 in ff8d0d7
|
so i tried edit above section self.session.headers["User-Agent"] = \
self.oauth_config("user-agent", reddit.RedditAPI.USER_AGENT) result of first try $ gallery-dl oauth:reddit --verbose [gallery-dl][debug] Version 1.18.0-dev - Git HEAD: bd05b956
[gallery-dl][debug] Python 3.9.5 - Linux-5.11.0-18-generic-x86_64-with-glibc2.33
[gallery-dl][debug] requests 2.25.1 - urllib3 1.26.4
[gallery-dl][debug] Starting DownloadJob for 'oauth:reddit'
[oauth][debug] Using OAuthReddit for 'oauth:reddit'
Waiting for response. (Cancel with Ctrl+c)
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.reddit.com:443
[oauth][error] Unable to download data: ConnectionError: HTTPSConnectionPool(host='www.reddit.com', port=443): Max retries exceeded with url: /api/v1/access_token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ff1fa4fc9a0>: Failed to establish a new connection: [Errno 110] Connection timed out'))
[oauth][debug]
Traceback (most recent call last):
File "/home/r3r/.local/pipx/venvs/gallery-dl/lib/python3.9/site-packages/urllib3/connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "/home/r3r/.local/pipx/venvs/gallery-dl/lib/python3.9/site-packages/urllib3/util/connection.py", line 96, in create_connection
raise err
File "/home/r3r/.local/pipx/venvs/gallery-dl/lib/python3.9/site-packages/urllib3/util/connection.py", line 86, in create_connection
sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/r3r/.local/pipx/venvs/gallery-dl/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/home/r3r/.local/pipx/venvs/gallery-dl/lib/python3.9/site-packages/urllib3/connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "/home/r3r/.local/pipx/venvs/gallery-dl/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
conn.connect()
File "/home/r3r/.local/pipx/venvs/gallery-dl/lib/python3.9/site-packages/urllib3/connection.py", line 353, in connect
conn = self._new_conn()
File "/home/r3r/.local/pipx/venvs/gallery-dl/lib/python3.9/site-packages/urllib3/connection.py", line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7ff1fa4fc9a0>: Failed to establish a new connection: [Errno 110] Connection timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/r3r/.local/pipx/venvs/gallery-dl/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/home/r3r/.local/pipx/venvs/gallery-dl/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/home/r3r/.local/pipx/venvs/gallery-dl/lib/python3.9/site-packages/urllib3/util/retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.reddit.com', port=443): Max retries exceeded with url: /api/v1/access_token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ff1fa4fc9a0>: Failed to establish a new connection: [Errno 110] Connection timed out'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/r3r/git/gallery-dl/gallery_dl/job.py", line 75, in run
for msg in self.extractor:
File "/home/r3r/git/gallery-dl/gallery_dl/extractor/oauth.py", line 259, in items
self._oauth2_authorization_code_grant(
File "/home/r3r/git/gallery-dl/gallery_dl/extractor/oauth.py", line 157, in _oauth2_authorization_code_grant
data = self.session.post(token_url, data=data, auth=auth).json()
File "/home/r3r/.local/pipx/venvs/gallery-dl/lib/python3.9/site-packages/requests/sessions.py", line 590, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/home/r3r/.local/pipx/venvs/gallery-dl/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/home/r3r/.local/pipx/venvs/gallery-dl/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/home/r3r/.local/pipx/venvs/gallery-dl/lib/python3.9/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.reddit.com', port=443): Max retries exceeded with url: /api/v1/access_token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ff1fa4fc9a0>: Failed to establish a new connection: [Errno 110] Connection timed out')) after that the same error as above $ gallery-dl oauth:reddit --verbose [gallery-dl][debug] Version 1.18.0-dev - Git HEAD: bd05b956
[gallery-dl][debug] Python 3.9.5 - Linux-5.11.0-18-generic-x86_64-with-glibc2.33
[gallery-dl][debug] requests 2.25.1 - urllib3 1.26.4
[gallery-dl][debug] Starting DownloadJob for 'oauth:reddit'
[oauth][debug] Using OAuthReddit for 'oauth:reddit'
Waiting for response. (Cancel with Ctrl+c)
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.reddit.com:443
[urllib3.connectionpool][debug] https://www.reddit.com:443 "POST /api/v1/access_token HTTP/1.1" 401 41
Remote server reported an error:
{'message': 'Unauthorized', 'error': 401} |
So I registered a new test reddit application and tried it with that Try it without a config file ( { "client-id": "YOUR_CLIENT_ID" } (and sorry for taking so long to get back to this) |
i tried and then i tried you can close this issue and i will use gallery-dl client id for now |
As the issue opener, you can close this on your own. |
The text was updated successfully, but these errors were encountered: