Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {ny.colon(' - ').replace('?', '!')}/
- {
- def space = call{' '};
- //def dir_root = 'I/Movies/'+
- call{hd.matches(/(?i)SD/) ? '480p-720p/' : ' '}+
- call{hd.matches(/(?i)HD/) ? '720p-1080p/' : ' '}+
- call{hd.matches(/(?i)UHD/) ? '4k/' : ' '};
- // Main Title e.g.
- // 1408 (2007) (Director's Cut) 1080p HD Blu-ray non-HDR x264 DTS5.1ch_SiNNERS
- // 300 (2007) 720p HD BRRip non-HDR x265 DTS 5.1ch_ESiR
- // Deadpool (2016) 2160p UHD WEB-DL non-HDR AVC DTS-HD MA 7.1ch_DDR
- // Deadpool 2 (2018) (Super Duper Cut) 2160p UHD Blu-ray REMUX HDR10bit ATEME TrueHD Atmos 13Obj 7.1ch_EPSiLON
- def main_title = call{ny.colon(' - ').replace('?', '!')}+
- 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{hd}+
- space + '['+ call{source.matches(/(?i)blu.*ray/) ? 'BluRay -' : {source} ?: 'WEB-DL -'} +
- space + call{fn.matches(/(?i).+\bremux\b.+/) ? 'REMUX -' : ' '} +
- space + call{fn.matches(/(?i).+\bwebrip\b.+/) ? 'WEBRip -' : ' '} +
- call{self.vf ? self.vf : self.hpi} + ']' +
- //Sets the x265/x264 and the bit
- space + '[' +
- //call{vc.matches(/x264/) ? 'x264' : ''} +
- //space + call{vc.matches(/x265/) ? 'x265' : ''} +
- call{vc.matches(/(?i)hevc/) ? 'x265' : ''} +
- space + call{any{vc.match(/x26[45]|hevc/)}{vc}} +
- call{if (bitdepth == 10) '-10bit' else ''} +
- ']'
- space + '[' +
- // Call audio
- // Thread here where I got the base code: https://www.filebot.net/forums/viewtopic.php?f=5&t=5285
- call {
- def mCFP =
- [
- 'AAC LC SBR PS' : 'AAC',
- 'AAC LC SBR' : 'AAC',
- 'AAC LC' : 'AAC',
- 'AC 3 Dep' : 'E-AC3',
- 'AC 3' : 'AC3',
- 'DTS 96 24' : 'DTS 96-24',
- 'DTS ES XBR' : 'DTS-HD HRA',
- 'DTS ES XLL' : 'DTS-HD MA',
- 'DTS ES XXCH XBR' : 'DTS-HD HRA',
- 'DTS ES XXCH XLL' : 'DTS-HD MA',
- 'DTS ES XXCH' : 'DTS-ES',
- 'DTS ES' : 'DTS-ES',
- 'DTS XBR' : 'DTS-HD HRA',
- 'DTS XLL X' : 'DTS X',
- 'DTS XLL' : 'DTS-HD MA',
- 'DTS' : 'DTS',
- 'E AC 3 JOC' : 'EAC3 Atmos',
- 'E AC 3' : 'EAC3',
- 'MLP FBA 16 ch' : 'TrueHD Atmos',
- 'MLP FBA' : 'TrueHD',
- 'MP3' : 'MP3',
- 'MPEG Audio' : 'MP2',
- 'PCM' : 'PCM'
- ];
- def audioClean = {
- it.replaceAll(/[\p{Pd}\p{Space}]/, ' ').replaceAll(/\p{Space}{2,}/, ' ').slash(' ')
- };
- def channelClean = {
- it.replaceAll(/Debug.+|Object\sBased\s?\/?|(\d+)?\sobjects\s\/\s|0.(?=\d.\d)|20/).replaceAll(/6/,'5.1').replaceAll(/8/,'7.1')
- };
- def audioCollection = audio.collect;
- { au ->
- def channels = any{ channelClean(au['ChannelPositionsString2'])}{ channelClean(au['ChannelsOriginal'])}{ channelClean(au['Channels']) };
- def ch = channels.tokenize('\\/').take(3)*.toDouble().inject(0, { a, b -> a + b }).findAll { it > 0 }.max().toString() + 'ch';
- def codec = audioClean(any{ au['CodecID/Hint'] }{ au['Format'] });
- def format_profile = { ( au['Format_AdditionalFeatures'] != null) ? audioClean(au['Format_AdditionalFeatures']) : '' };
- def combined = allOf{codec}{format_profile}.join(' ');
- def stream = allOf { mCFP.get(combined, 'UNKNOWN_FORMAT--'+combined+'--') } { dynChannel } { ch };
- };
- return audioCollection[0].join( ' ' )
- } +
- // Group -- do not want to display group
- //call{any{"$group"}{fn.match(/(?<=[_-])[^\s_-]+?$/)}{''}.replaceAll(/[-_\[\]]\s*|\.\w{3}$/, '')};
- // Language
- call{''};
- def lang = allOf
- {'.'+lang}
- {fn ==~ /(?i).+sdh.+/ ? '_SDH' : null}
- {fn.match(/(?i)\(foreignpartsonly\)/)}
- .join()
- // Extension
- def ext = call{'.'+ext};
- // Call all the bindings to create the result
- (
- call(main_title).replace(':', ';') + call(lang)
- ).replaceAll(/null/,'')
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement