Page 1 of 1

AMC Script: custom name for TV-episodes

Posted: 19 Nov 2014, 15:13
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.

Re: AMC Script: custom name for TV-episodes

Posted: 19 Nov 2014, 16:19
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