Help please

Any questions? Need some help?
Post Reply
Pakalolo
Posts: 7
Joined: 15 Oct 2014, 14:45

Help please

Post by Pakalolo »

Overview

Automation I have working so far (all this is done with Hazel)
1. movie/tv show downloads to /Volumes/Media 2/Torrents
2. When complete it copies the contents of the dl'ed folder to /Volumes/Media 2/Move (I do this so I can continue to seed untouched file)
3. When moved to the Move folder, it unarchives and trashes and extra files (nfo, subs, sfv, jpg, etc.)
4. when automation is complete, I am only left with a .mkv.

Automation I want to achieve
1. I want to auto detect if the .mkv is a movie or tv show and automatically rename movie to movie (2014).mkv and rename tv shows to Series name - 1x01 - Episode name.mkv
2. after renamed, I would like to auto sort to proper location. Movies are stored by genre. So directroy is /Volumes/Media 2/Movies/Action/movie (2014).mkv. Genres I currently have are Action, Animation, Comedy, Crime, Drama. TV shows directory is /Volumes/Media 2/TV/Series Name/Series Name Season 1/Series name - 1x01 - Episode name.mkv.
3. After moved to proper location, I would like to update my Plex server automatically.

My System overview

Operating System - OS X version 10.9.5
utorrent - version 1.8.4 (29971)
java - gui - version 8 Update 25 cli - 1.8.0_20 (I think thats right?)
groovy - version 2.3.7 installed using gvm using these instructions http://groovy.codehaus.org/Download#Dow ... ntManager)
Filebot gui - Bought in App store version 4.3 (2485)
Filebot cli - installed using this tut (thanks) http://www.filebot.net/forums/viewtopic.php?f=4&t=2049

Output of

Code: Select all

filebot -script fn:sysinfo

Code: Select all

Macintosh:~ owner$ filebot -script fn:sysinfo
FileBot 4.5 (r2612)
JNA Native: 4.0.0
MediaInfo: MediaInfoLib - v0.7.69
7-Zip-JBinding: OK
chromaprint-tools: fpcalc version 1.1.0 (/opt/homebrew-cask/Caskroom/filebot/4.5/FileBot.app/Contents/MacOS/fpcalc)
Extended Attributes: OK
Groovy Engine: 2.3.7
JRE: Java(TM) SE Runtime Environment 1.8.0_20
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 8 Core / 3 GB Max Memory / 127 MB Used Memory
OS: Mac OS X (x86_64)
uname: Darwin Macintosh.local 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Done ヾ(@⌒ー⌒@)ノ
Groovy Scripts

I customized two scripts to my needs (don't need unarchive or fetch subs)

1.housekeeping.groovy contents (for renaming Movies?)

Code: Select all

// filebot -script fn:housekeeping /Volumes/Media 2/Move/ --output /Volumes/Media 2/Move/ --format <expression>

/*
 * Watch folder for new movies and automatically move/rename new releases
 */

// check for new media files once every 5 minutes
def updateFrequency = 5 * 60 * 1000

// spawn daemon thread
Thread.startDaemon {
	while (sleep(updateFrequency) || true) {
			
		// rename all
		if (_args.rename) {
			args.eachMediaFolder {
				rename(folder:it)
			}
		}
	}
}

println "Press ENTER to abort"
console.readLine() // keep script running until aborted by user
2.watcher.groovy contents (for renaming tv shows?)

Code: Select all

// filebot -script fn:watcher /Volumes/Media 2/Move/ --output /Volumes/Media 2/Move/ --format <expression>

// watch folders and print files that were added/modified
def watchman = args[0].watch { changes ->
	
	// rename all
	if (_args.rename)
		rename(file:changes)
}

watchman.commitDelay = 5 * 1000			// default = 5s
watchman.commitPerFolder = true			// default = true

println "Waiting for events"
if (console) { console.readLine() } else { sleep(Long.MAX_VALUE) } // keep running and watch for changes
It is not working and don't know anything about cli :( . Any help would be much appreciated.
Last edited by Pakalolo on 16 Oct 2014, 01:14, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help Please

Post by rednoah »

0.
If you don't know anything about CLI you don't wanna hack the code/scripts. :lol:

1.
Use the amc script, it'll do everything => http://www.filebot.net/forums/viewtopic ... =215#p1561

2.
Realize that for a computer move and rename is the same operation, and you'll see your point (1) and (2) is the same. You can use a customized output format if you really want {genre} in the path.

3.
The amc script has support for xbmc/plex notifications, other scripts don't.
:idea: Please read the FAQ and How to Request Help.
Pakalolo
Posts: 7
Joined: 15 Oct 2014, 14:45

Re: Help Please

Post by Pakalolo »

0.
Are you still for hire sir. ;)

1.
The amc script is based on windows. uTorrent for os x doe not support "Run program when torrent finishes". I seen a guide how to do it on a mac with Transmission here http://www.filebot.net/forums/viewtopic.php?f=4&t=520. I love transmission but, I can not get rss feeds to work properly :( whereas, uTorrent I have it working perfect.

