Help with the Automated Media Server (MAC)

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Tito
Posts: 6
Joined: 26 Jan 2013, 01:18

Help with the Automated Media Server (MAC)

Post by Tito »

Hi!

I would like to start of with mentioning that I'm totally inexperienced when it comes to programming in any form.

Anyway, I have for several hours tried to get the Automated Media Server to work on my iMac, but I can't find any "run program after download" option in uTorrent, not even in the advanced settings. I tried setting Transmission up with an Applescript, but I didn't get it working. So after hours and hours of googling and testing I'm turning to you for help.

Here is what I want FileBot to do:

1. Start automatically when a torrent is finished.
2. Extract the torrent if it's a rar archive.
3. Download subtitles.
4. Rename and copy my TvShows (so I can continue seeding).
5. Tell XBMC to rescan library.

That's about it!

Thanks for the help in advance // Tito
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help with the Automated Media Server (MAC)

Post by rednoah »

Really doesn't matter what torrent client you're using as long as it can somehow run a cmdline tool on completed files.

Maybe Automator could work if you can't make your torrent client call filebot. Have a look a the "Standalone usage" so you can get a feel for how to use the utorrent-postprocess script from console.
:idea: Please read the FAQ and How to Request Help.
Tito
Posts: 6
Joined: 26 Jan 2013, 01:18

Re: Help with the Automated Media Server (MAC)

Post by Tito »

Alright, so I think I got things running with the Applescript and Terminal. I can use Transmission to call for the script when a torrent finishes. So the problem I have now is that the script tries to gather information from uTorrent, how do I change that to Transmission?

Here is how my code looks like atm:

Code: Select all

tell application "Terminal"
	do script "/Applications/Filebot.app/Contents/MacOS/filebot -script fn:utorrent-postprocess --output /Users/Tito/Movies --action copy --conflict override -non-strict --def subtitles=en artwork=y "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L" "ut_state=%S"
	delay 3
	
end tell
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help with the Automated Media Server (MAC)

Post by rednoah »

You need to figure out how Transmissions passes in variables. Then You'll need to pass in all the ut_* parameters.
:idea: Please read the FAQ and How to Request Help.
Tito
Posts: 6
Joined: 26 Jan 2013, 01:18

Re: Help with the Automated Media Server (MAC)

Post by Tito »

How do I know wich variable is what? (Sorry, but I know nothing about programming)
Tito
Posts: 6
Joined: 26 Jan 2013, 01:18

Re: Help with the Automated Media Server (MAC)

Post by Tito »

I have decided to stick with uTorrent, and use Automator to run the script instead when a file is moved into my finished downloads folder. But I still can't get it running, it gives me this error:

Syntax Error

Expected end of line but found identifier

And then it points to ut_dir
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help with the Automated Media Server (MAC)

Post by rednoah »

Your Apple Script has a Syntax Error. I'm on Windows.

See here for example console output and parameter values:
http://filebot.sourceforge.net/forums/v ... =435#p3137

Did you watch this video?
http://youtu.be/brGyo2uQzSs
:idea: Please read the FAQ and How to Request Help.
Tito
Posts: 6
Joined: 26 Jan 2013, 01:18

Re: Help with the Automated Media Server (MAC)

Post by Tito »

Yeah I did, and I cant get it working, still gives me the Syntax Error.
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help with the Automated Media Server (MAC)

Post by rednoah »

You should look for other help forums on apple script. I don't do Apple stuff so can't help u with this.
:idea: Please read the FAQ and How to Request Help.
Tito
Posts: 6
Joined: 26 Jan 2013, 01:18

Re: Help with the Automated Media Server (MAC)

Post by Tito »

Guess I will just have to wait until someone makes a tutorial.
buck3y3
Donor
Posts: 39
Joined: 05 Nov 2012, 01:19

Re: Help with the Automated Media Server (MAC)

Post by buck3y3 »

I just created a folder action to Run Shell script

Code: Select all

/Applications/Filebot.app/Contents/MacOS/filebot -script fn:utorrent-postprocess "/Users/YourFolder/Movies/Finished" --output "/Users/YourFolder/Movies" --action copy --conflict skip -non-strict --def subtitles=y --def subtitles=en,es artwork=n --def clean=n


Not as cool as uTorrent running the commands but just as efficient.
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help with the Automated Media Server (MAC)

Post by rednoah »

It'll work but without any modification to keep track of what has been processed and what hasn't this is always gonna process everything. Putting a lot of unnecessary load on TheMovieDB, TheTVDB, etc. So you should try to find a better solution.
:idea: Please read the FAQ and How to Request Help.
buck3y3
Donor
Posts: 39
Joined: 05 Nov 2012, 01:19

Re: Help with the Automated Media Server (MAC)

Post by buck3y3 »

I suppose its not automated either, considering I am copying the file to the folder so that it continues to seed and also run, defeating the automated purpose. I could set up another automator that copies my finished torrents to the folder that would call the utorrent process. That should do the trick till i figure out how to run it the other way
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help with the Automated Media Server (MAC)

Post by rednoah »

