Phantom12 / Unsplash-Wallpaper-Windows

87 stars 12 forks source link

Keywords in URL specification #7

Open Mnaukal opened 2 years ago

Mnaukal commented 2 years ago

Hi, I love this project and I use it every day. Recently, I noticed that the Unsplash API also allows to specify keywords when selecting the image, e.g. https://source.unsplash.com/1600x900/?nature. Sadly, the keyword comes after the image size, so it doesn't work with the current implementation (which appends the size after the sourceURL). Could you add the query part of the URL as another setting?

Phantom12 commented 2 years ago

Hi Michal, thanks for the kind words. It's been a while since I worked on it and I probably will do a bit more changes if I do get back to it. In the meantime, there is a quick workaround. You can update the sourceURL in %LocalAppData%/Unsplash_GUI/config.ini and just make sure to set the resolution, tho it does mean the resolution selection in GUI setting will not take effect. In the example you gave, sourceURL=https://source.unsplash.com/1600x900/?water/ (Almost exactly same as you typed, but with an extra '/' in the end). Effectively, the program will just send 'https://source.unsplash.com/1600x900/?water/{width}x{length}' request and the extra '{width}x{length}' will get ignored by Unsplash API.

Mnaukal commented 2 years ago

Awesome! Thank you!