Watches Transmission via its RPC API and removes torrents containing unwanted file types. It optionally also blocklists the releases in Sonarr, so they won't be downloaded again.
Transmission > Settings > Remote > enable remote access (note the port).
./reaparr.py --dry-run # report only
./reaparr.py # really delete
| Option | Default | Notes |
|---|---|---|
--port, --host |
9091, localhost | --url overrides both |
--ext |
7z arj bat cmd exe iso lnk lzh ps1 scr sh vbs zipx |
removed only if the torrent is a single file of one of these |
--interval |
10 | seconds between checks |
--keep-data |
off | remove torrent, keep files |
--dry-run |
off | no removals |
--once |
off | single check, then exit |
--user, --password |
none | see Auth |
Password lookup order: --password, macOS Keychain, interactive prompt (also prompts on a 401 if no credentials given). Wrong credentials exit with an error.
security add-generic-password -a USERNAME -s reaparr -w
With --sonarr-url http://localhost:8989, a matching torrent that is in Sonarr's queue (matched by torrent hash) is first removed from the queue and blocklisted via the Sonarr API (Sonarr then searches for a replacement), then removed from Transmission. Torrents not in Sonarr's queue are just removed from Transmission.
API key (Sonarr > Settings > General): --sonarr-api-key, else Keychain, else prompt.
security add-generic-password -a sonarr -s reaparr -w
Expects settings to live in reaparr.conf (see reaparr.conf.example). No terminal under launchd, so passwords/API keys must be in Keychain (above).
# start launch agent
# first run creates reaparr.conf to edit; then run again to generate the plist from template + conf, install, (re)load
make install
# stop and remove the launch agent
make uninstall
# view logs
tail -f ~/Library/Logs/io.github.stephan5.reaparr.log
Run make install after changing reaparr.conf or reaparr.py. Add --dry-run to the conf to test first.
- Magnet links are only checked once metadata arrives, so they may be partly downloaded before removal.
- Auth failure exits; launchd
KeepAlivewill keep restarting it.
Stdlib unittest, no network, Transmission or Sonarr needed:
make test