rtorrent script

jith45

Member
May 25, 2018
960
0
16
I know this isn't an rtorrent support forum, but I know a lot of the members here know a thing or two about rtorrent scripting so I thought I might ask for some help.

I'm trying to get a script to run on torrent completion. I tried this in my rtorrent.rc file:

system.method.set_key = event.download.finished,toSickbeard,"execute={/home/andrew/.config/sickbeard/rtorrentToSickBeard.py,$d.get_base_path=,$d.get_name=,$d.get_custom1=}"

And this is working great. The rtorrentToSickBeard.py script is just writing it's arguments to a text file for testing. All three of those parameters get's passed to my script and get written to a test file.

Now what I want is to add a branch command to this so that it only executes if the torrent's label equals "tv".

This is what I have:

# Method that returns true if the lable is tv
system.method.insert=isSickbeard,simple,"equal={$d.get_custom1=,tv}"

system.method.set_key = event.download.finished,toSickbeard,"branch=$isSickbeard=,\"execute={/home/andrew/.config/sickbeard/rtorrentToSickBeard.py,$d.get_base_path=,$d.get_name=,$d.get_custom1=}\""


This isn't working at all. Nothing happens. I have log.execute=/tmp/exec.log in my config and I'm not seeing anything in there as to what's going on. Can anyone see anything wrong with my syntax? I can't find very much info on the equal command so I'm not sure if I'm using it right.
 

dsouvik215

Member
May 25, 2018
896
0
16
Why the hell do you try to solve things in scripting hell, that you can quite easily do in your script?
 

somus1735

Member
May 25, 2018
833
0
16
Ah! It's funny that that never crossed my mind. That's why I posted for help to get some more eyes on it. Thanks for your suggestion and that's what I'll do.