Use complex format expression on command-line

Support for Windows users
Post Reply
Brax
Posts: 16
Joined: 31 Mar 2018, 09:58

Use complex format expression on command-line

Post by Brax »

Hi Rednoah,

I'm using a preset (based on a tip u gave me a few years ago) :

Code: Select all

{hd.replaceAll("UHD", replacement = "B:/2160P").replaceAll("SD", replacement = "H:/DVDRIPS").replaceAll("HD", replacement =  vf.replaceAll("720p", replacement = "B:/720P").replaceAll("1080p", replacement = "S:/1080P"))}/{collection.ascii()}/{ny.ascii().upperInitial()} [{imdbid}]/{ny.ascii().upperInitial()} [{imdbid}] {if (hd =~ /HD/) vf}
I'm trying to convert it into a cmdline :

Code: Select all

filebot -script fn:amc --mode=Movies --action move --lang fr --db TheMovieDB --conflict skip -non-strict "E:/DDL/" --log-file "E:/Automatisation/amc.log" --def excludeList="E:/Automatisation/amc.txt" --def movieFormat="({hd.replaceAll("UHD", replacement = "B:/2160P").replaceAll("SD", replacement = "H:/DVDRIPS").replaceAll("HD", replacement =  vf.replaceAll("720p", replacement = "B:/720P").replaceAll("1080p", replacement = "S:/1080P"))}/{collection.ascii()}/{ny.ascii().upperInitial()} [{imdbid}]/{ny.ascii().upperInitial()} [{imdbid}] {if (hd =~ /HD/) vf})" --def seriesFormat="E:/TV Shows/{n}/{n}.{s00e00}.{t}" --def emby=127.0.01:86f83fd076e44609bf2bf8e96846c1d
and I'm getting an error I'm not able to correct :

Code: Select all

Run script [fn:amc] at [Fri Aug 09 12:01:11 CEST 2019]
Parameter: excludeList = E:/Automatisation/amc.txt
Parameter: movieFormat = ({hd.replaceAll(UHD, replacement = B:/2160P).replaceAll(SD, replacement = H:/DVDRIPS).replaceAll(HD, replacement =  vf.replaceAll(720p, replacement = B:/720P).replaceAll(1080p, replacement = S:/1080P))}/{collection.ascii()}/{ny.ascii().upperInitial()} [{imdbid}]/{ny.ascii().upperInitial()} [{imdbid}] {if (hd =~ /HD/) vf})
Argument[0]: E:\DDL
Use excludes: E:\Automatisation\amc.txt (11319)
Input: E:\DDL\Fichiers divers\The.Sun.Is.Also.a.Star.2019.mkv
Group: [Movie:The Sun Is Also a Star (2019)] => [The.Sun.Is.Also.a.Star.2019.mkv]
ScriptException: SyntaxError: illegal colon after argument expression;
   solution: a complex label expression before a colon must be parenthesized
Finished without processing any files
Abort (×_×)
I have two questions :

1- Would you please help me to correct this error ?

2- This cmdline will only proceed movies, no TV shows.
I know i dont need the --def seriesFormat="E:/TV Shows/{n}/{n}.{s00e00}.{t}" part, but I can't manage to make filebot not rename movies it doesn't recognize into tv shows.
Is there please a simple trick ?

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

Re: Use complex format expression on command-line

Post by rednoah »

1.
Please read Cmdline and Argument Passing.

:idea: Use the @file syntax for reading command-line arguments from external text files, neatly avoiding issues related to parsing complex command-line arguments.


2.
The amc script allows you to force movie mode via the --def ut_label parameter:

Code: Select all

--def ut_label=Movies
:idea: Please read the FAQ and How to Request Help.
Brax
Posts: 16
Joined: 31 Mar 2018, 09:58

Re: Use complex format expression on command-line

Post by Brax »

Hi Rednoah,

Just coming back to say thanks :
Using your tips I sorted it out quite easily :
CMD File :

Code: Select all

filebot -script fn:amc --mode=Movies --action move --lang fr --db TheMovieDB --conflict skip -non-strict "E:/DDL/" --log-file "E:/Automatisation/amc.log" --def excludeList="E:/Automatisation/amc.txt" --def @"E:/Automatisation/arguments.txt"
Arguments :

Code: Select all

ut_label=Movies
movieFormat={hd.replaceAll("UHD", replacement = "B:/2160P").replaceAll("SD", replacement = "H:/DVDRIPS").replaceAll("HD", replacement =  vf.replaceAll("720p", replacement = "B:/720P").replaceAll("1080p", replacement = "S:/1080P"))}/{collection.ascii()}/{ny.ascii().upperInitial()} [{imdbid}]/{ny.ascii().upperInitial()} [{imdbid}] {if (hd =~ /HD/) vf}
seriesFormat="E:/TV Shows/{n}/{n}.{s00e00}.{t}"
animeFormat="E:/Anime/{n}/{n}.{s00e00}.{t}"
emby=127.0.01:86f83fd076e44609bf2bf8e96846c1d
I guess seriesFormat and animeFormat are not usefull, but it works :)

Best regards
Post Reply