Giter Site home page Giter Site logo

reddit-riddle's Introduction

riddle.py CodeFactor License: GPL v3 FOSSA Status

This is a script for downloading images (or other media) from reddit subreddits.

Install

This script requires at least Python 3.6. After cloning this repository you need to install the requirements via

pipenv install

or

pip3 install -r requirements.txt

Configuration

Before running you need to provide information for the reddit api. To do so you must create an app in your reddit account preferences. The application must be of type 'script'. That must be done via a config.yaml file in the scripts directory. You can copy the default-config.yaml file to the config.yaml file and change the keys client_id and client_secret under credentials.

# user app credentials
credentials:
  client_id: your app-client id  # change this
  client_secret: your app-client secret  # change this

# required extension of the file to be downloaded
image-extensions:
  - png
  - jpg
  - jpeg

min-size: 5 # minimum size in kilobytes
min-mp: 0.5 # minimum siz ein megapixels

Running

Help output

Usage: riddle.py [options] [subreddits]

Options:
  -h, --help            show this help message and exit
  -c COUNT, --count=COUNT
                        The number of images to download for each subreddit.
                        If not set it is the maximum fetchable number.
  -o OUTPUT, --output=OUTPUT
                        The name of the output folder. If none is specified,
                        it's the subreddits name.
  -z, --zip             Stores the images in a zip file if true
  --nsfw                If set nsfw-content is also downloaded.
  --lzma                If set the lzma-compression module is used.

Example

Download all images from r/EarthPorn:

python3 riddle.py EarthPorn

Download all images from r/astrophotography to a zip-file:

python3 riddle.py -z astrophotography

Download a maximum of 200 images from r/astrophotography and r/EarthPorn to one zip-file named coolpics.zip:

python3 riddle.py -z -c 100 -o coolpics astrophotography EarthPorn

License

FOSSA Status

reddit-riddle's People

Contributors

fossabot avatar trivernis avatar

Watchers

 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.