Skip to content
moleculekayak edited this page Aug 7, 2024 · 11 revisions

Usage

Don't forget you can get all CLI args with python3 main.py --help

A note on Docker:

⚠️ This will require some preexisting experience with Docker ⚠️

All fertilizer commands run using Docker will need to specify the location of the config file with -c.

You need to specify the volume you're mounting with every command. Here is an example based on my personal configuration but you'll have to sub in the directories you created during setup:

docker run \
  --rm
  --name fertilizer
  -p 9713:9713 \
  -v /shares/appdata/fertilizer:/config \
  -v /shares/appdata/deluge/state:/torrents \
  -v /shares/bittorrent:/data \
  ghcr.io/moleculekayak/fertilizer:latest

Since I'm not going to type that out every time, I'm going to assume one of the following:

  • You've set the above as a bash alias named fertilizer
    • IMPORTANT: if you go this route you have to append one final fertilizer to the alias. So ultimately the alias would look like alias fertilizer="docker run [...] ghcr.io/moleculekayak/fertilizer:latest fertilizer"
  • You're using Docker Compose or a Docker management system to handle that configuration, or;
  • You've added the -it flags and appended /bin/bash to run a bash shell within the container. This gives you access to the fertilizer command so usage would be the same as if you set an alias

Configurable CLI Arguments

Each command has a handful of arguments that will change based on your setup. The examples below will need to be changed if you're using a non-Docker setup. If you're using Docker you can consider the examples to be a best-practice but you can change to fit your needs.

Scanning a directory

This is when you want to analyze your entire library of active torrents and generate new torrents to cross-seed as many files as possible. This is where most people start and it's safe to run this multiple times since it'll ignore duplicates.

Non-Docker:

python3 main.py -i /path/to/torrents/folder -o /path/to/output/folder

Docker:

NOTE: you can set -o to whatever you want but /data/fertilizer/torrent-files is a good default

fertilizer -i /torrents -o /data/fertilizer/torrent-files -c /config/config.json

Scanning a single file

Very similar to the above, but for a single file instead of an entire directory. Useful for scripting

Non-Docker:

python3 main.py -f /path/to/single/file.torrent -o /path/to/output/folder

Docker:

fertilizer -f /torrents/<filename (usually the infohash)>.torrent -o /data/fertilizer/torrent-files -c /config/config.json

Server mode (experimental)

Server mode keeps a webserver running that'll scan torrents you provide via an API request to the /api/webhook endpoint. This is great if everything in your setup is Dockerized and you want to automatically scan torrents as they complete.

This is not recommended for non-Docker installs.

Docker

fertilizer -i /torrents -o /data/fertilizer/torrent-files -c /config/config.json --server

The server will be launched on port 9713. Most torrent clients can run a script when a torrent has completed. Set up one of these scripts like so to automate cross-seed generation:

Deluge:

curl -XPOST http://YOUR_HOST_HERE:9713/api/webhook --data-urlencode "infohash=$1"

qBittorrent:

curl -XPOST http://YOUR_HOST_HERE:9713/api/webhook --data-urlencode "infohash=%I"