Assistance with AMC Transmission

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
tman12
Posts: 7
Joined: 11 Apr 2014, 15:08

Assistance with AMC Transmission

Post by tman12 »

I know there are tons of posts about this and I have done my due diligence and tried almost everything I can think of to get this to work. I hate not being able to figure this out on my own but after many hours of trying and failing, I need some assistance.

I am on ReadyNAS Ultra 4 running OS6 - I followed the instructions on the Netgear wiki to upgrade and everything is working fine. I had issues with the add-on that they provide so I installed on my own and have Transmssion running, it's version is 2.52 and I am able to download, start/stop daemon, edit settings.json, etc. I also installed java manually and Filebot version 4.5.6 64bit debian and it is working correctly when running manually.

My setup is as follows:
Json.settings (these were updated after stopping daemon and they hold)
"watch-dir": "/data/Documents/transmission/configure/transmission-postprocess.sh",
"watch-dir-enabled": true

The shell script and directory have owner debian-transmission and group debian-transmission and the script is as follows:
#!/bin/bash
filebot -script fn:amc --output "/data/Videos" --log-file amc.log --action duplicate --conflict override -non-strict --def music=y artwork=y "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"

My download directory is 777 and I set umask to 0 in settings file. I have enabled logging in the daemon and can see that transmission is calling the script, but nothing happens.

Some things I am planning to try this evening:
Review transmission-daemon user, I believe it is debian-transmission but I'm going to review the transmission-daemon file for the user field.
In my reading I saw one user using /usr/share/filebot/bin/filebot.sh -script in their shell script so I'm going to give that a try as well, maybe the shell script doesn't know where to call filebot?
I'm also planning on running a test script that is a simple echo "hello" txt just to make sure transmission is actually calling the script.

Any help is greatly appreciated, I've been trying to get this working for days now.
User avatar
rednoah
The Source
Posts: 23934
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Assistance with AMC Transmission

Post by rednoah »

Your first response would be getting the shell output by adding IO redirection to the call:

Code: Select all

filebot -script fn:amc ... > /path/to/output.txt 2>&1
There can't be no output. Either filebot is called and you get some output from filebot. Or filebot is not called and you get output from the shell. Something akin to "java: command not found" and so on.

@see http://www.cyberciti.biz/faq/linux-redi ... t-to-file/
:idea: Please read the FAQ and How to Request Help.
tman12
Posts: 7
Joined: 11 Apr 2014, 15:08

Re: Assistance with AMC Transmission

Post by tman12 »

Just so that I understand you correctly, are you saying to create a new script with only filebot -script fn:amc ... > /path/to/output.txt 2>&1 in it? Basically as a test just run a shell script with that line to see what output I get?

Edit: I think I see what you're saying, the ellipses is the rest of the script. Just add that line to the end of the script, I'll give it a shot this evening. Really hoping I can get this to work, I love using AMC on Windows but want to get away from having my PC on 24/7 since I have a server.
tman12
Posts: 7
Joined: 11 Apr 2014, 15:08

Re: Assistance with AMC Transmission

Post by tman12 »

I figured it out and got it working so I figured I would post my solution below in case anyone has this problem going forward, this should work for other setups as well and not just ReadyNAS.

I ended up getting the Add on from the ReadyNAS Apps section to work, but this would also work from a compiled version.

Make sure transmission is killed before editing json.settings (either from Frontend/Apps/off if using the App or service transmission-daemon stop)

Editing Json.settings file
I did all script editing using vi from inside the terminal. For my install the file is located at /data/Transmission/config
cd /data/Transmission/config
vi settings.json (type i to enable typing and then Esc key to move around - while in Esc mode if you type : you can save by typing wq and hitting enter)
Edit the ipv4 bind address to your NAS IP
Edit the whitelist to 127.0.0.1,192.168.1.*
Edit the rpc bind address to your NAS IP
Look at the port, I believe the default port is 9091 - which is not what the launch button takes you to (8181) - you can either edit this in settings.json or just go to 9091

Accessing the web ui
Type in your nas address followed by the port in your settings.json file followed by /transmission/web/ so if your IP were 192.168.1.223 it would be
192.168.1.223:9091/transmission/web/ now I had troubles connecting and ended up clearing browser history and cache and it finally connected. I found that it was important to include the / after web or I would get an error screen.

Filebot install
I followed this guide: http://www.filebot.net/forums/viewtopic.php?f=8&t=2312 but made some edits
The sources.list is still accurate - make those changes from the guide
The java install is still accurate - install exactly like the guide shows
Make sure you export the path for java export PATH=$PATH:/path/to/your/java (look for the java-8-oracle folder behind jvm - this is the path to use)
The filebot install from the guide has the older version and is for x86 builds - if you are on OS6 then you have a 64bit OS
What I did was go to http://sourceforge.net/projects/filebot/files/filebot/ and make sure I knew which version was the latest and look at the 64bit build
So for my setup I changed
wget http://sourceforge.net/settings/mirror_ ... 3_i386.deb
to
wget http://sourceforge.net/settings/mirror_ ... _amd64.deb

Install using dpkg -i filebot_4.5.6_amd64.deb

Now you have filebot, java, transmission installed

To make sure everything is good do the following from terminal
java -version
you should see java information here

filebot -script "fn:sysinfo"
you should see no errors here and all filebot info

echo $PATH
You should see the path to java

Create a user, for me this was done in the ReadyNAS frontend. To get there go to browser and type in NAS IP followed by /admin i.e 192.168.1.223/admin
Users - add user - I called mine transmission and enter a password (you won't need this later on, but Frontend makes you enter one)
Go to Apps and stop the transmission app or if you aren't using the the ReadyNAS app type in terminal 'service transmission-daemon stop'
Locate the transmission file to edit the User
cd /etc/init.d
vi transmission
Look for user field I think it is USER=guest and change it to the user you created in Frontend i.e USER=transmission (because I called my user transmission)
Save the file

Create your shell script, again I did this from terminal. I'll explain this using the tmp directory because that is how I got everything working and then moved the necessary files where I actually wanted to have them. I found the tmp directory to be the best testing location because of its accessibility.

cd /tmp
vi transmission-postprocess.sh (this file doesn't exist so it will be a blank new file that you can edit)
type in (remember to type i in order to enter text)
#!/bin/bash
filebot -script fn:amc --output "/tmp" --log-file amc.log --action duplicate --conflict override -non-strict --def music=y artwork=y "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"

Save the file by typing : wq

Script permissions:
while in the tmp directory
chown transmission:users transmission-postprocess.sh
chmod +rx transmission-postprocess

Script can now be executed from Transmission, edit setting.json file to call the script
cd /data/Transmission/config
vi settings.json
"script-torrent-done-enabled": true,
"script-torrent-done-filename": "/tmp/transmission-postprocess.sh"
Save settings.json file

Launch transmission and set your downloads to tmp for this example. Now you should have the script inside the tmp directory with user being transmission group being users, transmission runs as user transmission, downloads are saved under user transmission group users and everything should work.

You can use these instructions for any directory, but I found tmp a good one to test with. Basically make sure permissions are exact and I recommend a test script to make sure 100% transmission is calling the script,

Hope this helps someone and saves them the many hours I had to go through.
Post Reply