2.
I may just do away with the genre folders as they are really not needed.

3.
Oh I didn't realize the Transmission Fully Automated Media Center with Transmission post didn't didn't support pled notifications.
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help Please

Post by rednoah »

0.
In this case, I'd feel bad about charging cause the solution is already there. :D

1.
The "amc script" is still just a simple filebot cmdline call, so Hazel or any other tool can call it on demand or in intervals. Just make sure you're only processing new files each run or you will get banned, i.e. read the manual.

2.
Most people do. Since many movies have many genres, it won't always work as you might expect.

3.
That's part of the amc script, not any specific integration. In fact, an specific "integration" is just a basic 1-line shell script that calls filebot and passes some arguments along. It's extremely easy to make a new "integration" for Hazel or cron or whatnot yourself. If you manage to call it manually from the cmdline first anyway for testing. ;)


PS: You probably wanna use --action duplicate so it'll hardlink files if possible. You want to know what a hardlink is. ;)
:idea: Please read the FAQ and How to Request Help.
Pakalolo
Posts: 7
Joined: 15 Oct 2014, 14:45

Re: Help Please

Post by Pakalolo »

Thanks rednoah for your advice. I have everything working with the exept for a few things. I changed my output to match the script. tested with one tv show and one movie.

tv show
1. did not get added in plex media server

movie
1. added in plex media server but did not fetch the proper info (see attached pic)
2. I want the end result to be /Volumes/Media/Movies/File.mkv instead of /Volumes/Media/Movies/File(folder)/file.mkv

Here is what I run from command line:

Code: Select all

filebot -script fn:amc --output "/Volumes/Media 2/Media" --log-file amc.log --action duplicate --def skipExtract=y --action copy -non-strict "/Volumes/Media 2/Move" --def plex=Plex --def excludeList=amc.txt
Here is the outcome of the two tested files:

Code: Select all

Macintosh:~ owner$ filebot -script fn:amc --output "/Volumes/Media 2/Media" --log-file amc.log --action duplicate --def skipExtract=y --action copy -non-strict "/Volumes/Media 2/Move" --def plex=Plex --def excludeList=amc.txt
Locking /Users/owner/.filebot/logs/amc.log
Parameter: skipExtract = y
Parameter: plex = Plex
Parameter: excludeList = amc.txt
Argument: /Volumes/Media 2/Move
Input: /Volumes/Media 2/Move/Noah.2013.1080p.BluRay.x264-SPARKS.mkv
Input: /Volumes/Media 2/Move/Sons.of.Anarchy.S07E06.720p.HDTV.X264-DIMENSION.mkv
Noah.2013.1080p.BluRay.x264-SPARKS.mkv [series: null, movie: Noah (2013)]
Group: [tvs:null, mov:noah 2013, anime:null] => [Noah.2013.1080p.BluRay.x264-SPARKS.mkv]
Group: [tvs:sons of anarchy] => [Sons.of.Anarchy.S07E06.720p.HDTV.X264-DIMENSION.mkv]
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/Volumes/Media 2/Move/Noah.2013.1080p.BluRay.x264-SPARKS.mkv]
[COPY] Rename [/Volumes/Media 2/Move/Noah.2013.1080p.BluRay.x264-SPARKS.mkv] to [/Volumes/Media 2/Media/Movies/Noah (2013)/Noah (2013).mkv]
Processed 1 files
Rename episodes using [TheTVDB]
Auto-detected query: [Sons of Anarchy]
Fetching episode data for [Sons of Anarchy]
[COPY] Rename [/Volumes/Media 2/Move/Sons.of.Anarchy.S07E06.720p.HDTV.X264-DIMENSION.mkv] to [/Volumes/Media 2/Media/TV Shows/Sons of Anarchy/Season 07/Sons of Anarchy - S07E06 - Smoke 'Em if You Got 'Em.mkv]
Processed 1 files
Notify Plex: Plex
SocketTimeoutException: connect timed out
Done ヾ(@⌒ー⌒@)ノ
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help Please

Post by rednoah »

1.
Read the amc docs, if you want a custom format.

2.
Read the Plex docs.

Clearly Plex does not respond to network requests:

Code: Select all

Notify Plex: Plex
SocketTimeoutException: connect timed out
3.
Noah.2013 => gets matched to a movie called "Noah" that was made in "2013"

If you're looking for Noah (2014) then you'll have to manually do this one, since the current filename is too misleading => https://www.themoviedb.org/movie/86834-noah
:idea: Please read the FAQ and How to Request Help.
Pakalolo
Posts: 7
Joined: 15 Oct 2014, 14:45

Re: Help Please

Post by Pakalolo »

Thanks for the advice. I got it working with this command:

Code: Select all

filebot -script fn:amc --output "/Volumes/Media 2/Media" --log-file amc.log --action duplicate --def "movieFormat=/Volumes/Media 2/Media/Movies/{n} ({y})"  --def skipExtract=y --action copy -non-strict "/Volumes/Media 2/Move" --def excludeList=amc.txt
I did not set up plex bc i set it up on plex media server I am assuming that you would add this code though?

