Giter Site home page Giter Site logo

redditimagegrab's Introduction

Build Status

RedditImageGrab

I created this script to download the latest (and greatest) wallpapers off of image subreddits like wallpaper to keep my desktop wallpaper fresh and interesting. The main idea is that the script would download any JPEG or PNG formatted image that it found listed in the specified subreddit and download them to a folder.

Requirements:

  • Python 2 (Python3 might be supported over 2to3, but see for yourself and report back).
  • Optional requirements: listed in setup.py under extras_require.

Usage:

See ./redditdl.py --help for uptodate details.

ordering = ('key', )

redditdl.py [-h] [--multireddit] [--last l] [--score s] [--num n]
                 [--update] [--sfw] [--nsfw]
                 [--filename-format FILENAME_FORMAT] [--title-contain TEXT]
                 [--regex REGEX] [--verbose] [--skipAlbums]
                 [--mirror-gfycat] [--sort-type SORT_TYPE]
                 <subreddit> [<dest_file>]

Downloads files with specified extension from the specified subreddit.

positional arguments:

<subreddit>           Subreddit name.
<dest_file>           Dir to put downloaded files in.

optional arguments:

-h, --help            show this help message and exit
--multireddit         Take multirredit instead of subreddit as input. If so,
                    provide /user/m/multireddit-name as argument
--last l              ID of the last downloaded file.
--score s             Minimum score of images to download.
--num n               Number of images to download.
--update              Run until you encounter a file already downloaded.
--sfw                 Download safe for work images only.
--nsfw                Download NSFW images only.
--regex REGEX         Use Python regex to filter based on title.
--verbose             Enable verbose output.
--skipAlbums          Skip all albums
--mirror-gfycat       Download available mirror in gfycat.com.
--filename-format FILENAME_FORMAT
                    Specify filename format: reddit (default), title or
                    url
--sort-type         Sort the subreddit.

Examples

An example of running this script to download images with a score greater than 50 from the wallpaper sub-reddit into a folder called wallpaper would be as follows:

python redditdl.py wallpaper wallpaper --score 50

And to run the same query but only get new images you don't already have, run the following:

python redditdl.py wallpaper wallpaper --score 50 -update

For getting some nice pictures of cats in your catsfolder (wich will be created if it doesn't exist yet) run:

python redditdl.py cats ~/Pictures/catsfolder --score 1000 --num 5 --sfw --verbose

Advanced Examples

Retrieve last 10 pics in the 'wallpaper' subreddit with the word "sunset" in the title (note: case is ignored by (?i) predicate)

python redditdl.py wallpaper sunsets --regex '(?i).*sunset.*' --num 10

Download top week post from subreddit 'animegifs' and use gfycat gif mirror (if available)

python redditdl.py animegifs --sort-type topweek --mirror-gfycat

Sorting

Available sorting are following : hot, new, rising, controversial, top, gilded

'top' and 'controversial' sorting can also be extended using available time limit extension (hour, day, week, month, year, all).

example : tophour, topweek, topweek, controversialhour, controversialweek etc

redditimagegrab's People

Contributors

emmeff avatar endlesslycurious avatar hoverhell avatar joaquinlpereyra avatar jtara1 avatar kaligule avatar parkerlreed avatar rachmadaniharyono avatar verhovsky avatar

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.