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 50 forks source link

Check if the photo is still available at execution #16

Closed CynaCons closed 8 years ago

CynaCons commented 8 years ago

Once, a photo hosted on Imgur made it's way to the top of the subreddit. However when I ran the script, the photo was no longer available on Imgur. As a result my desktop background was a big 'not available' or something.

Do you think there is a way to prevent that ?

ssimunic commented 8 years ago

Yes, it has been fixed already with this commit

It was the top image of /r/wallpapers yesterday.

remggo commented 8 years ago

This would not fix the problem if a picture is beeing taken down from OP, or has the 'This image is not available' always 'gallery' in its URL?

ssimunic commented 8 years ago

@remggo , the issue happened because it was downloading non existing image using gallery ID, which is not valid image URL. But yes, you are correct, if there is valid imgur link which was removed, then it would download non existing image. That is not the case usually, as mods delete the post if this happens, but option to integrate imgur api should be considered.

ssimunic commented 8 years ago

Fixed with 5deb482d57b3d922edf289b61bdf5d6a97d56401