Skip to content

4rm/UpvoteDownloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UpvoteDownloader

UpvoteDownloader allows you to download all of your upvoted or saved links from reddit.

Supported websites:

  • imgur
  • reddit-hosted images
  • direct tumblr links
  • Everything supported by youtube-dl (see youtube-dl for more)
  • reddit self-posts
PRAW (6.0.0) Python Reddit Api Wrapper
youtube-dl (2018.08.04) YouTube (and so much more) video downloader
imgurpython (1.1.7) Python client for the imgur API
GTK Installer (3.24.13) Rendering tools for weasyprint
WeasyPrint (v51) Webpage PDF capture tool

Only a few steps are needed to get up and running. First open UserInfo.py for editing. You can modify the following settings:

ignoreImgurAlbums Should UpvoteDownloader skip imgur albums?
  • Avoids having to create imgur account
  • Helps prevent reaching the imgur API request limit (easy to hit if you have a lot of upvoted/saved posts)
mypath Specify the download location
  • Default location is a folder named "DownloadedUpvotes" in the same directory as UpvoteDownloader.py
  • imgur albums will be automatically downloaded to their own folder with images in the original order
whatToDownload Should UpvoteDownloader download upvoted posts, saved posts, or both?
  • 0 = only upvoted
  • 1 = only saved
  • 2 = both
ignoreHidden Should UpvoteDownloader skip upvoted links that are also hidden?
  • Useful to avoid downloading links that were upvoted over 6 months ago (archived posts)

In order to get your reddit client ID and secret,

  1. Go to https://www.reddit.com/prefs/apps
  2. Scroll down and select "are you a developer? create an app..."
    1. Enter any name you want
    2. Select "script"
    3. Set "redirect uri" to something like "http://localhost:8080". Doesn't really matter what you choose as long as it's valid
    4. Click "create app"
  3. The code under "personal use script" is your client ID and the secret is your client secret. Enter it into UserInfo.py

In order to get your imgur client ID and secret (necessary to download albums, but not single images),

  1. Create an imgur account if you don't already have one
  2. Go to https://api.imgur.com/oauth2/addclient
    1. Enter any name you want
    2. Select "Anonymous usage without user authorization"
    3. Set "Authorization callback URL" to something like "http://localhost:8080". Doesn't really matter what you choose as long as it's valid
    4. Enter a valid email
  3. Your client ID and secret will be emailed to you. Enter it into UserInfo.py

In order to download text posts as .PDFs, we need to install GTK and WeasyPrint. Further installation info can be found here.

After UserInfo.py is set, make sure you have a stable internet connection and a reasonable amount of storage space (requirement will vary widely by user). Run UpvoteDownloader.py and your files should download. As long as you do not rename anything, UpvoteDownloader will not overwrite already downloaded files, saving bandwidth and time. Links that are unreachable, or unable to be downloaded will be written to UndownloadableLinks.txt in the same directory as UpvoteDownloader.py.

youtube-dl does most of the heavy lifting in this script, and supports a lot more than what's currently in the ytdlsupport.txt file. In the interest of removing clutter, I limited the file to only include websites that I personally tested and found to work well. A full list of the sites youtube-dl should support can be found here. You can added the domains to ytdlsupport.txt to include them in your downloads. Remember to escape the periods (\.) and backslashes (\/) in longer urls.

  • Figure out how to download images from tumblr that don't end in an image file extension
  • Change UserInfo.py to a cfg or text file
  • Install youtube-dl and imgurpython for the user instead of them having to do it manully

About

Script to download all upvoted and saved links from reddit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages