Skip to content

A threaded Python project which downloads from the 4Chan Wallpaper board

License

Notifications You must be signed in to change notification settings

mr-briggs/Wallpaper-Downloader

Repository files navigation

Wallpaper Downloader

A command line application that allows a user to choose a 4Chan board (default: Wallpapers), search for keywords, then choose a thread to browse.

After choosing a thread, a GUI application opens which allows the user to browse through all of the images in that thread, and download the images of their choice.

Note - the pyglet-fixed folder is a hand-rolled modification of Pyglet that prevents crashes under specific circumstances.

Usage

A board is chosen by the user
Keyword(s) are entered
A thread is chosen
A GUI opens which allows the user to navigate and save images from the chosen thread. The controls are:
Up Arrow (or scroll wheel) - Zoom in
Down Arrow (or scroll wheel) - Zoom out
Left Arrow - Navigate left one image
Right Arrow - Navigate right one image
Right-click near left or right edge - Navigate left or right
Left-click (drag) - Move image
Space - Save image
Enter - Play .webm file
r - Refresh thread (caches new images)
w - Open image in default web browser
s - Open thread in default web browser
6 (NUMPAD) - Rotate image 90 degrees clockwise
4 (NUMPAD) - Rotate image 90 degrees counterclockwise
0 - Change border style
v - View saved images
If an image has yet to be cached, "No Preview Available" will be shown
Pressing "v" will open another GUI which allows the user to view saved images (closing the viewer will bring the first GUI back into focus)

How it Works

  1. The user is prompted for a board, enters keywords to search, and selects a thread from the provided search-list. The search-list is created using find_thread function, which crawls the chosen board and finds each instance of the keyphrase provided.
  2. When a thread is chosen, the list_images function is ran, which fetches a list of all the images from the selected thread.
  3. The cache_images function is ran asyncronously, which uses the list of images and downloads each, adding them to the cache folder.
  4. After a brief 1 second delay (to allow the cacher to cache the first image), the start function is executed which opens an interactive Pyglet GUI, allowing the user to navigate, rotate, play, and save images/gifs from the selected thread.

Built With

  • Pyglet - Used for the GUI. Modified to prevent crashes under specific circumstances.
  • Requests/urllib.request - Used to scrape the chosen board / download files.
  • threading (python stl) - Used to download images asyncronously.
  • html (python stl) - Used to unescape thread titles.
  • webbrowser (python stl) - Used to open thread/image in the default web browser.

License

This project is licensed under the MIT License - see the LICENSE file for details

About

A threaded Python project which downloads from the 4Chan Wallpaper board

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages