Changeing AMC default naming

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
phifer2088
Posts: 23
Joined: 12 Jan 2015, 15:47

Changeing AMC default naming

Post by phifer2088 »

Hello

I am using filebot and the AMC script through command line and having a problem figuring out how to change the default naming scheme.

I know this line is in the AMC post

Code: Select all

--def "seriesFormat=X:/TV/{n}/{'S'+s}/{fn}" "animeFormat=X:/Anime/{n}/{fn}" "movieFormat=Z:/Movies/{n} {y}/{fn}" "musicFormat=Z:/Music/{n}/{fn}"
Is there a command I can type to have my current naming scheme displayed? Are the options filebot supports for naming posted somewhere?

Thanks
User avatar
rednoah
The Source
Posts: 23947
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Changeing AMC default naming

Post by rednoah »

1.
So you mean you want to see the default naming scheme?

See Examples: viewtopic.php?f=5&t=2
See Source: https://github.com/filebot/scripts/blob ... groovy#L47

2.
Yes. Some of the more common options are listed here:
http://www.filebot.net/naming.html

And in the Format Editor itself:
Image

You will find lots of examples and help here in the forums as well.
:idea: Please read the FAQ and How to Request Help.
phifer2088
Posts: 23
Joined: 12 Jan 2015, 15:47

Re: Changeing AMC default naming

Post by phifer2088 »

Thank you.

As far as the format editor I won't be able to access it, or I don't know how, because this is running on a Linux based NAS that I access via command line only.

If there is a way to create a custom QPKG for QNAP brand NAS's that would be great. I will actually bring this up to the message board over there.

Thanks again this will get me started.
User avatar
rednoah
The Source
Posts: 23947
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Changeing AMC default naming

Post by rednoah »

1.
I'd prototype the format on whatever computer you used to write this post. ;)

2.
I'll leave that to the QNAP community. Shouldn't be hard if someone were to take the time to maintain it.
:idea: Please read the FAQ and How to Request Help.
phifer2088
Posts: 23
Joined: 12 Jan 2015, 15:47

Re: Changeing AMC default naming

Post by phifer2088 »

I am getting lots of expressions as undefined. I found the mediabindingbean.java file thinking that might help me, but I don't know how to import that using a windows machine. I assume my Linux NAS has something similar because CouchPotato gives the option of adding {vf} to show (1080P, 720P, 480P, etc.). But i am getting a binding exception in the Windows version of Filebot.
User avatar
rednoah
The Source
Posts: 23947
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Changeing AMC default naming

Post by rednoah »

FAQ wrote:Q: Why is MediaInfo not working?
@see viewtopic.php?f=3&t=7#p7
:idea: Please read the FAQ and How to Request Help.
phifer2088
Posts: 23
Joined: 12 Jan 2015, 15:47

Re: Changeing AMC default naming

Post by phifer2088 »

I have done this. I did this before posting, but it does not say what kind of file is going to allow me to use the other options. If I select a file from my media library it has just as many as the default.
User avatar
rednoah
The Source
Posts: 23947
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Changeing AMC default naming

Post by rednoah »

1.
So MediaInfo is working? Confirmed?

2.
Have you selected a sample file for testing? Where do you think {af} {vf} etc are getting their values from?

3.
i am getting a binding exception
What does it say? Screenshots?
:idea: Please read the FAQ and How to Request Help.
phifer2088
Posts: 23
Joined: 12 Jan 2015, 15:47

Re: Changeing AMC default naming

Post by phifer2088 »

I googled how to install groovy on a windows machine. http://mythruna.com/forum/index.php?topic=1001.0


Image
I can now pick one of my blu-ray rips and it will bind some of the other options including the {vf} that I wanted.

Now I just have to figure out how to do the same on my NAS since it is not a custom Linux build.
phifer2088
Posts: 23
Joined: 12 Jan 2015, 15:47

Re: Changeing AMC default naming

Post by phifer2088 »

Am I on the right track with this script?

Code: Select all

filebot -script fn:amc --output "/share/Multimedia" --def "seriesFormat=/TV/{n}/{'S'+s}/{fn}" "animeFormat=/Anime/{n}/{fn}" "movieFormat=/Movies/{n} {y}/{fn} {y} ({vf})" "musicFormat=/Music/{n}/{fn}" --log-file amc.log --action move --conflict override --def music=y --def subtitles=en --def artwork=y --def clean=y -non-strict "/share/Download/couchpotato" --def excludeList=amc.txt
I assume not since it does not progress past

Code: Select all

Locking /opt/share/filebot/data/admin/logs/amc.log
User avatar
rednoah
The Source
Posts: 23947
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Changeing AMC default naming

Post by rednoah »

Looks good to me.

The Locking /log/file just means that it's waiting for another filebot process to finish. You can only have one active filebot process processing files at a time.

On slow embedded processors the amc script might take a while to boot up and start processing.
:idea: Please read the FAQ and How to Request Help.
phifer2088
Posts: 23
Joined: 12 Jan 2015, 15:47

Re: Changeing AMC default naming

Post by phifer2088 »

I figured out I needed the full path for the output of the file. I was thinking it would just add to the --output "/share/Multimedia"

Now that i have changed that I am getting successful file renames, but it is adding the year before and after the resolution instead of just before.

Terminator 4 Salvation 2009 1080p 2009

Code: Select all

filebot -script fn:amc --output "/share/Multimedia" --def "seriesFormat=/share/Multimedia/TV/{n}/{'S'+s}/{fn}" "animeFormat=/share/Multimedia/Anime/{n}/{fn}" "movieFormat=/share/Multimedia/Movies/{n} {y}/{fn} {vf}" "musicFormat=/share/Multimedia/Music/{n}/{fn}" --log-file amc.log --action move --conflict override --def music=y --def subtitles=en --def artwork=y --def clean=y -non-strict "/share/Download/couchpotato/test" --def excludeList=amc.txt
While in the process of trying to find out the issue I ran across another format I wanted to try and I got the following results.

Terminator Salvation (2009) [, , ]

Code: Select all

filebot -script fn:amc --output "/share/Multimedia" --def "seriesFormat=/share/Multimedia/TV/{n}/{'S'+s}/{fn}" "animeFormat=/share/Multimedia/Anime/{n}/{fn}" "movieFormat=/share/Multimedia/Movies/{n} {y}{'['+source+']'}/{n} ({y}) [{fn.match(/3D/)+', '}{vf}, {ac}, {af}]" "musicFormat=/share/Multimedia/Music/{n}/{fn}" --log-file amc.log --action move --conflict override --def music=y --def subtitles=en --def artwork=y --def clean=y -non-strict "/share/Download/couchpotato/test" --def excludeList=amc.txt
The more I read the more I realize all the things that can be done. Since I have some 3D films I think this would be a great one to have because currently I am manually moving 3D films to a 3D folder. I am curious where this would be placed. Is added to the current script or a new one?

Code: Select all

{fn =~ /3D/ ? '3D Movies' : 'Movies'}/{n} ({y}){fn =~ /3D/ ? ' [3D] [H-SBS]' : ''}/{n} ({y}) ({vf}){fn =~ /3D/ ? ' H-SBS' : ''}{' CD'+pi}
Thanks for the help and your dedication.
phifer2088
Posts: 23
Joined: 12 Jan 2015, 15:47

Re: Changeing AMC default naming

Post by phifer2088 »

So I downloaded the groovy scripts into a folder on my NAS. I am trying to customize them. I only changed the section below and that was just to make the movies formatted with resolution, audio codec, and audio channels.

Code: Select all

// series/anime/movie format expressions
def format = [
	tvs:   any{ seriesFormat }{ '''TV Shows/{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t.replaceAll(/[`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}''' },
	anime: any{ animeFormat  }{ '''Anime/{primaryTitle}/{primaryTitle} - {sxe} - {t.replaceAll(/[!?.]+$/).replaceAll(/[`´‘’ʻ]/, /'/).replacePart(', Part $1')}''' },
	mov:   any{ movieFormat  }{ '''Movies/{n} {y}{'['+source+']'}/{n} ({y}){fn.match(/3D/)+', '}[{vf}, {ac}, {af}] ''' },
	music: any{ musicFormat  }{ '''Music/{n}/{album+'/'}{pi.pad(2)+'. '}{artist} - {t}''' },
	unsorted: any{ unsortedFormat }{ '''Unsorted/{file.structurePathTail}''' }
]
I then run this command in command line and get errors.

Code: Select all

filebot -script /share/Download/filebot/scripts/customamc.groovy --output "/share/Multimedia" --log-file amc.log --action move --conflict override --def music=y --def subtitles=en --def artwork=y --def clean=y -non-strict "/share/Download/test" --def excludeList=amc.txt
I was getting the error below and figured it was because it was looking for 64 bit Java. Since 64-bit Java is not available for the QNAP at the moment I rolled my Filebot back to 4.5.6_i686

