Running FileBot from the console, Groovy scripting, shell scripts, etc
Amishman
Donor
Posts: 56 Joined: 29 Dec 2013, 15:54
Post
by Amishman » 16 Feb 2014, 02:17
I found this script by Ithiel
http://www.filebot.net/forums/viewtopic ... 1311#p7928 and I would like to incorporate it into my script but I'm having an issue.
This is what I am running from the CLI.
Code: Select all
filebot -script fn:amc --output "C:/test_output" --action test -non-strict "C:/test_input" --conflict override --def "seriesFormat=TV/{n}/{'Season '+s.pad (1)}/{s00e00} {t}" "movieFormat=New Movies/{n} ({y}) {\"[$vf]\"}/{n} ({y})" --def clean=y --def plex=localhost {fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, " ") + ')'}
This is the results.
Code: Select all
Parameter: seriesFormat = TV/{n}/{'Season '+s.pad (1)}/{s00e00} {t}/{n} {s00e00} {t}
Parameter: movieFormat = New Movies/{n} ({y}) {"[$vf]"}/{n} ({y})
Parameter: clean = y
Parameter: plex = localhost
Argument: C:\test_input
Argument: C:\Users\Amishman\{fn.contains('3D')
Exception: File not found: C:\Users\Amishman\{fn.contains('3D')
Failure (░_░)
Launch4j: Failed to run the given command.
I think it needs quotes since it wants to end at the space. I tried putting quotes in different places but I did get it right.
Ithiel
Power² User
Posts: 204 Joined: 11 Jul 2013, 14:58
Post
by Ithiel » 16 Feb 2014, 08:10
Hi Amishman,
I'm not overly familiar with the AMC (that's more rednoah's thing), but at a guess, I think you might be having an issue with escaping quotes (or more accurately, quotes you need to escape).
Example of Escaped Quotes:
I.e. I think that this:
Code: Select all
{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}
May need to be:
Code: Select all
{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':\"\"}
Also... I'm pretty sure that the fn.contains and whatnot is meant to be part of the movie/episode format area as well.
Can you please try this and let me know if it works:
Code: Select all
filebot -script fn:amc --output "C:/test_output" --action test -non-strict "C:/test_input" --conflict override --def "seriesFormat=TV/{n}/{'Season '+s.pad (1)}/{s00e00} {t} {fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':\"\"}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, \" \") + ')'}" "movieFormat=New Movies/{n} ({y}) {\"[$vf]\"}/{n} {fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':\"\"}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, \" \") + ')'} ({y})" --def clean=y --def plex=localhost
There can be only one Power² User
Amishman
Donor
Posts: 56 Joined: 29 Dec 2013, 15:54
Post
by Amishman » 16 Feb 2014, 22:49
Thank you Ithiel. That worked perfectly.
Ithiel
Power² User
Posts: 204 Joined: 11 Jul 2013, 14:58
Post
by Ithiel » 17 Feb 2014, 00:57
sweet! glad it worked for you
not bad for a lucky guess, if I do say so myself, lol.
maybe I should quickly go buy a lottery ticket while I'm at it
There can be only one Power² User