Skip to main content

A Reddit download bot

Project description

grab - a Reddit download bot

This is a simple Python script to download submissions containing images 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 the program is run. This file will be created in your home directory.
"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.

This program supports mainly Linux. Windows support is still in testing.

Table of Contents

  1. TODO
  2. How to use
  3. Problems
  4. Installation
    1. Arch
    2. Debian
    3. Fedora
    4. Windows
  5. Known Bugs
  6. Cron

TODO

  • GUI for selecting subreddits
  • Change download location through GUI
  • Change the download limit
  • Change the category
  • CLI option for launching the gui. Done through grab-reddit-gui.
  • Make the GUI look better
  • Create CLI options for newgrab.py to create config files in the terminal
  • Automatically schedule program execution (Can be done manually with cron)

How to use

Follow the installation instructions.
To add subreddits open the gui, 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.

To run the program in the terminal use grab-download <args>. If you want the gui version, run grab-reddit-gui.
Help for arguments taken by grab-download can be found by executing grab-download -h.

Setting up cron for repeated executions is covered below.

Problems

This program relies on a stable internet connection when adding new subreddits, as each subreddit is checked for whether it can be reached. If your connection is unstable or very slow this can lead to hanging in the GUI.

Installation

To install all requirements follow the instructions for your distribution shown below.

Arch

Open a terminal and execute the following commands.
sudo pacman -S python-pip
sudo pip install grab-reddit

If you want to install the program to your local user, make sure to add your .local/bin directory to your PATH.
pip install --user grab-reddit

Debian

Open a terminal and execute the following commands.
sudo apt-get install python3-pip python3-tk
pip3 install grab-reddit

Fedora

Open a terminal and execute the following commands.
sudo dnf install python3 python3-wheel python3-tkinter
pip install --user grab-reddit

Windows

Program still undergoing testing

Install python from the python homepate.
I suggest you to check "Add to my PATH".

After a reboot open a terminal and execute the following command.
pip install grab-reddit

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

Known Bugs

Cron

This program comes with its own little execution scheduler included. It can be called with grab-reddit-sched in the terminal.

To execute this program it is best to specify the full path to the binary executable
On Linux you should be able to find the path with which grab-reddit

Example setup for hourly execution
0 * * * * /home/marc/.local/bin/grab-reddit

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.8.tar.gz (15.5 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.8-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file grab-reddit-0.0.8.tar.gz.

File metadata

  • Download URL: grab-reddit-0.0.8.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for grab-reddit-0.0.8.tar.gz
Algorithm Hash digest
SHA256 4b3bc21a5701bbebadb2ddb5c8f7da9d4b20ddf8ba65482f1e327f4191595e33
MD5 1def1c0f363f66024416771100b93154
BLAKE2b-256 09242d27fb8a15f97c00d73be02fb13a3fe270473c10ba37806f4f9614c52c2b

See more details on using hashes here.

File details

Details for the file grab_reddit-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: grab_reddit-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for grab_reddit-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 52ec64d458e23877176b671049433555424648361dcbc6219a5a90c33fd47467
MD5 82295ae9a53a8ceec5ce29c2abdc5555
BLAKE2b-256 a8f1789c84ca9d3e6b9887fcdd5ae35fec605e5cdb39c67c6327c9da09882fdf

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