Here's how to set up the automated media center scripts with Transmission:
http://filebot.sourceforge.net/forums/v ... 3382#p3380
:idea: Please read the FAQ and How to Request Help.
buck3y3
Donor
Posts: 39
Joined: 05 Nov 2012, 01:19

Re: Help with the Automated Media Server (MAC)

Post by buck3y3 »

Ok I feel dumb. I am trying to get the Transmission side set up for mac and can't figure out the chmod or where my .json file is. Granted I am still new to the world of mac but still it shouldn't be that hard with google. If anyone has any luck please post how to accomplish those two things, in the meantime I will try to stumble upon it.

thanks rednoah for the beginning point to set this up with transmission, filebot is amazing.
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help with the Automated Media Server (MAC)

Post by rednoah »

You know what chmod is right? The command to changing file permissions?

On Linux all the transmission configs are in my home folder. I'm sure it can't be much different on Mac. Must be somewhere in the home folder.
:idea: Please read the FAQ and How to Request Help.
buck3y3
Donor
Posts: 39
Joined: 05 Nov 2012, 01:19

Re: Help with the Automated Media Server (MAC)

Post by buck3y3 »

I am still googling what chmod is, but haven't figured out how to use it.

I have searched and searched to find the file and still cannot.
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help with the Automated Media Server (MAC)

Post by rednoah »

chmod is one of the most basic cmdline tools. Just do any tutorial on how to use the console and you'll get it.

e.g.

Code: Select all

chmod +rx transmission-postprocess
Here's docs on where transmission stores configs:
https://trac.transmissionbt.com/wiki/ConfigFiles
:idea: Please read the FAQ and How to Request Help.
buck3y3
Donor
Posts: 39
Joined: 05 Nov 2012, 01:19

Re: Help with the Automated Media Server (MAC)

Post by buck3y3 »

I found that article but there is not a settings.json file in that folder.

As far as chmod, I tried using terminal which I assume is cmdline and it says there is no such file. I tried using the path to,the file but got the same message
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help with the Automated Media Server (MAC)

Post by rednoah »

transmission-postprocess would be a file you created right? And it's really just a text file that contains the bash script i posted plus made executable via chmod.

Code: Select all

reinhard@serenity:~$ cat transmission-postprocess 
#!/bin/bash
filebot -script fn:utorrent-postprocess --output "$HOME/Videos" --action copy --conflict override -non-strict --def artwork=y "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"
reinhard@serenity:~$ chmod +rx transmission-postprocess 
reinhard@serenity:~$ ls -l transmission-postprocess 
-rwxrwxr-x 1 reinhard reinhard 224 Feb  6 14:34 transmission-postprocess
Configuration Files | Mac OS X Defaults
Application settings are stored in ~/Library/Preferences/org.m0k.transmission.plist
So settings are stored as plist files. Still just a text file with key/value pairs. Just have a look at the files.
:idea: Please read the FAQ and How to Request Help.
buck3y3
Donor
Posts: 39
Joined: 05 Nov 2012, 01:19

Re: Help with the Automated Media Server (MAC)

Post by buck3y3 »

Yes I created the file as a .txt and I used another program to create one as a shell script. When I chmod +rx either one it says No such file or directory. Even when I use path/to/file i get the same result.

As far as the plist is this the section I should modify?

InspectorTable_SUEnableAutomaticChecksXAutoSize_InspectorContentHeightTracker_!NSNavPanelExpandedSizeForOpenMode[SortReverse]DonateAskDateYFilterBar_DownloadAskManual_SULastCheckTime_0NSTableView Sort Ordering InspectorTableWebSeeds_DoneScriptEnabled_AutoImportDirectory_InspectorSelectedZSpeedLimitZAutoImport_DownloadLocationConstant[InfoVisible_1NSTableView Hidden Columns InspectorTableWebSeeds_SpeedLimitDownloadLimit_DeleteOriginalTorrent]WarningDonateXBindPo

shouldn't i just be able to call the script from the preferences in transmission....once i figure how to create this script?

Also I am assuming where you have "$HOME/Videos" I would need to enter the actual path to where my files are saved?

Edit: I am making a little progress, will post method and results soon

Edit2: I finally figured how to create the script through terminal and nano and then chmod it. I had to use /Applications/Filebot.app/Contents/MacOS/filebot instead of filebot by itself and also change the output path. Instead of changing the plist, I set the preferences to call the script after the torrent was complete

and it works!
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help with the Automated Media Server (MAC)

Post by rednoah »

Some tutorial with screenshots on how to do it on Mac would be appreciated by others I'm sure. ;)
:idea: Please read the FAQ and How to Request Help.
buck3y3
Donor
Posts: 39
Joined: 05 Nov 2012, 01:19

Re: Help with the Automated Media Server (MAC)

Post by buck3y3 »

Even though I am sure this was only difficult me, I would be more than happy to do this later tonight or tomorrow when I get a few minutes.
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help with the Automated Media Server (MAC)

Post by rednoah »

Nope, that was still pretty reasonable since my tutorial was for Linux and it does seem to work differently on Mac. ;)
:idea: Please read the FAQ and How to Request Help.
Post Reply