“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;








1















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









share|improve this question
























  • 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

















1















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









share|improve this question
























  • 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













1












1








1


0






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









share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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

















  • 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












1 Answer
1






active

oldest

votes


















0














Double check your credentials as this note says.



Remember that the username is your reddit's account name, not the bot's name.






share|improve this answer























  • Oh yeah right, thank you for the solution.

    – l0ckw00d
    Jul 22 '17 at 19:40











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
);



);













draft saved

draft discarded


















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









0














Double check your credentials as this note says.



Remember that the username is your reddit's account name, not the bot's name.






share|improve this answer























  • Oh yeah right, thank you for the solution.

    – l0ckw00d
    Jul 22 '17 at 19:40















0














Double check your credentials as this note says.



Remember that the username is your reddit's account name, not the bot's name.






share|improve this answer























  • Oh yeah right, thank you for the solution.

    – l0ckw00d
    Jul 22 '17 at 19:40













0












0








0







Double check your credentials as this note says.



Remember that the username is your reddit's account name, not the bot's name.






share|improve this answer













Double check your credentials as this note says.



Remember that the username is your reddit's account name, not the bot's name.







share|improve this answer












share|improve this answer



share|improve this answer










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

















  • 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



















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved