AMC Script: problems with escaping seriesformat

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
mschenk
Posts: 1
Joined: 16 Sep 2013, 20:47

AMC Script: problems with escaping seriesformat

Post by mschenk »

Hi,

first of all thanks for this great piece of software!
I'm trying to setup the amc script with my usual renaming pattern. Unfortunately I'm strugging with the escaping of the special characters (I'm not an linux expert):

environment:

Code: Select all

ms@rv-linux:~$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.04
DISTRIB_CODENAME=raring
DISTRIB_DESCRIPTION="Ubuntu 13.04"
ms@rv-linux:~$ uname -a
Linux rv-linux 3.8.0-30-generic #44-Ubuntu SMP Thu Aug 22 20:52:24 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
ms@rv-linux:~$ java -version
java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.13.04.2)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
I'm using the latest version of FileBot (3.62) with the newest amc script.

Pattern (that works perfectly in the GUI):

Code: Select all

/home/ms/videos/series/{n}/{n.replaceTrailingBrackets().replaceAll(/[!?.]+$/).replaceAll(/[`´‘’ʻ]/, "'").lowerTrail()} - Season {s}/{n.replaceTrailingBrackets().replaceAll(/[!?.]+$/).replaceAll(/[`´‘’ʻ]/, "'").lowerTrail()} - {s00e00} - {t.replaceTrailingBrackets().replaceAll(/[!?.]+$/).replaceAll(/[`´‘’ʻ]/, "'").lowerTrail().replacePart(', Part $1')} ({airdate.format('yyyy-MM-dd')})

Command Line:

Code: Select all

#!/bin/bash
filebot.sh -script fn:amc "/home/ms/series_tosort/" --output "/home/ms/videos/series/" --def music=n --def subtitles=en,de --def clean=y --def "seriesFormat={n}/{n.replaceTrailingBrackets().replaceAll(/[!?.]+$/).replaceAll(/[`´‘’ʻ]/, \"\'\").lowerTrail()} - Season {s}/{n.replaceTrailingBrackets().replaceAll(/[!?.]+$/).replaceAll(/[`´‘’ʻ]/, \"\'\").lowerTrail()} - {s00e00} - {t.replaceTrailingBrackets().replaceAll(/[!?.]+$/).replaceAll(/[`´‘’ʻ]/, \"\'\").lowerTrail().replacePart(\', Part $1\')} ({airdate.format(\'yyyy-MM-dd\')})" --log-file amc.log --action copy -non-strict 
Unfortunately it doesn't work.
Output is:

Code: Select all

"-" is not a valid option
I tried to find an automated online tools that can help with the correct escaping but without success.

Any help is very much appreciated!

Thanks in advance,
Marcus
User avatar
rednoah
The Source
Posts: 23027
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC Script: problems with escaping seriesformat

Post by rednoah »

Escaping is shit-work, unfortunately. You'll have to start simple, with a very basic format. If it works add some complexity, if it fails you know where the error is. Repeat until you build the whole thing.

PS: I think you only need to escape \", not \' though go by trial and error and you'll figure it out step by step.
:idea: Please read the FAQ and How to Request Help.
Post Reply