rTorrent/Filebot Help (For Hire)

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
JimmyB4403
Posts: 20
Joined: 28 Oct 2014, 14:07

rTorrent/Filebot Help (For Hire)

Post by JimmyB4403 »

I recently purchased a seedbox through seedboxes.cc (which has filebot pre-installed), and I'm trying to automate my media situation. The problem is, I am very unfamiliar with SSH so I'm researching and learning based on other people's posts on this topic - and I have two children under two, so not a lot of time on my hands. I've been able to make some progress myself, but can't get the script to automatically be called when a new file is downloaded. If this is an easy fix, someone please point me in the right direction (with the understanding that I'm very new to all of this, so I appreciate the more you can spell out for me), but if not, I'm happy to pay for someones services to get everything up and running.

I've created a rtorrent-postprocess.sh file that works as designed if manually called

Code: Select all

#!/bin/sh

# debugging - must work
date > /tmp/date.txt
whoami > /tmp/whoami.txt

# Input Parameters
TORRENT_PATH=$1
TORRENT_NAME=$2
TORRENT_LABEL=$3

# Configuration
CONFIG_OUTPUT="/home/user/files/processed"
CONFIG_INPUT="/home/user/files/downloads"

filebot -script fn:amc "$CONFIG_INPUT" --output "$CONFIG_OUTPUT" --action duplicate --conflict skip -non-strict --log-file "/home/user/amc.log" --def unsorted=y music=n artwork=n excludeList=".excludes" ut_dir="$TORRENT_PATH" ut_kind="multi" ut_title="$TORRENT_NAME" ut_label="$TORRENT_LABEL" &

# debugging - may not work
filebot -script fn:sysenv > /tmp/filebot-sysenv.txt 2>&1
and this is the final line of my .rtorrent.rc file when viewing the whole thing through nano:

Code: Select all

method.set_key=event.download.finished,filebot,"execute={/home/user/rtorrent-postprocess.sh,$d.base_path=,$d.name=,$d.custom1=}"
When I downloaded a file to test this all out, nothing happened, so I checked the temp .txt files that should've be created if rtorrent-postprocess.sh was called, and they all showed up. So I'm not sure exactly what is going on.

Two things did stick out to me from the amc.log file that was created when I then ran the postprocessing script manually:

1)

Code: Select all

SEVERE: Unable to set localhost. This prevents creation of a GUID. Cause was: jimmybraun-seedbox.cloud.seedboxes.cc: jimmybraun-seedbox.cloud.seedboxes.cc: Name or service not known
java.net.UnknownHostException: jimmybraun-seedbox.cloud.seedboxes.cc: jimmybraun-seedbox.cloud.seedboxes.cc: Name or servicenot known
I'm not sure what that is all about

2)

Code: Select all

jimmybraun@jimmybraun-seedbox:~$ Run script [fn:amc] at [Sat Sep 30 16:12:33 UTC 2017]
Parameter: unsorted = y
Parameter: music = n
Parameter: artwork = n
Parameter: excludeList = .excludes
Parameter: ut_dir =
Parameter: ut_kind = multi
Parameter: ut_title =
Parameter: ut_label =
Argument[0]: /home/user/files/downloads
Use excludes: /home/user/files/processed/.excludes
Looks like nothing is showing up from the ut_ variables, which makes me wonder if I was supposed to modify those instead of leaving them as in the rtorrent-postprocess.sh file:

Code: Select all

TORRENT_PATH=$1
TORRENT_NAME=$2
TORRENT_LABEL=$3
Full disclosure, I've also used ARG_PATH instead of TORRENT_PATH (and the others) as in your original instructions, and have put the $1,$2,$3 with quotes and without quotes (I've seen them in an out of quotes in different posts) and get the same results every time. It works fine when I call it manually, but will not start automatically after a new file has been downloaded. Someone please let me know where I am going wrong!

Filebot was just step 1 in my process to automate everything, and I still need to get lftp or rsync running to transfer the files over when completed, which I hope goes smoother than this.

Thanks in advance!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: rTorrent/Filebot Help (For Hire)

Post by rednoah »

1.
This is probably a general issue not specific to FileBot, so Google will help.

Here's a potential solution:
https://stackoverflow.com/a/7601052/1514467


2.
You're suggesting that rtorrent isn't calling your script with the appropriate variables. What version of rtorrent are you using?

If your provider is using an older version of rtorrent, then the rtorrent variable names might be slightly different:
viewtopic.php?f=4&t=4765
:idea: Please read the FAQ and How to Request Help.
JimmyB4403
Posts: 20
Joined: 28 Oct 2014, 14:07

Re: rTorrent/Filebot Help (For Hire)

Post by JimmyB4403 »

Thanks. In regards to your reply, I'm assuming that since when I run the script manually it works fine, that "1)" is having no material impact on my situation.

In regards to "2)" the version of rTorrent on the seedbox is 0.9.6/0.13.6 which I believe I'm using the proper code for.

Please advise.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: rTorrent/Filebot Help (For Hire)

Post by rednoah »

1.
Well, what's the difference? Try calling printenv in the two environments and see if there's any notable difference.


2.
You can create a simple test script that simply logs the arguments that are passed. That way you can confirm that rtorrent is calling your script and passing the correct argument values.
:idea: Please read the FAQ and How to Request Help.
JimmyB4403
Posts: 20
Joined: 28 Oct 2014, 14:07

Re: rTorrent/Filebot Help (For Hire)

Post by JimmyB4403 »

I ended up just calling the rtorrent-postprocess.sh line using crontab every 5th minute. Any issues forseen in doing that?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: rTorrent/Filebot Help (For Hire)

Post by rednoah »

As long as you use the exclude list option and make sure there's no partially downloaded files in the input folder, then it should be fine.

5 min interval is way too frequent though. I wouldn't call it more than once every few hours. A amc script call that does nothing isn't exactly instant. ;)
:idea: Please read the FAQ and How to Request Help.
Post Reply