ssimunic / Daily-Reddit-Wallpaper

Change your wallpaper to the most upvoted image of the day from /r/wallpapers or any other subreddit on system startup
http://ssimunic.github.io/Daily-Reddit-Wallpaper/
GNU General Public License v3.0
306 stars 51 forks source link

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

Open Krabby127 opened 7 years ago

Krabby127 commented 7 years ago

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 theRedditclass 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'

plscks commented 7 years ago

Can confim, praw 4 breaks this script.

spectre013 commented 7 years ago

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.

jenroper commented 7 years ago

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.

remggo commented 7 years ago

@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?