How can I configure rtorrent to call the amc script on download complete?

Support for Ubuntu and other Desktop Linux distributions
Post Reply
Mantinum
Posts: 4
Joined: 26 Aug 2018, 07:05

How can I configure rtorrent to call the amc script on download complete?

Post by Mantinum »

Hello, first of all please excuse my English, being French I do best with translations of Google and the little knowledge I have.

Here I have a problem, I managed to install Filebot (well I hope) on a debian server but when I run the command:

Code: Select all

sh /home/alex/rtorrent-postprocess
the result is:

Code: Select all

Locking /home/alex/.session/amc.log
Run script [fn:amc] at [Sun Aug 26 08:45:17 CEST 2018]
Parameter: music = y
Parameter: artwork = n
Parameter: plex = *****
Parameter: ut_dir = 
Parameter: ut_kind = multi
Parameter: ut_title = 
Parameter: ut_label = 
Illegal usage: no input
Failure (°_°)
I tried to make a :

Code: Select all

chown -R user:user /home/user/.filebot
but without success

My "rtorrent-postprocess" :

Code: Select all

#!/bin/bash
TORRENT_PATH=$1
TORRENT_NAME=$2
TORRENT_LABEL=$3

sh /home/alex/.filebot/filebot.sh --lang fr -script fn:amc --output "/home/alex/Media" --log-file "/home/alex/.session/amc.log" --action symlink --conflict override -non-strict --def music=y artwork=y "ut_dir=$TORRENT_PATH" "ut_kind=multi" "ut_title=$TORRENT_NAME" "ut_label=$TORRENT_LABEL" &
and my ".rtorrent.rc" :

Code: Select all

network.scgi.open_port = 127.0.0.1:5001
encoding.add = UTF-8
network.port_range.set = 45000-65000
network.port_random.set = no
pieces.hash.on_completion.set = no
directory.default.set = /home/alex/torrents
session.path.set = /home/alex/.session
protocol.encryption.set = allow_incoming, try_outgoing, enable_retry
schedule2 = watch_directory,1,1,load.start=/home/alex/watch/*.torrent
schedule2 = untied_directory,5,5,stop_untied=/home/alex/watch/*.torrent
schedule2 = espace_disque_insuffisant,1,30,close_low_diskspace=500M
trackers.use_udp.set = yes
dht.mode.set = off
protocol.pex.set = no
throttle.min_peers.normal.set = 40
throttle.max_peers.normal.set = 100
throttle.min_peers.seed.set = 10
throttle.max_peers.seed.set = 50
throttle.max_uploads.set = 15
execute2 = {sh,-c,/usr/bin/php /var/www/rutorrent/php/initplugins.php alex &}
method.set_key=event.download.finished,filebot_amc,"execute={/home/alex/rtorrent-postprocess,$d.get_base_path=,$d.get_name=,$d.get_custom1=}"
thank you very much.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Illegal problem folder input (License activate)

Post by rednoah »

When rtorrent-postprocess is called by rtorrent, rtorrent will pass certain parameters (path / title / label) via command-line arguments, and those are in turn passed on to the amc script.

If you run this:

Code: Select all

./rtorrent-postprocess
Then nothing happens, because nothing is supposed to happen, because the command does not specify any input folder.

If you want to test run your rtorrent-postprocess script, then you have to call it the same way as rtorrent, with all the necessary parameters:

Code: Select all

./rtorrent-postprocess "/path/to/Downloads/Avatar" "Avatar" "Movies"
As you can see in the script, Argument 1, 2 and 3 correspond to torrent path, name and label respectively:

Code: Select all

TORRENT_PATH=$1
TORRENT_NAME=$2
TORRENT_LABEL=$3
:idea: Please read the FAQ and How to Request Help.
Mantinum
Posts: 4
Joined: 26 Aug 2018, 07:05

Re: How can I configure rtorrent to call the amc script on download complete?

Post by Mantinum »

Thank you only I tried to run it manually, and it worked:

Code: Select all

/home/alex/rtorrent-postprocess /home/alex/torrents/
However, it does not start automatically at the end of a download.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How can I configure rtorrent to call the amc script on download complete?

Post by rednoah »

Sounds like a rtorrent issue then. Try the rtorrent forums for more specific help on how to use rtorrent.

Here's some general advice though:
viewtopic.php?f=4&t=3067
:idea: Please read the FAQ and How to Request Help.
Post Reply