GithubHelp home page GithubHelp logo

saurabhan / wallhaven-dl Goto Github PK

View Code? Open in Web Editor NEW
204.0 9.0 48.0 6.55 MB

A wallhaven scraper which downloads all the wallpapers form alpha.wallhaven.cc

License: MIT License

Python 95.23% Dockerfile 4.77%

wallhaven-dl's Introduction

Wallhaven-dl

UPDATE

###The script now comes with a search functionality, you can now search and download wallpapers from the command line.


A wallhaven scraper which downloads all the wallpapers from the first page of alpha.wallhaven.cc

This Script now comes with categories and purity sort support.

NOTE- Downloading NSFW images require a Wallhaven Account

How to use:

  1. Download the wallhaven-dl.py
  2. Move wallhaven-dl.py to the folder in which you want wallpapers to download.
  3. run script
  4. It'll ask you to choose a category, download the latest wallpapers or search, choose as per desired.
  5. enjoy!
$ python3 wallhaven-dl.py

Dependencies:

This project depends on BeautifulSoup, Requests, tqdm, lxml Your can install install the dependencies using the requirements.txt file and running

$ pip3 install -r requirements.txt

Wallhaven-dl © 2016, Saurabh Bhan. Released under the MIT License.

wallhaven-dl's People

Contributors

benlights avatar dependabot[bot] avatar ialys avatar saurabhan avatar tempest042 avatar unseen1980 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wallhaven-dl's Issues

not working

wallhaven main domain changed. alpha state completed.

Enter Choice - not working

When i run the file, it asks for enter choice - but "yes" or "no" or any value for that matter is simply spits "You entered an incorrect value."
Screen Shot 2020-04-09 at 1 43 18 AM

Wallhaven out of alpha - updated what I thought it needed but still not working.

No matter what I update in response to how the site pages are now named after coming out of alpha I seem to get the same response.

Login successful.
Fetching collection ids...
Traceback (most recent call last):
File "wl_fav_dl_spec.py", line 149, in
main()
File "wl_fav_dl_spec.py", line 141, in main
for collection in collection_ids:
File "wl_fav_dl_spec.py", line 59, in fetch_collections
collections = favs_soup.find('ul', class_='blocklist collections-list').find_all('li')
AttributeError: 'NoneType' object has no attribute 'find_all'

Is there a way to increase buffer size as well?

Save wallpapers in directories named by input?

Not really an issue, but I have a question.

The script saves all wallpapers in the Wallhaven directory (which is in your working directory). How could I save them in directories named based on what I input?

For instance, if I enter category, anime, swf, I want the wallpapers to save to anime/sfw/ [as in, sfw directory is inside anime directory] or just anime/.

If I enter latest, I want the wallpapers saved to latest/.

Or if I enter search, pokemon, I want the wallpapers to be saved to pokemon/

Images saved w/o extensions

The images did not have proper extension when downloaded on my computer with w10
Just starting with phyton and i don't know why this is not working for me

When I changed 102nd line:
with open(osPath, 'ab') as imageFile:
to:
to with open(osPath + ext, 'ab') as imageFile:

it saves the images downloaded with their proper extensions
just starting with python, looking to get answer why the first solution did not work

adding AI Art option

There is a new selectable option: AI Art.
If it is possible, could you please add AI Art as an option to be selectable when downloading wallpapers?
Thank you.

randomly stops while downloading

I could not figure out what is happening. It runs into some kind of error, but seems to be random (I mean sometimes after 300 images sometimes after 450 etc...).
What could be the problem, some kind of timeout or something?

The error looks like this:
"Traceback (most recent call last):
File "wallhaven-dl.py", line 130, in
main()
File "wallhaven-dl.py", line 127, in main
downloadPage(j, totalImageToDownload)
File "wallhaven-dl.py", line 81, in downloadPage
pagesImages = json.loads(urlreq.content);
File "C:\Users\Xyz\AppData\Local\Programs\Python\Python38-32\lib\json_init_.py", line 357, in loads
return _default_decoder.decode(s)
File "C:\Users\Xyz\AppData\Local\Programs\Python\Python38-32\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\Xyz\AppData\Local\Programs\Python\Python38-32\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)"

Sleep in 139th line

Why do we need time.sleep(0.01) at the 139th line? It would be much faster without it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.