varietywalls / variety

Wallpaper downloader and manager for Linux systems
http://peterlevi.com/variety
GNU General Public License v3.0
1.2k stars 145 forks source link

Unsplash: Rate Limit Exceeded #332

Closed Cyb10101 closed 1 year ago

Cyb10101 commented 4 years ago

Version of Variety: 0.8.3 Desktop: Gnome OS: Ubuntu 20.04 LTS (Focal Fossa) Seems to happen: Every time

Describe the bug Seems like access to the API has been limited.

Syslog example:

May  4 11:46:38 cyb-orange variety.desktop[4215]: requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://api.unsplash.com/photos/VZzS_y1Hf7s/download?client_id=072e*****515a
May  4 11:46:43 cyb-orange variety.desktop[4215]: ERROR: 2020-05-04 11:46:43,554: download_one_from() 'Could not download wallpaper:'
May  4 11:46:43 cyb-orange variety.desktop[4215]: Traceback (most recent call last):
May  4 11:46:43 cyb-orange variety.desktop[4215]:   File "/usr/lib/python3/dist-packages/variety/VarietyWindow.py", line 1156, in download_one_from
May  4 11:46:43 cyb-orange variety.desktop[4215]:     file = downloader.download_one()
May  4 11:46:43 cyb-orange variety.desktop[4215]:   File "/usr/lib/python3/dist-packages/variety/plugins/downloaders/DefaultDownloader.py", line 141, in download_one
May  4 11:46:43 cyb-orange variety.desktop[4215]:     items = self.fill_queue()
May  4 11:46:43 cyb-orange variety.desktop[4215]:   File "/usr/lib/python3/dist-packages/variety/plugins/builtin/downloaders/UnsplashDownloader.py", line 83, in fill_queue
May  4 11:46:43 cyb-orange variety.desktop[4215]:     r = Util.request(url)
May  4 11:46:43 cyb-orange variety.desktop[4215]:   File "/usr/lib/python3/dist-packages/variety/Util.py", line 622, in request
May  4 11:46:43 cyb-orange variety.desktop[4215]:     r.raise_for_status()
May  4 11:46:43 cyb-orange variety.desktop[4215]:   File "/usr/lib/python3/dist-packages/requests/models.py", line 940, in raise_for_status
May  4 11:46:43 cyb-orange variety.desktop[4215]:     raise HTTPError(http_error_msg, response=self)

No example in Variety log found!

Simple url check: https://api.unsplash.com/photos/VZzS_y1Hf7s/download?client_id=072e*****515a

Text Response:

Rate Limit Exceeded
peterlevi commented 1 year ago

Yes, Unsplash is rate-throttled. We are getting a less restricted rate from them than what normally free apps get, we cannot do much else to ensure that we won't be hitting rate limiting, apart from setting up a caching server ourselves (which is not on the radar).