[AMC] rtorrent instructions incomplete?

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Joon
Donor
Posts: 62
Joined: 05 Apr 2014, 14:13

[AMC] rtorrent instructions incomplete?

Post by Joon »

Hello,

I just reinstalled and noticed that the instructions for AMC in rtorrent have changed a little.
I followed the instructions to the letter as described in viewtopic.php?f=4&t=215&p=5316 with the exception of the command which has changed as of 0.9.6 (which i am also using).

Code: Select all

method.set_key=event.download.finished,filebot,"execute={'`pwd`/rtorrent-postprocess.sh',$d.base_path=,$d.name=,$d.custom1=}"
However it is never stated anywhere where to put the script or if i should change the path itself to be able to use the above line and thus my script never runs.

I have tried modifying the path like so:
{'`pwd`/home/user/rtorrent-postprocess.sh',$d.base_path=,$d.name=,$d.custom1=} (what is the `pwd` for ?)
{'/home/user/rtorrent-postprocess.sh',$d.base_path=,$d.name=,$d.custom1=}
{/home/user/rtorrent-postprocess.sh,$d.base_path=,$d.name=,$d.custom1=}

But none of them end up executing the script as no log appears.
i turned on logging for rtorrent but i don't think events that have to do with the executing of a script are logged, as everything it does appears except that.

ps: the script is executable, has the right permissions, has the right user:group and i'm restarting rtorrent with each modification.

Any help is appreciated, thanks!

edit: the script

Code: Select all

#!/bin/bash
TORRENT_PATH=$1
TORRENT_NAME=$2
TORRENT_LABEL=${3//%20/ }

if [[ $TORRENT_LABEL == "Anime "* ]]
then
filebot -script fn:amc --output "$HOME/downloads" --log-file "$HOME/amc.log" --action hardlink --conflict override -non-strict --def "ignore=(?i)Programs" "clean=y" "ut_dir=$TORRENT_PATH" "ut_kind=multi" "ut_title=$TORRENT_NAME" "ut_label=$TORRENT_LABEL" --filter "label =~ info.id" &
elif [[ $TORRENT_LABEL == "Anime_2 "* ]]
then
filebot -script fn:amc --output "$HOME/downloads" --log-file "$HOME/amc.log" --action hardlink --conflict override -non-strict --def "ignore=(?i)Programs" "clean=y" "ut_dir=$TORRENT_PATH" "ut_kind=multi" "ut_title=$TORRENT_NAME" "ut_label=$TORRENT_LABEL" --filter "label =~ info.id && age < 5" &
else
filebot -script fn:amc --output "$HOME/downloads" --log-file "$HOME/amc.log" --action hardlink --conflict override -non-strict --def "ignore=(?i)Programs" "clean=y" "ut_dir=$TORRENT_PATH" "ut_kind=multi" "ut_title=$TORRENT_NAME" "ut_label=$TORRENT_LABEL" &
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [AMC] rtorrent instructions incomplete?

Post by rednoah »

1.
This is a command:

Code: Select all

echo 'system.method.set_key=event.download.finished,filebot,"execute={'`pwd`/rtorrent-postprocess.sh',$d.get_base_path=,$d.get_name=,$d.get_custom1=}"' >> ~/.rtorrent.rc
The `pwd` part is replaced by the current working directory, where you have downloaded the script and yields output such as this:

Code: Select all

system.method.set_key=event.download.finished,filebot,"execute={/home/me/rtorrent-postprocess.sh,$d.get_base_path=,$d.get_name=,$d.get_custom1=}"
As such, the script can be anywhere, as long as rtorrent is configured correctly via the .rtorrent.rc config file.


2.
FileBot is a complex beast. It may or may not work for a number of reasons. I'd start with something simple to make sure that rtorrent is calling your postprocess script:
viewtopic.php?f=4&t=3067
:idea: Please read the FAQ and How to Request Help.
Joon
Donor
Posts: 62
Joined: 05 Apr 2014, 14:13

Re: [AMC] rtorrent instructions incomplete?

Post by Joon »

rednoah wrote: 05 Jul 2017, 11:38 1.
This is a command:

Code: Select all

echo 'system.method.set_key=event.download.finished,filebot,"execute={'`pwd`/rtorrent-postprocess.sh',$d.get_base_path=,$d.get_name=,$d.get_custom1=}"' >> ~/.rtorrent.rc
The `pwd` part is replaced by the current working directory, where you have downloaded the script and yields output such as this:

Code: Select all

system.method.set_key=event.download.finished,filebot,"execute={/home/me/rtorrent-postprocess.sh,$d.get_base_path=,$d.get_name=,$d.get_custom1=}"
As such, the script can be anywhere, as long as rtorrent is configured correctly via the .rtorrent.rc config file.


2.
FileBot is a complex beast. It may or may not work for a number of reasons. I'd start with something simple to make sure that rtorrent is calling your postprocess script:
viewtopic.php?f=4&t=3067
Thanks for pointing me in the right direction Rednoah, much appreciated!

Have a nice day :)
Post Reply