“invalid_grant error processing request” while making a reddit bot The 2019 Stack Overflow Developer Survey Results Are InI get an error while making a reddit bot using prawWhat does this Python requests error mean?Error when using requests In Python2.7Can't call praw.helpersPython pandas datareader isn't workingSSL Certificate error while doing a request via pythonLogin to Twitter using requests returns “too many redirects”Django Error While Submitting FormsDjango AttributeError: Form object has no attribute '_errors'Unable to connect to tableau server 10.5 using TableauServerClient python library
Why couldn't they take pictures of a closer black hole?
How can I add encounters in the Lost Mine of Phandelver campaign without giving PCs too much XP?
Is Cinnamon a desktop environment or a window manager? (Or both?)
How can I define good in a religion that claims no moral authority?
The phrase "to the numbers born"?
What is this business jet?
Is it a good practice to use a static variable in a Test Class and use that in the actual class instead of Test.isRunningTest()?
If I score a critical hit on an 18 or higher, what are my chances of getting a critical hit if I roll 3d20?
Deal with toxic manager when you can't quit
How do I free up internal storage if I don't have any apps downloaded?
What do hard-Brexiteers want with respect to the Irish border?
Are spiders unable to hurt humans, especially very small spiders?
What is the most efficient way to store a numeric range?
How do PCB vias affect signal quality?
Falsification in Math vs Science
Likelihood that a superbug or lethal virus could come from a landfill
Ubuntu Server install with full GUI
Geography at the pixel level
A word that means fill it to the required quantity
Is it safe to harvest rainwater that fell on solar panels?
What is the meaning of Triage in Cybersec world?
Can an undergraduate be advised by a professor who is very far away?
Does HR tell a hiring manager about salary negotiations?
Will it cause any balance problems to have PCs level up and gain the benefits of a long rest mid-fight?
“invalid_grant error processing request” while making a reddit bot
The 2019 Stack Overflow Developer Survey Results Are InI get an error while making a reddit bot using prawWhat does this Python requests error mean?Error when using requests In Python2.7Can't call praw.helpersPython pandas datareader isn't workingSSL Certificate error while doing a request via pythonLogin to Twitter using requests returns “too many redirects”Django Error While Submitting FormsDjango AttributeError: Form object has no attribute '_errors'Unable to connect to tableau server 10.5 using TableauServerClient python library
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
Im making a reddit bot that replies something to a specific comment.
But Im getting this error : invalid_grant error processing request
and I can't find the solution.
here is my code, Im using Python.
import praw
import time
import config
def login():
r = praw.Reddit(user_agent = "test bot",
username = config.username,
password = config.password,
client_id = config.client_id,
client_secret = config.client_secret)
print("logged in")
return r
cache = []
def run_bot(r):
subreddit = r.subreddit("Test")
comments = subreddit.get_comments(limit=25)
for comment in comments:
comment_text = comment.body.lower()
if "xD" in comment_text and comment.id not in cache:
comment.reply("xD")
cache.append(comment.id)
while True:
r = login()
run_bot(r)
time.sleep(5)
traceback:
logged in
Traceback (most recent call last):
File "xdbot.py", line 28, in <module>
run_bot(r)
File "xdbot.py", line 19, in run_bot
comments = subreddit.get_comments(limit=25)
File "D:ProgrammingPhytonlibsite-packagesprawmodelsredditbase.py", line 31, in __getattr__
self._fetch()
File "D:ProgrammingPhytonlibsite-packagesprawmodelsredditbase.py", line 66, in _fetch
params=self._info_params)
File "D:ProgrammingPhytonlibsite-packagesprawreddit.py", line 367, in get
data = self.request('GET', path, params=params)
File "D:ProgrammingPhytonlibsite-packagesprawreddit.py", line 451, in request
params=params)
File "D:ProgrammingPhytonlibsite-packagesprawcoresessions.py", line 174, in request
params=params, url=url)
File "D:ProgrammingPhytonlibsite-packagesprawcoresessions.py", line 108, in _request_with_retries
data, files, json, method, params, retries, url)
File "D:ProgrammingPhytonlibsite-packagesprawcoresessions.py", line 93, in _make_request
params=params)
File "D:ProgrammingPhytonlibsite-packagesprawcorerate_limit.py", line 32, in call
kwargs['headers'] = set_header_callback()
File "D:ProgrammingPhytonlibsite-packagesprawcoresessions.py", line 134, in _set_header_callback
self._authorizer.refresh()
File "D:ProgrammingPhytonlibsite-packagesprawcoreauth.py", line 328, in refresh
password=self._password)
File "D:ProgrammingPhytonlibsite-packagesprawcoreauth.py", line 142, in _request_token
payload.get('error_description'))
prawcore.exceptions.OAuthException: invalid_grant error processing request
python
add a comment |
Im making a reddit bot that replies something to a specific comment.
But Im getting this error : invalid_grant error processing request
and I can't find the solution.
here is my code, Im using Python.
import praw
import time
import config
def login():
r = praw.Reddit(user_agent = "test bot",
username = config.username,
password = config.password,
client_id = config.client_id,
client_secret = config.client_secret)
print("logged in")
return r
cache = []
def run_bot(r):
subreddit = r.subreddit("Test")
comments = subreddit.get_comments(limit=25)
for comment in comments:
comment_text = comment.body.lower()
if "xD" in comment_text and comment.id not in cache:
comment.reply("xD")
cache.append(comment.id)
while True:
r = login()
run_bot(r)
time.sleep(5)
traceback:
logged in
Traceback (most recent call last):
File "xdbot.py", line 28, in <module>
run_bot(r)
File "xdbot.py", line 19, in run_bot
comments = subreddit.get_comments(limit=25)
File "D:ProgrammingPhytonlibsite-packagesprawmodelsredditbase.py", line 31, in __getattr__
self._fetch()
File "D:ProgrammingPhytonlibsite-packagesprawmodelsredditbase.py", line 66, in _fetch
params=self._info_params)
File "D:ProgrammingPhytonlibsite-packagesprawreddit.py", line 367, in get
data = self.request('GET', path, params=params)
File "D:ProgrammingPhytonlibsite-packagesprawreddit.py", line 451, in request
params=params)
File "D:ProgrammingPhytonlibsite-packagesprawcoresessions.py", line 174, in request
params=params, url=url)
File "D:ProgrammingPhytonlibsite-packagesprawcoresessions.py", line 108, in _request_with_retries
data, files, json, method, params, retries, url)
File "D:ProgrammingPhytonlibsite-packagesprawcoresessions.py", line 93, in _make_request
params=params)
File "D:ProgrammingPhytonlibsite-packagesprawcorerate_limit.py", line 32, in call
kwargs['headers'] = set_header_callback()
File "D:ProgrammingPhytonlibsite-packagesprawcoresessions.py", line 134, in _set_header_callback
self._authorizer.refresh()
File "D:ProgrammingPhytonlibsite-packagesprawcoreauth.py", line 328, in refresh
password=self._password)
File "D:ProgrammingPhytonlibsite-packagesprawcoreauth.py", line 142, in _request_token
payload.get('error_description'))
prawcore.exceptions.OAuthException: invalid_grant error processing request
python
Please add your traceback
– Gerrat
Jun 23 '17 at 20:35
i added the traceback
– l0ckw00d
Jun 24 '17 at 9:05
If, after logging in, you run:print(r.user.me())
, does it return the same as your config.username?
– Gerrat
Jun 25 '17 at 0:18
it doesn't print anything, and i still get the same error
– l0ckw00d
Jun 25 '17 at 13:16
add a comment |
Im making a reddit bot that replies something to a specific comment.
But Im getting this error : invalid_grant error processing request
and I can't find the solution.
here is my code, Im using Python.
import praw
import time
import config
def login():
r = praw.Reddit(user_agent = "test bot",
username = config.username,
password = config.password,
client_id = config.client_id,
client_secret = config.client_secret)
print("logged in")
return r
cache = []
def run_bot(r):
subreddit = r.subreddit("Test")
comments = subreddit.get_comments(limit=25)
for comment in comments:
comment_text = comment.body.lower()
if "xD" in comment_text and comment.id not in cache:
comment.reply("xD")
cache.append(comment.id)
while True:
r = login()
run_bot(r)
time.sleep(5)
traceback:
logged in
Traceback (most recent call last):
File "xdbot.py", line 28, in <module>
run_bot(r)
File "xdbot.py", line 19, in run_bot
comments = subreddit.get_comments(limit=25)
File "D:ProgrammingPhytonlibsite-packagesprawmodelsredditbase.py", line 31, in __getattr__
self._fetch()
File "D:ProgrammingPhytonlibsite-packagesprawmodelsredditbase.py", line 66, in _fetch
params=self._info_params)
File "D:ProgrammingPhytonlibsite-packagesprawreddit.py", line 367, in get
data = self.request('GET', path, params=params)
File "D:ProgrammingPhytonlibsite-packagesprawreddit.py", line 451, in request
params=params)
File "D:ProgrammingPhytonlibsite-packagesprawcoresessions.py", line 174, in request
params=params, url=url)
File "D:ProgrammingPhytonlibsite-packagesprawcoresessions.py", line 108, in _request_with_retries
data, files, json, method, params, retries, url)
File "D:ProgrammingPhytonlibsite-packagesprawcoresessions.py", line 93, in _make_request
params=params)
File "D:ProgrammingPhytonlibsite-packagesprawcorerate_limit.py", line 32, in call
kwargs['headers'] = set_header_callback()
File "D:ProgrammingPhytonlibsite-packagesprawcoresessions.py", line 134, in _set_header_callback
self._authorizer.refresh()
File "D:ProgrammingPhytonlibsite-packagesprawcoreauth.py", line 328, in refresh
password=self._password)
File "D:ProgrammingPhytonlibsite-packagesprawcoreauth.py", line 142, in _request_token
payload.get('error_description'))
prawcore.exceptions.OAuthException: invalid_grant error processing request
python
Im making a reddit bot that replies something to a specific comment.
But Im getting this error : invalid_grant error processing request
and I can't find the solution.
here is my code, Im using Python.
import praw
import time
import config
def login():
r = praw.Reddit(user_agent = "test bot",
username = config.username,
password = config.password,
client_id = config.client_id,
client_secret = config.client_secret)
print("logged in")
return r
cache = []
def run_bot(r):
subreddit = r.subreddit("Test")
comments = subreddit.get_comments(limit=25)
for comment in comments:
comment_text = comment.body.lower()
if "xD" in comment_text and comment.id not in cache:
comment.reply("xD")
cache.append(comment.id)
while True:
r = login()
run_bot(r)
time.sleep(5)
traceback:
logged in
Traceback (most recent call last):
File "xdbot.py", line 28, in <module>
run_bot(r)
File "xdbot.py", line 19, in run_bot
comments = subreddit.get_comments(limit=25)
File "D:ProgrammingPhytonlibsite-packagesprawmodelsredditbase.py", line 31, in __getattr__
self._fetch()
File "D:ProgrammingPhytonlibsite-packagesprawmodelsredditbase.py", line 66, in _fetch
params=self._info_params)
File "D:ProgrammingPhytonlibsite-packagesprawreddit.py", line 367, in get
data = self.request('GET', path, params=params)
File "D:ProgrammingPhytonlibsite-packagesprawreddit.py", line 451, in request
params=params)
File "D:ProgrammingPhytonlibsite-packagesprawcoresessions.py", line 174, in request
params=params, url=url)
File "D:ProgrammingPhytonlibsite-packagesprawcoresessions.py", line 108, in _request_with_retries
data, files, json, method, params, retries, url)
File "D:ProgrammingPhytonlibsite-packagesprawcoresessions.py", line 93, in _make_request
params=params)
File "D:ProgrammingPhytonlibsite-packagesprawcorerate_limit.py", line 32, in call
kwargs['headers'] = set_header_callback()
File "D:ProgrammingPhytonlibsite-packagesprawcoresessions.py", line 134, in _set_header_callback
self._authorizer.refresh()
File "D:ProgrammingPhytonlibsite-packagesprawcoreauth.py", line 328, in refresh
password=self._password)
File "D:ProgrammingPhytonlibsite-packagesprawcoreauth.py", line 142, in _request_token
payload.get('error_description'))
prawcore.exceptions.OAuthException: invalid_grant error processing request
python
python
edited Jun 24 '17 at 9:04
l0ckw00d
asked Jun 23 '17 at 20:17
l0ckw00dl0ckw00d
124
124
Please add your traceback
– Gerrat
Jun 23 '17 at 20:35
i added the traceback
– l0ckw00d
Jun 24 '17 at 9:05
If, after logging in, you run:print(r.user.me())
, does it return the same as your config.username?
– Gerrat
Jun 25 '17 at 0:18
it doesn't print anything, and i still get the same error
– l0ckw00d
Jun 25 '17 at 13:16
add a comment |
Please add your traceback
– Gerrat
Jun 23 '17 at 20:35
i added the traceback
– l0ckw00d
Jun 24 '17 at 9:05
If, after logging in, you run:print(r.user.me())
, does it return the same as your config.username?
– Gerrat
Jun 25 '17 at 0:18
it doesn't print anything, and i still get the same error
– l0ckw00d
Jun 25 '17 at 13:16
Please add your traceback
– Gerrat
Jun 23 '17 at 20:35
Please add your traceback
– Gerrat
Jun 23 '17 at 20:35
i added the traceback
– l0ckw00d
Jun 24 '17 at 9:05
i added the traceback
– l0ckw00d
Jun 24 '17 at 9:05
If, after logging in, you run:
print(r.user.me())
, does it return the same as your config.username?– Gerrat
Jun 25 '17 at 0:18
If, after logging in, you run:
print(r.user.me())
, does it return the same as your config.username?– Gerrat
Jun 25 '17 at 0:18
it doesn't print anything, and i still get the same error
– l0ckw00d
Jun 25 '17 at 13:16
it doesn't print anything, and i still get the same error
– l0ckw00d
Jun 25 '17 at 13:16
add a comment |
1 Answer
1
active
oldest
votes
Double check your credentials as this note says.
Remember that the username is your reddit's account name, not the bot's name.
Oh yeah right, thank you for the solution.
– l0ckw00d
Jul 22 '17 at 19:40
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44729350%2finvalid-grant-error-processing-request-while-making-a-reddit-bot%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Double check your credentials as this note says.
Remember that the username is your reddit's account name, not the bot's name.
Oh yeah right, thank you for the solution.
– l0ckw00d
Jul 22 '17 at 19:40
add a comment |
Double check your credentials as this note says.
Remember that the username is your reddit's account name, not the bot's name.
Oh yeah right, thank you for the solution.
– l0ckw00d
Jul 22 '17 at 19:40
add a comment |
Double check your credentials as this note says.
Remember that the username is your reddit's account name, not the bot's name.
Double check your credentials as this note says.
Remember that the username is your reddit's account name, not the bot's name.
answered Jul 21 '17 at 15:40
zEaK47zEaK47
241
241
Oh yeah right, thank you for the solution.
– l0ckw00d
Jul 22 '17 at 19:40
add a comment |
Oh yeah right, thank you for the solution.
– l0ckw00d
Jul 22 '17 at 19:40
Oh yeah right, thank you for the solution.
– l0ckw00d
Jul 22 '17 at 19:40
Oh yeah right, thank you for the solution.
– l0ckw00d
Jul 22 '17 at 19:40
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44729350%2finvalid-grant-error-processing-request-while-making-a-reddit-bot%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Please add your traceback
– Gerrat
Jun 23 '17 at 20:35
i added the traceback
– l0ckw00d
Jun 24 '17 at 9:05
If, after logging in, you run:
print(r.user.me())
, does it return the same as your config.username?– Gerrat
Jun 25 '17 at 0:18
it doesn't print anything, and i still get the same error
– l0ckw00d
Jun 25 '17 at 13:16