RedditVideoMakerBot icon indicating copy to clipboard operation
RedditVideoMakerBot copied to clipboard

invalid_grant error

Open vradinolfi opened this issue 4 years ago • 12 comments

had some issues getting dependencies to pull in but now i'm running into this and a bit stumped:


  Thanks for using this tool! 😊 Feel free to contribute to this project on GitHub!. If you have any questions, feel
                             free to reach out to me on Twitter or submit a GitHub issue.


┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Getting AskReddit threads...                                                                                        │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Traceback (most recent call last):
  File "C:\Users\vince\Desktop\RedditBot\RedditVideoMakerBot\main.py", line 16, in <module>
    reddit_object = get_askreddit_threads()
  File "C:\Users\vince\Desktop\RedditBot\RedditVideoMakerBot\reddit\askreddit.py", line 26, in get_askreddit_threads
    submission = list(threads)[random.randrange(0, 25)]
  File "C:\Users\vince\AppData\Roaming\Python\Python310\site-packages\praw\models\listing\generator.py", line 63, in __next__
    self._next_batch()
  File "C:\Users\vince\AppData\Roaming\Python\Python310\site-packages\praw\models\listing\generator.py", line 89, in _next_batch
    self._listing = self._reddit.get(self.url, params=self.params)
  File "C:\Users\vince\AppData\Roaming\Python\Python310\site-packages\praw\util\deprecate_args.py", line 43, in wrapped
    return func(**dict(zip(_old_args, args)), **kwargs)
  File "C:\Users\vince\AppData\Roaming\Python\Python310\site-packages\praw\reddit.py", line 634, in get
    return self._objectify_request(method="GET", params=params, path=path)
  File "C:\Users\vince\AppData\Roaming\Python\Python310\site-packages\praw\reddit.py", line 739, in _objectify_request
    self.request(
  File "C:\Users\vince\AppData\Roaming\Python\Python310\site-packages\praw\util\deprecate_args.py", line 43, in wrapped
    return func(**dict(zip(_old_args, args)), **kwargs)
  File "C:\Users\vince\AppData\Roaming\Python\Python310\site-packages\praw\reddit.py", line 941, in request
    return self._core.request(
  File "C:\Users\vince\AppData\Roaming\Python\Python310\site-packages\prawcore\sessions.py", line 330, in request
    return self._request_with_retries(
  File "C:\Users\vince\AppData\Roaming\Python\Python310\site-packages\prawcore\sessions.py", line 228, in _request_with_retries
    response, saved_exception = self._make_request(
  File "C:\Users\vince\AppData\Roaming\Python\Python310\site-packages\prawcore\sessions.py", line 185, in _make_request
    response = self._rate_limiter.call(
  File "C:\Users\vince\AppData\Roaming\Python\Python310\site-packages\prawcore\rate_limit.py", line 33, in call
    kwargs["headers"] = set_header_callback()
  File "C:\Users\vince\AppData\Roaming\Python\Python310\site-packages\prawcore\sessions.py", line 283, in _set_header_callback
    self._authorizer.refresh()
  File "C:\Users\vince\AppData\Roaming\Python\Python310\site-packages\prawcore\auth.py", line 425, in refresh
    self._request_token(
  File "C:\Users\vince\AppData\Roaming\Python\Python310\site-packages\prawcore\auth.py", line 158, in _request_token
    raise OAuthException(
prawcore.exceptions.OAuthException: invalid_grant error processing request```

vradinolfi avatar Jun 01 '22 05:06 vradinolfi

What version of python are you using? You may need to uninstall python and reinstall python fully.

tedbrine avatar Jun 01 '22 05:06 tedbrine

i use python 3.10

notafile1 avatar Jun 01 '22 06:06 notafile1

and got it too

notafile1 avatar Jun 01 '22 06:06 notafile1

You good now?

tedbrine avatar Jun 01 '22 06:06 tedbrine

I'm getting 3.10.4

notafile1 avatar Jun 01 '22 06:06 notafile1

You good now?

nope

notafile1 avatar Jun 01 '22 06:06 notafile1

Install P3.8

tedbrine avatar Jun 01 '22 06:06 tedbrine

Install P3.8

can you send me the link?

notafile1 avatar Jun 01 '22 07:06 notafile1

im on https://www.python.org/downloads/release/python-380/

notafile1 avatar Jun 01 '22 07:06 notafile1

Your authentication is wrong. Have you set the required values in .env?

callumio avatar Jun 01 '22 10:06 callumio

Your authentication is wrong. Have you set the required values in .env?

I believe so, I have two factor on for reddit, not sure if that changes things but otherwise my keys should be correct and I set it up as a "script." I'm on python 3.10 but I will try 3.8 as well

vradinolfi avatar Jun 02 '22 01:06 vradinolfi

Your authentication is wrong. Have you set the required values in .env?

I believe so, I have two factor on for reddit, not sure if that changes things but otherwise my keys should be correct and I set it up as a "script." I'm on python 3.10 but I will try 3.8 as well

2FA support has been merged, closing this for now - if it doesn't work for the same reason, feel free to reopen or make a new issue

callumio avatar Jun 04 '22 13:06 callumio