Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
653 views
in Technique[技术] by (71.8m points)

python - Only script apps may use password auth praw

I'm trying to make a Reddit reposter but every time I run the program it says "prawcore.exceptions.OAuthException: unauthorized_client error processing request (Only script apps may use password auth)"

def bot_login():
print('Logging in...')
r = praw.Reddit(username='**',
                password='**',
                client_id='**',
                client_secret='**',
                user_agent='None')
print('Logged in as user: "'+str(r.user.me())+'"')
print("------------------------------------------------------------------")
return r

any idea on how to fix it?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You probably made a web app on the reddit applications page on accident. Reddit only allows script type web applications to use password authentication for security purposes.

To Fix:

  1. Go to https://www.reddit.com/prefs/apps
  2. Choose the "script" type application (picture)
  3. Recreate your application

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...