pystardust / waldl

Browse and download wallhaven.cc using sxiv
GNU General Public License v3.0
113 stars 20 forks source link

login into wallhaven #5

Open hard-tek opened 3 years ago

hard-tek commented 3 years ago

So this is not an issue but more of a request. Can you implement a line of code that will allow us to login? Just for simple fact so we can choose what kind of wallpapers we want, for example i don`t want anime themed walls. Can be done? Thanks.

aiscarruthers commented 3 years ago

In your wallhaven profile settings you'll have an api key.

If you change the url that the waldl uses from "https://wallhaven.cc/api/v1/search" to "https://wallhaven.cc/api/v1/search?apikey=(YOUR API KEY GOES HERE)" that will allow you to access wallhaven as a user and not a guest.

Additionally you can change the "General, Anime, People" settings to exclude anime by adding a '-d "categories=101" 'after line 104 in the get_results() function. Hopefully you find that helpful.

All of this info can be found by checking the wallhaven api page.

hard-tek commented 3 years ago

Managed to do it. Thank you!