Trouble with $execute_capture

dsouvik215

Member
May 25, 2018
896
0
16
I'm trying to get my install to set the custom1 variable of a download based on the output of a command, using execute_capture. The command is a python script that returns a path I specify in the script based on the tracker url inside a file. The output of this command (located at ~/.sbin/getpath) when called with the path to a torrent file as its argument is something like:

Code:
~/files/tracker.url/
Which is a valid path on my system. Also, this output does not end in a newline. Once a download is completed, rtorrent calls the movedefault method, which is defined as

Code:
system.method.insert=movedefault,simple,"d.set_custom1=\"\$execute_capture=~/.sbin/getpath,~/.config/rtorrent/session/,$d.get_hash=,.torrent\";d.set_directory=$d.get_custom1=;execute=mv,-u,$d.get_base_path=,$d.get_custom1="
If I wrote this right, it should set the custom1 to be the output of the getpath command, which has been called with the download's torrent file as its argument. What am I missing?
 

das329717

Member
May 25, 2018
928
0
16
You missed that if you call a Python script anyway, you can avoid all this unpleasantness and do stuff from there, using documented and sane syntax.