Wallhaven recently came out of aplha, making many changes to their website.
I've updated the scraper to make it work again.
This Rewrites part of the script to work with the new API.
Currently the only way to get NSFW images in search results is to use the API access along with an API Key.
The updated scraper now uses the API to load the search results page / categories page/ lastest page.
Users dont require API access to view full resolution NSFW Images, so we can access all the images through the original method.
We use the original method grab the Full Resoultion Photo, except this time we have the actual image path so we dont need to guess the file extension.
The API requires an API key which you can get by creating a Wallhaven Account. The API Key is under User Menu->Settings->Account.
Instead of showing the lastest page it will now show the toplist page for the past month as we cant access the lastest page with the API.
The API is limited to 45 calls per minute, but as we only call the API to load new pages (of 24 images) and not to download the actual images, this should limit should never be reached.