The clean_transmission plugin used to exist to remove old torrents from transmission after certain criteria had been met. This plugin was removed, but the behavior can now be replicated in a more flexible fashion. This recipe can also be adapted for deluge using the from_deluge and deluge plugins.
tasks:
remove stale torrents:
from_transmission:
host: localhost
port: 9091
username: myusername
password: mypassword
disable: [seen, seen_info_hash]
if:
- transmission_progress == 100: accept
- not transmission_seed_ratio_ok: reject
- not transmission_idle_limit_ok: reject
transmission:
host: localhost
port: 9091
username: myusername
password: mypassword
action: remove
In order to determine what fields are available from the torrent client it is easiest to run a test like this:
flexget --test execute --tasks "remove stale torrents" --dump
The --test
will ensure nothing is actually removed while you are testing, and the --dump
means that all the available entry fields will be printed out. You can then determine which entry fields you would like to filter on.
transmission_
with information about the loaded torrent.Here is how you can emulate the old options for clean_transmission
with this new system.
If you want to make sure the built in transmission seed limits (ratio and/or idle time) are respected, you can set the only_complete
option for from_transmission
plugin to yes
. You can also check the transmission_seed_ratio_ok
and/or transmission_idle_limit_ok
fields as shown in the example above.
from_transmission:
only_complete: yes
Replace the 3.0
in the following example with your desired minimum ratio.
if:
- transmission_ratio < 3.0: reject
Replace the days=3
with the amount of time you would like the torrent to be finished for.
if:
- transmission_date_done > now - timedelta(days=3): reject
If you would like the files to be deleted as well, use the purge
action with transmission plugin rather than remove
.
transmission:
action: purge
If you want to only remove files downloaded on specific directories.
regexp:
reject_excluding:
- "/storage/downloads/(tv|movies)":
from: transmission_downloadDir
If you only want to remove torrents from a given tracker.
regexp:
reject_excluding:
- my_tracker:
from: transmission_trackers
Or if you want to remove torrents from multiple trackers.
regexp:
reject_excluding:
- tracker_a|tracker_b:
from: transmission_trackers
If do not want to remove any torrents from a given tracker.
regexp:
reject:
- my_tracker:
from: transmission_trackers