Lunatixz / KODI_Addons

https://kodi.tv/addons/omega/author/lunatixz/
126 stars 104 forks source link

Unsplash Screensaver fix #267

Open embql opened 5 days ago

embql commented 5 days ago

I set out to fix this showing a black screen instead of photos, as i love the idea of random art that can be curated easily and shown on the TV easily (collections ftw!), and as suspected, Unsplash requires an API key now for users to fetch images. Also there is a rate limit of 50 per hour so i tried to do something about that to not get too many errors and denials.

So first, you have to create an app at Unsplash and get the access key and post the key in the screensaver settings. As such, I have added that to the settings and changed the endpoints as well as other code to correctly fetch urls (instead of source.unsplash.com I use api.unplash.com etc).

Beware I'm not too good at coding and it can probably be much more efficient, but at least it works - and especially with the collection mode as that is what I use. Not really sure the other modes are working correctly, but images are returned and displayed so I'm not too invested.

Please take a look at the code and replace settings.xml and gui.py in the folder and subfolders of "Kodi\addons\screensaver.unsplash\resources\" (remember to backup just in case). If some of this could be used to fix the current code on github feel free to use it. Not too much experience with pull requests so I'm not doing that right now.

gui.py: https://drive.google.com/file/d/19GMos61...sp=sharing settings.xml: https://drive.google.com/file/d/1oD1ZqtF...sp=sharing

Hope you can use it, thanks. best

Lunatixz commented 3 days ago

Thanks...