Skip to main content

Reddit upvoted and saved media downloader

Project description

License: MIT

My Reddit Downloader

Download upvoted and saved media from Reddit

 

Index

Requirements

  • Python 3.6 or above
  • requests
  • praw

Pre-Installation

Create a developer application on reddit if needed

Installation

pip install myredditdl

 

Manual Installation

1. Clone this repository

$ git clone https://github.com/emanuel2718/myredditdl
$ cd myredditdl

2. Install requirements

$ pip install -r requirements.txt

3. Install myredditdl

# you might need to install setuptools (pip install setuptools)
$ python3 setup.py install

4. Fill reddit developer app information

$ myredditdl --add-client

How to use

$ myredditdl [REQUIRED] [OPTIONS]
REQUIRED
-U, --upvote            Download upvoted media
-S, --saved             Download saved media
OPTIONS

 

Optional arguments:
-h, --help                show this message and exit
-v, --version             display the current version of myreddit-dl

--sub [SUBREDDIT ...]     only download media that belongs to the given subreddit(s)
--limit [LIMIT]           limit the amount of media to download (default: None)
--max-depth [MAX_DEPTH]   maximum amount of posts to iterate through

--no-video                don't download video files (.mp4, .gif, .gifv, etc.)
--only-video              only download video files
--no-nsfw                 disable NSFW content download
Confgiguration:
--add-client              add a new Reddit account
--change-client           change to another valid existing reddit client (account)
--prefix OPT              set filename prefix (post author username and/or post subreddit name)
                          
                          Options:
                              '--config-prefix username'           --> username_id.ext
                              '--config-prefix username subreddit' --> username_subreddit_id.ext
                              '--config-prefix subreddit username' --> subreddit_username_id.ext
                              '--config-prefix subreddit'          --> subreddit_id.ext
                              
                          Default: subreddit_username.ext
                          
--path PATH               path to the folder were media will be downloaded to
--get-config              prints the configuration file information to the terminal
Metadata:
--no-metadata             don't save metadata for the downloaded media
--get-metadata FILE       print all the reddit metadata of the given FILE
--get-link FILE           print reddit link of given FILE
--get-title FILE          print post title of given FILE
--delete-database         delete the database of the current active reddit client user

Configuration

Set the reddit client information to be able to use myredditdl

$ myredditdl --add-client

Set the path to the destination folder for the downloaded media

$ myredditdl --path ~/Path/to/destination

Set the filenames prefix scheme of the downloaded media

# This will save all the files with the scheme: `postAuthorUsername_uniqueId.extension`
$ myredditdl --prefix username
# This will save all the files with the scheme: `subredditName_postAuthorUsername_uniqueId.extension`
$ myredditdl --prefix subreddit username
# This will save all the files with the scheme: `postAuthorName_subredditName_uniqueId.extension`
$ myredditdl --config-prefix username subreddit

Show the current configuration

$ myredditdl --show-config

Example usage:

Download all user upvoted media (limited to 1000 posts: Praw's API hard limit)

$ myredditdl -U

Download all user saved media and don't save metadata of posts

$ myredditdl -S --no-metadata

Download all user upvoted and saved media except NSFW posts

$ myredditdl -U -S --no-nsfw

Download all the user upvoted posts from the r/MechanicalKeyboards subreddit

$ myredditdl -U --sub MechanicalKeyboards

Download all the user upvoted posts from the r/MechanicalKeyboards and r/Battlestations subreddits

# There's no limit to how many subreddits can be chained together
$ myredditdl -U --sub MechanicalKeyboards Battlestations

Download only 10 posts media and only download images (don't download videos)

$ myredditdl -U --limit 10 --no-video

Get the post link of a downloaded media

# This will print the reddit post link of that image
$ myredditdl --get-link random_image.png

Get the post title of a downloaded media

# This will print the reddit post title of that video
$ myredditdl --get-title random_video.mp4

Get the metadata of downloaded media

# This will print the metadata of the image
$ myredditdl --get-metadata random_image.jpg

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

myredditdl-0.0.3.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

myredditdl-0.0.3-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file myredditdl-0.0.3.tar.gz.

File metadata

  • Download URL: myredditdl-0.0.3.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2

File hashes

Hashes for myredditdl-0.0.3.tar.gz
Algorithm Hash digest
SHA256 856b602746909a0f720ea1712d6304c93d303b6507ac18ddf6788b072a699428
MD5 821d4a9f69fd6882fa08c1929be24d69
BLAKE2b-256 ff54a4dfb547affad65ae17bad6b2af30b5d6220d30461f79084012574752a2b

See more details on using hashes here.

File details

Details for the file myredditdl-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: myredditdl-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2

File hashes

Hashes for myredditdl-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 21b828443aef4ce83808e738d9360b271b29d29f499b9432e4513d7e7a990515
MD5 6b9ccc5c6ee4fc40f8e7d4ae62b95169
BLAKE2b-256 4231d77eaf5fd5f59143777b899fac9fb4d25cebc0d82869b481282cacf21d86

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page