Code: Select all

Unable to load library 'mediainfo': Native library 
After installing 4.5.6_i686 I get the following

Code: Select all

Locking /opt/share/filebot/data/logs/amc.log
MultipleCompilationErrorsException: startup failed:
Script1.groovy: 136: unable to resolve class FileSet
 @ line 136, column 22.
   def excludePathSet = new FileSet()
                        ^

1 error

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script1.groovy: 136: unable to resolve class FileSet
 @ line 136, column 22.
   def excludePathSet = new FileSet()
                        ^

1 error

        at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:61)
        at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:82)
        at net.filebot.cli.ArgumentProcessor.process(ArgumentProcessor.java:112)
        at net.filebot.Main.main(Main.java:169)
Failure (°_°)
User avatar
rednoah
The Source
Posts: 23947
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Changeing AMC default naming

Post by rednoah »

1.
You don't need to download any scripts, and you shouldn't, unless you know what you're doing.

2.
unable to resolve class FileSet
You're trying to run the latest version of the script with an outdated version of filebot. Please use the latest version of filebot.
:idea: Please read the FAQ and How to Request Help.
phifer2088
Posts: 23
Joined: 12 Jan 2015, 15:47

Re: Changeing AMC default naming

Post by phifer2088 »

So the new one won't work until QNAP supports a 64-bit version of JAVA?
User avatar
rednoah
The Source
Posts: 23947
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Changeing AMC default naming

Post by rednoah »

Nobody ever said that. I'm sure it works just fine.
:idea: Please read the FAQ and How to Request Help.
phifer2088
Posts: 23
Joined: 12 Jan 2015, 15:47

Re: Changeing AMC default naming

Post by phifer2088 »

I reinstalled Filebot 4.6 and as I said before I edited the AMC script to include the parameters I wanted added to the file names and here are the results.
I tried just adding them to the script I run instead of downloading and making changes to your script, but I never had any positive results and it may be for the same reason as with this custom AMC script.

As you can see I am getting Avatar (2009)[, , ].ts instead of Avatar (2009) [1080P, 6ch, ACC].ts

Code: Select all

