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

prawcore.exceptions.ResponseException: received 401 HTTP response #41

Closed
AngelTiger90 opened this issue Feb 11, 2021 · 4 comments
Closed

Comments

@AngelTiger90
Copy link

**Hi, I follow the instruction to get the reddit API credentials

However, I still have the following error.

Could you please help me why I get the error below?**

Version 7.0.0 of praw is outdated. Version 7.1.4 was released 3 days ago. Selecting relevant data from webscraper: 0% 0/2000 [00:00<?, ?it/s] Traceback (most recent call last): File "ticker_counts.py", line 45, in <module> post.total_awards_received] for post in tqdm(new_bets, desc="Selecting relevant data from webscraper", total=WEBSCRAPER_LIMIT)] File "ticker_counts.py", line 40, in <listcomp> posts = [[post.id, File "/usr/local/lib/python3.6/dist-packages/tqdm/std.py", line 1166, in __iter__ for obj in iterable: File "/usr/local/lib/python3.6/dist-packages/praw/models/listing/generator.py", line 61, in __next__ self._next_batch() File "/usr/local/lib/python3.6/dist-packages/praw/models/listing/generator.py", line 71, in _next_batch self._listing = self._reddit.get(self.url, params=self.params) File "/usr/local/lib/python3.6/dist-packages/praw/reddit.py", line 490, in get return self._objectify_request(method="GET", params=params, path=path) File "/usr/local/lib/python3.6/dist-packages/praw/reddit.py", line 574, in _objectify_request data=data, files=files, method=method, params=params, path=path File "/usr/local/lib/python3.6/dist-packages/praw/reddit.py", line 732, in request timeout=self.config.timeout, File "/usr/local/lib/python3.6/dist-packages/prawcore/sessions.py", line 339, in request url=url, File "/usr/local/lib/python3.6/dist-packages/prawcore/sessions.py", line 235, in _request_with_retries url, File "/usr/local/lib/python3.6/dist-packages/prawcore/sessions.py", line 195, in _make_request timeout=timeout, File "/usr/local/lib/python3.6/dist-packages/prawcore/rate_limit.py", line 35, in call kwargs["headers"] = set_header_callback() File "/usr/local/lib/python3.6/dist-packages/prawcore/sessions.py", line 282, in _set_header_callback self._authorizer.refresh() File "/usr/local/lib/python3.6/dist-packages/prawcore/auth.py", line 325, in refresh self._request_token(grant_type="client_credentials") File "/usr/local/lib/python3.6/dist-packages/prawcore/auth.py", line 153, in _request_token response = self._authenticator._post(url, **data) File "/usr/local/lib/python3.6/dist-packages/prawcore/auth.py", line 36, in _post raise ResponseException(response) prawcore.exceptions.ResponseException: received 401 HTTP response

@mpagels
Copy link
Contributor

mpagels commented Feb 11, 2021

eceived 401 HTTP response
401 is an unauthorized error. Maybe your praw.ini is wrong?

@iam-abbas
Copy link
Owner

It means the your credentials are wrong

@AngelTiger90
Copy link
Author

Hi, I create multiple apps and none is working.

Don't really understand why.

@AngelTiger90
Copy link
Author

Hi,

It is my bad. I put the id and secret code in: ''

I remove them all and it work fine with Google colab.

Thanks

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

3 participants