Daily-Reddit-Wallpaper icon indicating copy to clipboard operation
Daily-Reddit-Wallpaper copied to clipboard

PRAW 4.0.0b23 does not have "get_subreddit" call and now requires auth

Open Krabby127 opened this issue 7 years ago • 4 comments

Traceback (most recent call last): File "./change_wallpaper_reddit.py", line 166, in <module> r = praw.Reddit(user_agent="Get top wallpaper from /r/{subreddit} by /u/ssimunic".format(subreddit=subreddit)) File "/usr/local/lib/python2.7/dist-packages/praw-4.0.0b23-py2.7.egg/praw/reddit.py", line 101, in __init__ raise ClientException(required_message.format(attribute)) praw.exceptions.ClientException: Required configuration setting 'client_id' missing. This setting can be provided in a praw.ini file, as a keyword argument to the Reddit class constructor, or as an environment variable.

If I add my client_id and client_secret to the initializer, I get a different error:

r = praw.Reddit(user_agent="Get top wallpaper from /r/{subreddit} by u/ssimunic".format(subreddit=subreddit), client_id='[redacted]', client_secret='[redacted]')

Traceback (most recent call last): File "./change_wallpaper_reddit.py", line 171, in <module> image = get_top_image(r.get_subreddit(subreddit)) AttributeError: 'Reddit' object has no attribute 'get_subreddit'

Krabby127 avatar Nov 23 '16 17:11 Krabby127

Can confim, praw 4 breaks this script.

plscks avatar Dec 22 '16 03:12 plscks

Locally I updated the code and had to change the get_subreddit to just subreddit and in the get_new function had to change the get_new and get_top to just new/top.

Also signed up for a personal developer app to get the keys and it works just fine. Would be best if the author created the app to work with oAuth then you could just signin and use it that way. That is my guess why he hasn't updated the app to work with the latest version of PRAW.

spectre013 avatar Jun 14 '17 21:06 spectre013

I updated the version in my fork to use praw 5.0.1. You are welcome to use it. You just need to add your client_id and client_secret to the praw.ini file.

jenroper avatar Aug 31 '17 02:08 jenroper

@jenroper Thanks, I will check it out this afternoon.

Btw: Is this Project still actively maintained? Would it be better to fork and maintain it separately?

remggo avatar Aug 31 '17 06:08 remggo