That is the correct output from PowerShell.
Code: Select all
# filebot -script fn:sysenv --format "{n}"
Returns:
Code: Select all
# Arguments #
args[0] = -script
args[1] = fn:sysenv
args[2] = --format
args[3] = {n}
RIGHT.

I've found a section of code where the problem lies.

This works
Code: Select all
{
def space = call{' '};
def ChannelString = any{(0.0+audio.'ChannelPositionsString2'*.replaceAll(/Object\sBased\s\/|0.(?=\d.\d)/, '')*.split(' / ')*.collect{ it.split('/')*.toBigDecimal().sum() }*.max().max()).toString()}{channels};
def codecSubVersion = any{audio.any{ a -> call{a.FormatProfile} =~ 'HRA' } ? '.HRA' : null}{audio.any{ a -> call{a.FormatProfile} =~ 'X / MA / Core' } ? '-X' : null}{audio.any{ a -> call{a.FormatProfile} =~ 'MA / Core' } ? '.MA' : null}{audio.any{ a -> call{a.FormatProfile} =~ 'ES Matrix / Core' } ? '-ES' : null}{null};
def codecVersion = any{audio.Codec.join().match(/DTS-HD/)+codecSubVersion+'.'+audio.Codec.join().match(/TrueHD/)}{audio.Codec.join().match(/DTS-HD/) && codecSubVersion == '-X' ? 'DTS-X' : null}{audio.Codec.join().match(/DTS-HD/)+codecSubVersion}{audio.Codec.join().match(/TrueHD/)}{audio.Codec.join().match(/DTS/)+codecSubVersion.replaceAll(/null/)}{ac};
def dir_root = call{'Z:/Movies & TV/'};
call{hd.matches(/(?i)SD/) ? '480p-720p/' : ''}+
call{hd.matches(/(?i)HD/) ? '720p-1080p/' : ''}+
call{hd.matches(/(?i)UHD/) ? '4k/' : ''};
def main_title =
space + '(' + call{y} + ')'+
space + call{fn.matches(/(?i).+\b25th.+?anniv.+/) ? '(25th Anniv. Edition)' : ''}+
space + call{fn.matches(/(?i).+\b\(limited\b.*?\).+/) ? '(Limited Edition)' : ''}+
space + call{fn.matches(/(?i).+\b\(uncut\b.*?\).+/) ? '(Uncut)' : ''}+
space + call{fn.matches(/(?i).+\bcollector.+?s.+?edition\b.+/) ? '(Collector\'s Edition)' : ''}+
space + call{fn.matches(/(?i).+\bdirect.+?cut\b.+/) ? '(Director\'s Cut)' : ''}+
space + call{fn.matches(/(?i).+\bextended.+?\b.+/) ? '(Extended)' : ''}+
space + call{fn.matches(/(?i).+\bextended.+?edit\b.+/) ? '(Extended Edition)' : ''}+
space + call{fn.matches(/(?i).+\bimax\b.+/) ? '(IMAX Edition)' : ''}+
space + call{fn.matches(/(?i).+\blimited\b.+/) ? '(Limited)' : ''}+
space + call{fn.matches(/(?i).+\bremastered\b.+/) ? '(Remastered)' : ''}+
space + call{fn.matches(/(?i).+\bsuper.+duper.+cut\b.+/) ? '(Super Duper Cut)' : ''}+
space + call{fn.matches(/(?i).+\btheatrical\b.+/) ? '(Theatrical)' : ''}+
space + call{fn.matches(/(?i).+\bunrated\b.+/) ? '(Unrated)' : ''}+
space + call{any{fn.match(/\([^\()+?[^\d]+?\)\s*/)} {''}{''}}+
space + call{self.vf ? self.vf : self.hpi}+
space + call{hd}+
space + call{source.matches(/(?i)blu.*ray/) ? 'Blu-ray' : {source} ?: 'WEB-DL'}+
space + call{fn.matches(/(?i).+\bremux\b.+/) ? 'REMUX' : ''}+
space + call{self.hdr ? self.hdr + bitdepth + 'bit' : 'non-HDR'}+
space + call{vc}+
space + call(allOf{codecVersion.replaceAll(/null/)}{ChannelString + 'ch'}{aco.match(/Atmos/)}).join(' ')+
'_'+
call{any{"$group"}{fn.match(/(?<=[_-])[^\s_-]+?$/)}{'NA'}.replaceAll(/[-_\[\]]\s*|\.\w{3}$/, '')};
def lang = call{any{'.'+lang}{lang}}+{fn.matches(/(?i).+sdh.+/) ? '_SDH' : ''}{any{fn.match(/(?i)\(foreignpartsonly\)/)}{''}};
def ext = call{'.'+ext};
(call(main_title) + call(lang)).replaceAll(/null/)
}

This does nawt:
Code: Select all
{
def space = call{' '};
def ChannelString = any{(0.0+audio.'ChannelPositionsString2'*.replaceAll(/Object\sBased\s\/|0.(?=\d.\d)/, '')*.split(' / ')*.collect{ it.split('/')*.toBigDecimal().sum() }*.max().max()).toString()}{channels};
def codecSubVersion = any{audio.any{ a -> call{a.FormatProfile} =~ 'HRA' } ? '.HRA' : null}{audio.any{ a -> call{a.FormatProfile} =~ 'X / MA / Core' } ? '-X' : null}{audio.any{ a -> call{a.FormatProfile} =~ 'MA / Core' } ? '.MA' : null}{audio.any{ a -> call{a.FormatProfile} =~ 'ES Matrix / Core' } ? '-ES' : null}{null};
def codecVersion = any{audio.Codec.join().match(/DTS-HD/)+codecSubVersion+'.'+audio.Codec.join().match(/TrueHD/)}{audio.Codec.join().match(/DTS-HD/) && codecSubVersion == '-X' ? 'DTS-X' : null}{audio.Codec.join().match(/DTS-HD/)+codecSubVersion}{audio.Codec.join().match(/TrueHD/)}{audio.Codec.join().match(/DTS/)+codecSubVersion.replaceAll(/null/)}{ac};
def dir_root = call{'Z:/Movies & TV/'};
call{hd.matches(/(?i)SD/) ? '480p-720p/' : ''}+
call{hd.matches(/(?i)HD/) ? '720p-1080p/' : ''}+
call{hd.matches(/(?i)UHD/) ? '4k/' : ''};
def main_title = call{n.replace(':','-').replaceAll(/[\/:*?"<>|]/,' - ')}+
space + '(' + call{y} + ')'+
space + call{fn.matches(/(?i).+\b25th.+?anniv.+/) ? '(25th Anniv. Edition)' : ''}+
space + call{fn.matches(/(?i).+\b\(limited\b.*?\).+/) ? '(Limited Edition)' : ''}+
space + call{fn.matches(/(?i).+\b\(uncut\b.*?\).+/) ? '(Uncut)' : ''}+
space + call{fn.matches(/(?i).+\bcollector.+?s.+?edition\b.+/) ? '(Collector\'s Edition)' : ''}+
space + call{fn.matches(/(?i).+\bdirect.+?cut\b.+/) ? '(Director\'s Cut)' : ''}+
space + call{fn.matches(/(?i).+\bextended.+?\b.+/) ? '(Extended)' : ''}+
space + call{fn.matches(/(?i).+\bextended.+?edit\b.+/) ? '(Extended Edition)' : ''}+
space + call{fn.matches(/(?i).+\bimax\b.+/) ? '(IMAX Edition)' : ''}+
space + call{fn.matches(/(?i).+\blimited\b.+/) ? '(Limited)' : ''}+
space + call{fn.matches(/(?i).+\bremastered\b.+/) ? '(Remastered)' : ''}+
space + call{fn.matches(/(?i).+\bsuper.+duper.+cut\b.+/) ? '(Super Duper Cut)' : ''}+
space + call{fn.matches(/(?i).+\btheatrical\b.+/) ? '(Theatrical)' : ''}+
space + call{fn.matches(/(?i).+\bunrated\b.+/) ? '(Unrated)' : ''}+
space + call{any{fn.match(/\([^\()+?[^\d]+?\)\s*/)} {''}{''}}+
space + call{self.vf ? self.vf : self.hpi}+
space + call{hd}+
space + call{source.matches(/(?i)blu.*ray/) ? 'Blu-ray' : {source} ?: 'WEB-DL'}+
space + call{fn.matches(/(?i).+\bremux\b.+/) ? 'REMUX' : ''}+
space + call{self.hdr ? self.hdr + bitdepth + 'bit' : 'non-HDR'}+
space + call{vc}+
space + call(allOf{codecVersion.replaceAll(/null/)}{ChannelString + 'ch'}{aco.match(/Atmos/)}).join(' ')+
'_'+
call{any{"$group"}{fn.match(/(?<=[_-])[^\s_-]+?$/)}{'NA'}.replaceAll(/[-_\[\]]\s*|\.\w{3}$/, '')};
def lang = call{any{'.'+lang}{lang}}+{fn.matches(/(?i).+sdh.+/) ? '_SDH' : ''}{any{fn.match(/(?i)\(foreignpartsonly\)/)}{''}};
def ext = call{'.'+ext};
(call(main_title) + call(lang)).replaceAll(/null/)
}

The only line difference is the added line:
Code: Select all
call{n.replace(':','-').replaceAll(/[\/:*?"<>|]/,' - ')}+
I get this error with it added:
Although the working code is not perfect, it now shows a WARNING message (but still works):
Code: Select all
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedConstructor$1 (file:/C:/Program%20Files/WindowsApps/PointPlanck.FileBot_4.8.5.0_x64__49ex9gnthnt12/jar/groovy.jar) to constructor java.math.BigDecimal(java.math.BigInteger,long,int,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedConstructor$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[TEST] from [Z:\Movies & TV\_Newly DL'd\_To Process\Movie 1\Movie 1.nfo] to [Z:\Movies & TV\_Newly DL'd\_To Process\Movie 1\(2007) (Director's Cut) 1080p HD Blu-ray non-HDR x264 DTS 5.1ch_SiNNERS.nfo]
[TEST] from [Z:\Movies & TV\_Newly DL'd\_To Process\Movie 1\Movie 1.mkv] to [Z:\Movies & TV\_Newly DL'd\_To Process\Movie 1\(2007) (Director's Cut) 1080p HD Blu-ray non-HDR x264 DTS 5.1ch_SiNNERS.mkv]
[TEST] from [Z:\Movies & TV\_Newly DL'd\_To Process\Movie 1\--db.url] to [Z:\Movies & TV\_Newly DL'd\_To Process\Movie 1\(2007) 1080p HD Blu-ray non-HDR x264 DTS 5.1ch_db.url]
[TEST] from [Z:\Movies & TV\_Newly DL'd\_To Process\Movie 1\tmdb.url] to [Z:\Movies & TV\_Newly DL'd\_To Process\Movie 1\(2007) 1080p HD Blu-ray non-HDR x264 DTS 5.1ch_NA.url]
[TEST] from [Z:\Movies & TV\_Newly DL'd\_To Process\Movie 2\Movie 2.nfo] to [Z:\Movies & TV\_Newly DL'd\_To Process\Movie 2\(2007) 720p HD BRRip non-HDR x265 DTS 5.1ch_ESiR.nfo]
[TEST] from [Z:\Movies & TV\_Newly DL'd\_To Process\Movie 2\Movie 2.mkv] to [Z:\Movies & TV\_Newly DL'd\_To Process\Movie 2\(2007) 720p HD BRRip non-HDR x265 DTS 5.1ch_ESiR.mkv]
[TEST] from [Z:\Movies & TV\_Newly DL'd\_To Process\Movie 2\Movie 2.en.srt] to [Z:\Movies & TV\_Newly DL'd\_To Process\Movie 2\(2007) 720p HD BRRip non-HDR x265 DTS 5.1ch_ESiR.en.eng.srt]
[TEST] from [Z:\Movies & TV\_Newly DL'd\_To Process\Movie 2\--db.url] to [Z:\Movies & TV\_Newly DL'd\_To Process\Movie 2\(2007) 720p HD BRRip non-HDR x265 DTS 5.1ch_db.url]
[TEST] from [Z:\Movies & TV\_Newly DL'd\_To Process\Movie 2\tmdb.url] to [Z:\Movies & TV\_Newly DL'd\_To Process\Movie 2\(2007) 720p HD BRRip non-HDR x265 DTS 5.1ch_NA.url]