[~] # filebot -script /share/Download/filebot/scripts/customamc.groovy --output "/share/Multimedia" --log-file amc.log --action move --conflict override --def m                          usic=y --def subtitles=en --def artwork=y --def clean=y -non-strict "/share/Download/test" --def excludeList=amc.txt
Locking /opt/share/filebot/data/admin/logs/amc.log
Run script [/share/Download/filebot/scripts/customamc.groovy] at [Fri Aug 14 15:07:37 GMT 2015]
Parameter: music = y
Parameter: subtitles = en
Parameter: artwork = y
Parameter: clean = y
Parameter: excludeList = amc.txt
Argument: /share/CACHEDEV1_DATA/Download/test
Input: /share/CACHEDEV1_DATA/Download/test/Avatar (2009).ts
Input: /share/CACHEDEV1_DATA/Download/test/Terminator Salvation.mkv
Avatar (2009).ts [series: Avatar, movie: Avatar (2009)]
Exclude Series: Avatar
Terminator Salvation.mkv [series: null, movie: Terminator Salvation (2009)]
Group: [tvs:null, mov:avatar 2009, anime:null] => [Avatar (2009).ts]
Group: [tvs:null, mov:terminator salvation 2009, anime:null] => [Terminator Salvation.mkv]
Get [English] subtitles for 1 files
CmdlineException: OpenSubtitles: Please enter your login details by calling `filebot -script fn:configure`
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/share/CACHEDEV1_DATA/Download/test/Avatar (2009).ts]
[MOVE] Rename [/share/CACHEDEV1_DATA/Download/test/Avatar (2009).ts] to [/share/Multimedia/Movies/Avatar 2009[TS]/Avatar (2009)[, , ].ts]
Processed 1 files
Fetching movie artwork for [Avatar (2009)] to [/share/Multimedia/Movies/Avatar 2009[TS]]
MediaInfoException: Unable to load 32-bit native library 'mediainfo'
Artwork already exists: /share/Multimedia/Movies/Avatar 2009[TS]/poster.jpg
Artwork already exists: /share/Multimedia/Movies/Avatar 2009[TS]/fanart.jpg
Fanart already exists: /share/Multimedia/Movies/Avatar 2009[TS]/clearart.png
Fanart already exists: /share/Multimedia/Movies/Avatar 2009[TS]/logo.png
Fanart already exists: /share/Multimedia/Movies/Avatar 2009[TS]/disc.png
Get [English] subtitles for 1 files
CmdlineException: OpenSubtitles: Please enter your login details by calling `filebot -script fn:configure`
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/share/CACHEDEV1_DATA/Download/test/Terminator Salvation.mkv]
[MOVE] Rename [/share/CACHEDEV1_DATA/Download/test/Terminator Salvation.mkv] to [/share/Multimedia/Movies/Terminator Salvation 2009/Terminator Salvation (2009)[ , , ].mkv]
Processed 1 files
Fetching movie artwork for [Terminator Salvation (2009)] to [/share/Multimedia/Movies/Terminator Salvation 2009]
MediaInfoException: Unable to load 32-bit native library 'mediainfo'
Fetching /share/Multimedia/Movies/Terminator Salvation 2009/poster.jpg => {category: posters, width: 1000, height: 1500, language: en, url: http://image.tmdb.or                          g/t/p/original/hxDfhavtxA2Ayx7O9BsQMcZRdG0.jpg}
Fetching /share/Multimedia/Movies/Terminator Salvation 2009/fanart.jpg => {category: backdrops, width: 1280, height: 720, language: en, url: http://image.tmdb.o                          rg/t/p/original/qYEfP2JclXbUJUf00OdTbtenxlR.jpg}
Fanart not found: /share/Multimedia/Movies/Terminator Salvation 2009/clearart.png / movieart
Fetching /share/Multimedia/Movies/Terminator Salvation 2009/logo.png => {type=movielogo, id=2578, url=http://assets.fanart.tv/fanart/movies/534/movielogo/terminator-salvation-4f8f18bf921bc.png, lang=en, likes=1}
Fetching /share/Multimedia/Movies/Terminator Salvation 2009/disc.png => {type=moviedisc, id=65311, url=http://assets.fanart.tv/fanart/movies/534/moviedisc/terminator-salvation-5310b1a554260.png, lang=en, likes=5, disc_type=bluray}
Clean clutter files and empty folders
Done ヾ(@⌒ー⌒@)ノ
User avatar
rednoah
The Source
Posts: 23947
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Changeing AMC default naming

Post by rednoah »

Well, FileBot is working, but the optional mediainfo features may not:

Code: Select all

MediaInfoException: Unable to load 32-bit native library 'mediainfo'
As said before, you need a compatible libmediainfo for that to work. Depending on your architecture that's either just a matter of copying libmediainfo into your library path, or you're plain out of luck and it just won't work.

filebot -script fn:sysinfo might have been useful => viewtopic.php?f=6&t=1868
:idea: Please read the FAQ and How to Request Help.
phifer2088
Posts: 23
Joined: 12 Jan 2015, 15:47

Re: Changeing AMC default naming

Post by phifer2088 »

I am searching the web to find answers to installing Mediainfo.

Code: Select all

FileBot 4.6 (r3052)
JNA Native: 4.0.0
MediaInfo: java.lang.UnsatisfiedLinkError: Unable to load library 'mediainfo': Native library (linux-x86/libmediainfo.so) not found in resource path ([file:/sha                        re/CACHEDEV1_DATA/.qpkg/Optware/share/filebot/FileBot.jar])
p7zip: Version 9.04 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,2 CPUs)
chromaprint-tools: java.io.IOException: Cannot run program "fpcalc": error=2, No such file or directory
Extended Attributes: OK
Groovy Engine: 2.4.3
JRE: Java(TM) SE Embedded Runtime Environment 1.8.0_06 (headless)
JVM: 32-bit Java HotSpot(TM) Embedded Server VM
CPU/MEM: 2 Core / 910 MB Max Memory / 29 MB Used Memory
OS: Linux (i386)
uname: Linux Phifer 3.12.6 #1 SMP Fri May 22 01:12:26 CST 2015 x86_64 unknown
Done ヾ(@⌒ー⌒@)ノ
User avatar
rednoah
The Source
Posts: 23947
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Changeing AMC default naming

Post by rednoah »

You'll need the 32-bit Linux libraries then.

Have you tried these?
https://sourceforge.net/p/filebot/code/ ... inux-i686/
:idea: Please read the FAQ and How to Request Help.
Post Reply