Code: Select all

--def plex=http://127.0.0.1:32400
The output to the above command tested on another file

Code: Select all

Macintosh:~ owner$ filebot -script fn:amc --output "/Volumes/Media 2/Media" --log-file amc.log --action duplicate --def "movieFormat=/Volumes/Media 2/Media/Movies/{n} ({y})"  --def skipExtract=y --action copy -non-strict "/Volumes/Media 2/Move" --def excludeList=amc.txt
Locking /Users/owner/.filebot/logs/amc.log
Parameter: movieFormat = /Volumes/Media 2/Media/Movies/{n} ({y})
Parameter: skipExtract = y
Parameter: excludeList = amc.txt
Argument: /Volumes/Media 2/Move
Input: /Volumes/Media 2/Move/X-Men.Days.of.Future.Past.2014.1080p.BluRay.X264-AMIABLE.mkv
X-Men.Days.of.Future.Past.2014.1080p.BluRay.X264-AMIABLE.mkv [series: X Men, movie: X-Men: Days of Future Past (2014)]
Exclude Series: X Men
Group: [tvs:null, mov:x men days of future past 2014, anime:null] => [X-Men.Days.of.Future.Past.2014.1080p.BluRay.X264-AMIABLE.mkv]
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/Volumes/Media 2/Move/X-Men.Days.of.Future.Past.2014.1080p.BluRay.X264-AMIABLE.mkv]
Stripping invalid characters from new path: /Volumes/Media 2/Media/Movies/X-Men: Days of Future Past (2014)
[COPY] Rename [/Volumes/Media 2/Move/X-Men.Days.of.Future.Past.2014.1080p.BluRay.X264-AMIABLE.mkv] to [/Volumes/Media 2/Media/Movies/X-Men Days of Future Past (2014).mkv]
Processed 1 files
Done ヾ(@⌒ー⌒@)ノ
Any suggestions how to automate the command line when something enters the Move folder? Will the attached pic work for a rule in Hazel for what I'm trying to accomplish?
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help please

Post by rednoah »

1.
It's just --def plex=hostname|ip and not the whole URL.

2.
Ask Hazel developers. ;)


:idea: Why the .tiff images? Please use .png like everyone else. Preferably uploaded on imgur like it says here => viewtopic.php?f=6&t=1868
:idea: Please read the FAQ and How to Request Help.
Pakalolo
Posts: 7
Joined: 15 Oct 2014, 14:45

Re: Help please

Post by Pakalolo »

I just wanted to say thank you so much rednoah for your help. You were very prompt to help me and steer me in the right direction. What I did was start from the ground up and done away with Hazel. The movies and tv shows work flawless. The default music acted a little funny. it would sometimes create to two folders. i would like this output:

Code: Select all

--def "musicFormat=/Volumes/Media 2/Media/Music/Artist/Album/01 - Song.flac"
obviously thats not the proper cmd but thats what I want it to say :D Some help with that would be appreciated. As a extra thanks for this automation which is wonderful and even better, your prompt support, I gave a donation :D
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help please

Post by rednoah »

Have you tried prototyping your format with the Format Editor in the GUI? This is (almost) one of the default examples:

Code: Select all

{n}/{album+'/'}{pi.pad(2)+' - '}{t}
:idea: Please read the FAQ and How to Request Help.
Pakalolo
Posts: 7
Joined: 15 Oct 2014, 14:45

Re: Help please

Post by Pakalolo »

I didn't know about the Format Editor in the GUI and the example about is exacty what I needed :). I tried it where the Album folder is it makes two folders example: Florida Georgia Line(artist)/Anything Goes & Dirt are created(2 seperate album folders). the contents of Anything Goes (which is what is was) was correct but, the contents of Dirt contained another copy of 01 - Song.flac. here is my cmd:

Code: Select all

--def "musicFormat=/Volumes/Media 2/Media/Music/{n}/{album+'/'}{pi.pad(2)+' - '}{t}"
The Format editor in the GUI state that above is what I want. any way to not create the extra folder?
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help please

Post by rednoah »

Artist folder:

Code: Select all

{n}/
Album folder (optional album folder if album metadata is available):

Code: Select all

{album+'/'}
Play with it in the GUI until you figure it out. AcoustID may classify music different from how you expect since many songs are part of many albums in many release regions, collections, etc

You seem to be saying it's copying 1 file to 2 locations, but I assure you every file is only moved/copied once.
:idea: Please read the FAQ and How to Request Help.
Pakalolo
Posts: 7
Joined: 15 Oct 2014, 14:45

Re: Help please

Post by Pakalolo »

Played with it the GUI and got everything working perfect. Thank you so much for your hard work and support to resolve my problems :). Also, I updated to osx 10.10 (Yosemite) and script still works like dream.
elgallo
Posts: 40
Joined: 29 Apr 2014, 10:33

Re: Help please

Post by elgallo »

Pakalolo

do you have a copy/pic of your hazel rules to run the script?
Post Reply