rakshasa / rtorrent

rTorrent BitTorrent client
https://github.com/rakshasa/rtorrent/wiki
GNU General Public License v2.0
4.07k stars 408 forks source link

Get tracker details when executing a script #1096

Closed darnir closed 3 years ago

darnir commented 3 years ago

I'm trying to configure my rtorrent such that it executes a script on event.download.finished. However, I can't get it to pass along the list of trackers to my script. My real intention is to execute the script only if the torrent was associated with a given whitelist of trackers.

My current approach is:

method.set_key = event.download.finished,test_notify,"execute.capture_nothrow=/usr/local/bin/test.sh,$d.base_path=,$d.name=,$d.tracker_alias"

However, this causes the event to not be fired at all. It works if I remove the $d.tracker_alias parameter. But then how do I run this script only on certain torrents? For example, the intended test.sh looks like:

case $3 in
tracker.example.com|tracker.example2.com)
    run_tasks
    ;;
*)
    exit
    ;;
esac
rakshasa commented 3 years ago

Why is the tracker_alias missing the =?

Also, tracker_alias is not part of the mainline rtorrent client