AMC Script: custom name for TV-episodes

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Asturia
Posts: 1
Joined: 19 Nov 2014, 14:53

AMC Script: custom name for TV-episodes

Post by Asturia »

I'm trying to configure this script so that it renames my tv-episodes to a standard format.
This is the format I'm using untill now within Filebot itself, and there it just works.

Code: Select all

{n.upperInitial().space('.').replaceAll(/[,()]+/).replaceAll(/\.-\./,'.')}.{s00e00}{"."+fn.match(/(?i:unrated)/).toLowerCase().upperInitial()}{"."+fn.match(/(?i:uncut)/).toLowerCase().upperInitial()}{"."+fn.match(/(?i:extended)/).toLowerCase ().upperInitial()}{"."+fn.match(/(?i:internal)/).toUpperCase()}{(dim[1]>480 &&  dim[0]==1280) ? '.720p' : (dim[1]>720 && dim[0]==1920) ? '.1080p' : null}{".$source"}{"."+vc.replaceAll(/AVC/, "H264")}{'-'+fn.replaceAll(/$n/,n.replaceAll(/ [-]/,'.')).match(/(?:(?<=[-])(?!(cd|CD)[0-9]+)\w+$)|(?:^(?!(cd|CD)[0-9]+)[A-Za-z0-9]+(?=[-]))|(?:(?<=^[\[])[^\]]+(?=[\]]))|(?:(?<=[\[])[^\]]+(?=[\]]$))/)}{"."+fn.match(/(?i:proper)/).toUpperCase()}{"."+fn.match(/(?i:repack)/).toUpperCase()}{"."+group}{"."+lang}
Now i'm trying to automate this.
This is the commandline I'm using:

Code: Select all

filebot -script fn:amc --output "C:\Users\admin\Downloads\Sickbeard\Import\tv-series" --log-file amc.log --action test --conflict override -non-strict --def "seriesFormat="{n.upperInitial().space('.').replaceAll(/[,()]+/).replaceAll(/\\.-\\./,'.')}.{s00e00}{\".\"+fn.match(/(?i:unrated)/).toLowerCase().upperInitial()}{\".\"+fn.match(/(?i:uncut)/).toLowerCase().upperInitial()}{\".\"+fn.match(/(?i:extended)/).toLowerCase ().upperInitial()}{\".\"+fn.match(/(?i:internal)/).toUpperCase()}{(dim[1]>480 &&  dim[0]==1280) ? '.720p' : (dim[1]>720 && dim[0]==1920) ? '.1080p' : null}{\".$source\"}{\".\"+vc.replaceAll(/AVC/,\"H264\")}{'-'+fn.replaceAll(/$n/,n.replaceAll(/ [-]/,'.')).match(/(?:(?<=[-])(?!(cd|CD)[0-9]+)\\w+$)|(?:\^(?!(cd|CD)[0-9]+)[A-Za-z0-9]+(?=[-]))|(?:(?<=\^[\\[])[\^\\]]+(?=[\\]]))|(?:(?<=[\\[])[\^\\]]+(?=[\\]]$))/)}{\".\"+fn.match(/(?i:proper)/).toUpperCase()}{\".\"+fn.match(/(?i:repack)/).toUpperCase()}{\".\"+group}{\".\"+lang}\""
I've translated my import setting with the Escape Tool.

This is the only error message I'm getting:

Code: Select all

[0-9]+)[A-Za-z0-9]+(? was unexpected at this time.
User avatar
rednoah
The Source
Posts: 23005
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC Script: custom name for TV-episodes

Post by rednoah »

Check the logs. It'll show you what FileBot thinks you passed in as seriesFormat, so then you can look for what's different. Obviously something is not passed in correctly, but only a computer can make sense of this gibberish.

I'm sure you'll find where the issue is, just need to be smart about figuring it out. :D

In fact, I'd find a smarter way of calling filebot! :D

@see viewtopic.php?f=4&t=1041#p9794
:idea: Please read the FAQ and How to Request Help.
Post Reply