Reddsaver build Crates.io

Installation

Recommended method

You can download release binaries here

Alternative methods

Using cargo

If you already have Rust installed, you can also install using cargo: shell script cargo install reddsaver

Using nix

If you are a nix user, you can install reddsaver from nixpkgs shell script nix-env --install reddsaver

or, if you manage your installation using home-manager, add to your home.packages: shell script home.packages = [ pkgs.reddsaver ];

Building and running from source

Make sure you have rustc v1.50.0 and cargo installed on your machine. shell script git clone https://github.com/manojkarthick/reddsaver.git cargo build --release ./target/release/reddsaver

Docker support

Pre-built docker images are available on Docker Hub

shell script mkdir -pv data/ docker run --rm \ --volume="$PWD/data:/app/data" \ --volume="$PWD/reddsaver.env:/app/reddsaver.env" \ reddsaver:latest -d /app/data -e /app/reddsaver.env

Running

  1. Create a new script application at https://www.reddit.com/prefs/apps
  2. Copy the client ID and client secret information returned
  3. Create a .env file with the following keys, for example reddsaver.env:
    shell script CLIENT_ID=<client_id> CLIENT_SECRET=<client_secret> USERNAME=<username> PASSWORD=<password> NOTE: If you have 2FA enabled, please make sure you set PASSWORD=<password>:<2FA_TOTP_token> instead

  4. Run the app! ```shell script

Create a directory to save your images to

mkdir -pv reddsaver/

Check if you installation is working properly

reddsaver --help

Check if the right configuration has been picked up

reddsaver -e reddsaver.env -d reddsaver --show-config

Run the app to download the saved images

reddsaver -e reddsaver.env -d reddsaver ```

NOTE: When running the application beyond the first time, if you use the directory as the initial run, the application will skip downloading the images that have already been downloaded.

View it in action here:

asciicast

Description and command line arguments

Optionally override the values for the directory to save and the env file to read from:

```shell script ReddSaver 0.3.0 Manoj Karthick Selva Kumar Simple CLI tool to download saved media from Reddit

USAGE: reddsaver [FLAGS] [OPTIONS]

FLAGS: -r, --dry-run Dry run and print the URLs of saved media to download -h, --help Prints help information -H, --human-readable Use human readable names for files -s, --show-config Show the current config being used -U, --unsave Unsave post after processing -V, --version Prints version information

OPTIONS: -d, --data-dir Directory to save the media to [default: data] -e, --from-env Set a custom .env style file with secrets [default: .env] -S, --subreddits ... Download media from these subreddits only ```

Some points to note:

Other Information

Building for Raspberry Pi Zero W

To cross-compile for raspberry pi, this project uses rust-cross. Make sure you have docker installed on your development machine.

  1. Build the docker image for rust-cross: docker build -t rust-rpi-zerow:v1-openssl -f Dockerfile.raspberrypizerow .
  2. Make sure that the image name used here matches the image name in your Cross.toml configuration
  3. Run cross build --target arm-unknown-linux-gnueabi --release to build the project
  4. You can find the compiled binary under target/arm-unknown-linux-gnueabi/release/