qwertydog / Reddit-Wallpaper-Changer

Reddit Wallpaper Changer
MIT License
45 stars 8 forks source link

[Feature] set own API key to avoid 429 Error #26

Open MildlyInterested opened 1 year ago

MildlyInterested commented 1 year ago

Thanks to reddits recent changes in their API rate limiting (Source ) and pricing I'm guessing this addon is quickly running out of its free allocation.

Suggestion would be to have users be able to set their own API key which should be enough to not run into any limits.

XenHat commented 1 year ago

Related to: #24

XenHat commented 1 year ago

Ideally, this app shouldn't use an API key at all, and use the public JSON API to let the application have per-user API limits. (At least that's how GitHub works, I assume that's also how reddit does it).

I wrote my own script to fetch wallpapers on Linux from a single subreddit and I'm not hitting the API limit if I request only once every few hours, so perhaps the issue lies deeper in the code than the API key allocations?

MildlyInterested commented 1 year ago

I've got mine set to change every 60 minutes. Looking at the logs it doesn't seem to make much sense, a bunch of 429 errors while searching. Then some 403 from deleted subreddits and then the next request 10 seconds later succeeds.

EDIT: Forcing a change 10 minutes later does throw a bunch of 429s again. What I've noticed is that Wallpaper-Changer wil continue to try every subreddit on the list even after the first 429 error so maybe some cooldown period would be sensible.