Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

6
[PRAW] Keep getting prawcore.exceptions.ResponseException: received 401 HTTP response error even tho the bot has worked perfectly fine for many months. Credentials are correct and I am getting a headache trying to figure this out. Any ideas?
Post Flair (click to view more posts with a particular flair)
Author Summary
Python_Child is in PRAW
Post Body

Hi there, one of my scripts I use which allows users to pin a comment on their post using a command is no longer working for me. This script worked fine for months now but in the last 2 weeks I keep getting a "prawcore.exceptions.ResponseException: received 401 HTTP response" error and the script refuses to work. All credientials are fine, the account is not suspended. I even tried to run the script through another account and same error

Here is the console in detail

https://pastebin.com/CzjSJa48

Here is my code. My config file with the creditals are in the same folder that the script runs

https://pastebin.com/kM9W026v

I hope I am in the right place for help. This has been very frustrating to fix. Hopefully it is an easy solution

Edit: codeblock isn't working for me so resorted to pastebin

Comments

I'm not familiar with PRAW specifically, but I ran into an issue a few weeks ago that sounds similar - I started getting 403's on an endpoint (https://www.reddit.com/dev/api/#GET_about_moderators in particular)

I was doing some tinkering to try to figure out why I was only getting 600 requests per 600 seconds based on the rate limiting headers I was seeing, rather than the 1000/600 I expected. I ran into some mentions here that it was related to the tokens being used, oauth/app type/user auth etc.. I don't remember the details at this point, I never figured out a way to see a 1000/600 rate limit no matter what way I configured the token requests.

But what I did run into was that some of the requests I had been making for well over a year now were failing with 403's and it was only after changing the `grant_type` from `password` to `client_credentials`.

So, seeing that you haven't had any feedback here yet - maybe take a look at the token's `grant_type` in your auth flow and see if you can tinker with that to get a different response. (Note, if you're going to use `password` you'll need to pass a `username` and `password` alongside the `grant_type` in the request, presumably that user/pass combo needs to be the one that owns the reddit app.

All of this comes with a disclaimer that I'm using a janky PHP client that hasn't been updated in some time and isn't even remotely close to being as solid as PRAW, so it could be that my client/lib has its own issues in the token/oauth flow and none of this is related, but it's worth a try :D

Author
Account Strength
100%
Account Age
4 years
Verified Email
Yes
Verified Flair
No
Total Karma
196,103
Link Karma
156,142
Comment Karma
19,266
Profile updated: 1 day ago

Subreddit

Post Details

Location
We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago