Skip to main content

A Reddit download bot

Project description

grab - a Reddit download bot

This is a simple Python script to download submissions from any specified subreddit.
All images are placed in the ~/Downloads/grab-bot/[subreddit]/[date] by default. The download path however can be changed through the GUI or config file.
"grab.ini" is the configuration file used by the program. It will be generated with default values in case it is not present when gui.py is run.
"downloaded.txt" lists all previously downloaded images from their subreddit. This was done to avoid downloading images multiple times in an effort to save bandwidth and make subsequent executions of the program faster.

TODO

  • GUI for selecting subreddits
  • Change download location through GUI
  • Change the download limit
  • Change the category
  • Make the GUI look better
  • Create CLI options for grab.py to create config files in the terminal (Mostly done. Needs an option to show the config, remove subs and prevent duplicates)
  • Automatically schedule program execution (Can be done manually with cron)
  • CLI option for launching the gui

How to use

Follow the installation instructions.
To add subreddits open gui.py, click on the "+" Button and type in the subreddit you want to add.
To remove a subreddit, select one from the list and click on the "-" in the top right. Click yes in the following dialog.
Clicking ">" will expand the window to change the category, limit and download path. Clicking "Run" in the GUI will execute grab.py.
The theme can be changed by clicking on "light" or "dark". The dark theme is still work in progress.

If you want to use the program in the terminal without the GUI, execute grab.py with python.
grab.py -h lists all available commands and their descriptions.

Setting up cron for repeated executions is covered below.

Installation

To install all requirements follow the instructions below.

Arch:
sudo pacman -S python-pip tk
pip install --user grab-reddit

Debian:
sudo apt-get install git python3-pip python3-tk python-configparser
pip3 install grab-reddit

Fedora:
sudo dnf install python3 python3-wheel python3-tkinter
pip install --user grab-reddit

To use the CLI run grab-reddit <args>. For the gui version use grab-reddit-gui.

*See Configurations for systems that have been tested.

Known Bugs

  1. Some images can't be opened. Fixed by using Pillow to check images after the download.
  2. Can't currently click "Run" in the GUI and have the program work in Debian. Launching grab.py directly works. Fixed in Commit 2538a8fefe17755868b2fbd0e01d43aa7411b58f

Configurations

Fresh install unless noted otherwise

Distro Python Version Notes
Arcolinux 3.8.5
Fedora 32 3.8.5
Debian 10 3.7.3

*Configurations are only tested with the master branch

Cron

Change the directory to the location where the grab.py file is located and execute it with python. In Debian you have to specify python3 instead of python. The change of location is done to make sure the program is initialized with the working directory where the .subr files are located.
cd /<directory> && python grab.py

Example setup for hourly execution
0 * * * * cd /home/<user>/scripts && python grab.py

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

grab-reddit-0.0.3.post11.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grab_reddit-0.0.3.post11-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file grab-reddit-0.0.3.post11.tar.gz.

File metadata

  • Download URL: grab-reddit-0.0.3.post11.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for grab-reddit-0.0.3.post11.tar.gz
Algorithm Hash digest
SHA256 5d68224d0471f2cd9b782535d9ab05d4d447a0b062a4b5fdec6a23c30bd5b3b3
MD5 9effb1ceb061a948121b0a929e542e5d
BLAKE2b-256 43c7066359fde53ca9f263e01485d396ec727551386d5aa2c70244b3876ab392

See more details on using hashes here.

File details

Details for the file grab_reddit-0.0.3.post11-py3-none-any.whl.

File metadata

  • Download URL: grab_reddit-0.0.3.post11-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for grab_reddit-0.0.3.post11-py3-none-any.whl
Algorithm Hash digest
SHA256 dd83fd01b1a8a037241602b032bea96b878736e347060c5a41585da019db39c2
MD5 29c8294b8e08dd972221ecfcbf10df48
BLAKE2b-256 e983a09cccef056cca1fa6182df31f427d8d0616c23094aff9a0dcd38d39d880

See more details on using hashes here.

Supported by

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