You don't need to manually edit the filenames though, you just need to match the file with the episode/movie yourself:
https://www.youtube.com/watch?v=btNSv7AnMMw


Code: Select all
filebot -script fn:amc --output "F:/not sorted" --log-file amc.log --action test --conflict override -non-strict --def deleteAfterExtract=y subtitles=en unsorted=y excludeList=amc.txt "ut_dir=%3/%2" "ut_kind=multi" "ut_title=%2" "ut_label=%L"
Code: Select all
Parameter: deleteAfterExtract = y
Parameter: subtitles = en
Parameter: unsorted = y
Parameter: excludeList = amc.txt
Parameter: ut_dir = %3/%2
Parameter: ut_kind = multi
Parameter: ut_title = %2
Parameter: ut_label = %L
Using excludes: F:\not sorted\amc.txt (0)
No files selected for processing
Failure (┬░_┬░)
Divc09 wrote:Code: Select all
Parameter: ut_dir = %3/%2 Parameter: ut_kind = multi Parameter: ut_title = %2 Parameter: ut_label = %L
rednoah wrote:Troubleshooting
If something is not working, first read the Notes above, then just run the command manually in a new console window and see what happens. You CANNOT run the command without replacing the VARIABLES. The variables have to be replaced with actual values first.
It's always helpful to check the exact command utorrent ends up executing in the Logger tab. It'll look something like this:Code: Select all
[2013-03-05 20:44:24] Executing: filebot -script fn:amc --output "D:/Organized Media" --log-file amc.log --action duplicate --conflict override -non-strict --def "ut_dir=D:\Media\Avatar" "ut_file=" "ut_kind=multi" "ut_title=Avatar" "ut_label=" "ut_state=5"
Code: Select all
#!/bin/bash
filebot -script fn:amc --output "path to media" --log-file amc.log --action copy --conflict override -non-strict --def "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"lsCode: Select all
Run script [fn:amc] at [Fri Oct 28 19:09:36 EDT 2016]
Parameter: ut_dir = /
Parameter: ut_kind = multi
Parameter: ut_title = ls
Illegal usage: bad file arguments or ut_dir/ut_file parameters
Failure (°_°)This script must be called by Transmission (but it's not) because the TR_* environment variables must be set (but they aren't).rednoah wrote:Troubleshooting
If something is not working, first read the Notes above, then just run the command manually in a new console window and see what happens. You CANNOT run the command without replacing the VARIABLES. The variables have to be replaced with actual values first.
Is it maybe because it should now be --def kodi=127.0.0.1 instead? Or should it stay as xbmc?"C:\Program Files\FileBot\filebot.launcher.exe" -script fn:amc --output "F:" --def "seriesFormat=F:/TV/{n}/{'Season '+s}/{n} - {sxe} - {t}{'.'+lang}" "movieFormat=F:/Films/{n}" --log-file amc.log --action copy --conflict override -non-strict --def music=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" --def xbmc=127.0.0.1
Code: Select all
C:\Users\Russ>filebot -script fn:sysinfo
FileBot 4.7.2 (r4178)
JNA Native: 4.0.1
MediaInfo: 0.7.78
7-Zip-JBinding: 9.20
Chromaprint: 1.1.0
Extended Attributes: OK
Script Bundle: 2016-10-31 (r448)
Groovy: 2.4.7
JRE: Java(TM) SE Runtime Environment 1.8.0_91
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 8 Core / 1 GB Max Memory / 54 MB Used Memory
OS: Windows 7 (amd64)
Package: MSI
Data: C:\Users\Russ\AppData\Roaming\FileBot
Done ?(?????)?And hit enter, nothing happens or shows up. It just goes back to the command prompt."C:\Program Files\FileBot\filebot.launcher.exe" -script fn:amc --output "F:" --def "seriesFormat=F:/TV/{n}/{'Season '+s}/{n} - {sxe} - {t}{'.'+lang}" "movieFormat=F:/Films/{n}" --log-file amc.log --action copy --conflict override -non-strict --def music=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" --def xbmc=127.0.0.1
Code: Select all
C:\Users\Russ>"C:\Program Files\FileBot\filebot.exe" -script fn:amc --output "F:
" --def "seriesFormat=F:/TV/{n}/{'Season '+s}/{n} - {sxe} - {t}{'.'+lang}" "movi
eFormat=F:/Films/{n}" --log-file amc.log --action copy --conflict override -non-
strict --def music=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_
file=%F" "ut_dir=%D" --def xbmc=127.0.0.1
Locking C:\Users\Russ\AppData\Roaming\FileBot\logs\amc.log
Run script [fn:amc] at [Tue Nov 01 18:33:30 CET 2016]
Parameter: seriesFormat = F:/TV/{n}/{'Season '+s}/{n} - {sxe} - {t}{'.'+lang}
Parameter: movieFormat = F:/Films/{n}
Parameter: music = y
Parameter: ut_label = %L
Parameter: ut_state = %S
Parameter: ut_title = %N
Parameter: ut_kind = %K
Parameter: ut_file = %F
Parameter: ut_dir = %D
Parameter: xbmc = 127.0.0.1
Bad ut_label value: %L
Bad ut_state value: %S
Bad ut_title value: %N
Bad ut_kind value: %K
Bad ut_file value: %F
Bad ut_dir value: %D
Illegal usage: no input
Failure (┬░_┬░)READ THIS LINK.rednoah wrote:Read this while you're at it: viewtopic.php?f=4&t=4239
If you want to use command-line tools, then you at least need to learn how to use (as opposed to program) command-line tools. Please read Cmdline and Argument Passing.rednoah wrote:Accidentally escaping arguments (filebot -rename "C:\files\" --action test)
Code: Select all
Locking C:\Users\Russ\AppData\Roaming\FileBot\logs\amc.logCode: Select all
wget -O FileBot.zip https://app.filebot.net/download.php?type=portable
unzip FileBot.zip
./filebot.sh -versionCode: Select all
[~] # wget -O FileBot.zip https://app.filebot.net/download.php?type=portable
--2016-11-06 23:08:15-- https://app.filebot.net/download.php?type=portable
Resolving app.filebot.net (app.filebot.net)... 104.27.153.61, 104.27.152.61, 2400:cb00:2048:1::681b:993d, ...
Connecting to app.filebot.net (app.filebot.net)|104.27.153.61|:443... connected.
ERROR: cannot verify app.filebot.net's certificate, issued by ‘/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO ECC Domain Validation Secure Server CA 2’:
Unable to locally verify the issuer's authority.
To connect to app.filebot.net insecurely, use `--no-check-certificate'.
[~] # unzip FileBot.zipCode: Select all
To connect to app.filebot.net insecurely, use `--no-check-certificate'.@see viewtopic.php?f=3&t=2127rednoah wrote:only include episode data of recently aired episodes if there are any recently aired episodes, but otherwise default to accepting any episode data.Code: Select all
--filter "age < 7 || !model.any{ it.age < 7 }"
And here's what the .log file saysfilebot -script fn:amc --output "L:/SARJAT" --action duplicate --conflict skip -non-strict --log-file amc.log --def excludeList=amc.excludes unsorted=y music=y artwork=y "ut_dir=%F" "ut_kind=multi" "ut_title=%N" "ut_label=%L" --def movieFormat="J:/{ny}/{fn}"
There could be a mistake in the qbittorrent part, I rewrote it after AMC stopped working.Run script [fn:amc] at [Wed Nov 16 00:05:10 EET 2016]
Parameter: excludeList = amc.excludes
Parameter: unsorted = y
Parameter: music = y
Parameter: artwork = y
Parameter: ut_dir = %F
Parameter: ut_kind = multi
Parameter: ut_title = %N
Parameter: ut_label = %L
Parameter: movieFormat = J:/{ny}/{fn}
Bad ut_dir value: %F
Bad ut_title value: %N
Bad ut_label value: %L
Illegal usage: no input
Failure (°_°)
Please help me, after using the AMC for so long and it now being broken is driving me suicidal.filebot -script fn:amc --output "L:/SARJAT" --action duplicate --conflict skip -non-strict --log-file amc.log --def excludeList=amc.excludes unsorted=y music=y artwork=y "ut_dir=%F" "ut_kind=multi" "ut_title=%N" "ut_label=%L" --def movieFormat="J:/_Elokuvat/{n} ({y})/{fn}" --def seriesFormat="L:/SARJAT/{n}/{'Season '+s}/{fn}"
Code: Select all
{csv('list.csv').get(n) ?: n}Code: Select all
{csv('C:/Program Files/FileBot/list.csv').get(n) ?: n}Code: Select all
.*Code: Select all
t.replaceAll(/[`´‘’ʻ]/, /'/)Code: Select all
[\`´‘’ʻ]Groovy is your friend. CMD is not.rednoah wrote:Use the @file syntax for reading cmdline args from text files so you don't have to worry about quoting and escaping arguments
How is this question related to Exclude Blacklist & Series-Mappings?ffreese wrote:Hi,
for me there was one big reason to stay at v 4.2 with the old gui: I run filebot on a server and use x2go for access.
As newer filebot versions need glx > V1.3 they simply do stall, because x2go is stuck at V1.2...
Maybe we could have a modern version with oldstyle-gui for older pc or x2go-users?
Code: Select all
$ filebot -rename *.mp4 --db TheMovieDB -non-strict
Rename movies using [TheMovieDB]
Auto-detect movie from context: [avatar.mp4]
[MOVE] From [avatar.mp4] to [Avatar (2009).mp4]
Processed 1 files
Code: Select all
$ filebot -script fn:xattr *.mp4
/path/to/Avatar (2009).mp4
net.filebot.filename: avatar.mp4
net.filebot.metadata: {"@type":"Movie","year":2009,"imdbId":499549,"tmdbId":19995,"language":"en","id":19995,"name":"Avatar","aliasNames":[]}Code: Select all
$ filebot -mediainfo -r . --filter "y >= 2000" --format "{n} by {director}"
Avatar by James CameronCode: Select all
filebot -rename -r . --db xattr --action copy --output /Volumes/USB --filter "episode && age < 30" --format "{n} - {sxe} - {t}"Code: Select all
filebot -rename *.mp4 --action duplicate --db xattr -non-strict --format {resolution}/{fn}If I make it too easy, then the novice folks will accidentally delete all their extensions and then blame FileBot.stephen147 wrote:Could you add the ability to overwrite or keep file extension in the presets.
Why do your movie files have the wrong extension? I've never once come across a movie file with the wrong extension.stephen147 wrote:I overwrite my movies while keep extensions on TV programs.
Code: Select all
{n.replace(':','-').replaceAll(/[\/:*?"<>|]/,' - ')} ({y}) {any{fn.match(/(?i)25th.+?anniv/)}{''}.replaceAll(/(?i).*25th.+?anniv.*/, "(25th Anniv. Edition)")} {any{fn.match(/(?i)remastered/)}{''}.replaceAll(/(?i).*Remastered.*/, "(Remastered)")} {any{fn.match(/(?i)extended.+?edit/)}{''}.replaceAll(/(?i).*Extended.+?Edit.*/, "(Extended Edition)")} {any{fn.match(/IMAX.+?Edition/)}{''}.replaceAll(/(?i).*imax.+?edition.*/, "(IMAX Edition)")} {any{fn.match(/(?i)direct.+?cut/)}{''}.replaceAll(/(?i).*direct.+?cut.*/, "(Director's Cut)")} {any{fn.match(/(?i)unrated/)}{''}.replaceAll(/(?i).*unrated.*/, "(Unrated)")} {any{fn.match(/(?i)\(limited.*?\)/)}{''}.replaceAll(/(?i).*limited.*/, "(Limited Edition)")} {any{fn.match(/(?i)\(uncut.*?\)/)}{''}.replaceAll(/(?i).*uncut.*/, "(Uncut)")} {any{fn.match(/(?i)collector.+?s.+?edition/)}{''}.replaceAll(/(?i).*collector.+?s.+?edition.*/, "(Collector's Edition)")} {any{fn.match(/\([^\()+?[^\d]+?\)\s*/)} {""}{''}} {self.vf ? self.vf + "" : self.hpi} {"${self.source ?: 'WEB-DL'}"} {ac} {audio[0].channels.replaceAll(/^(\d{1}).*/,'$1')replaceAll(/2/, "2ch").replaceAll(/6/, "5.1ch").replaceAll(/8/, "7.1ch")} {vc}_{any{"$group"}{fn.match(/(?<=[_-])[^\s_-]+?$/)}{'NA'}.replaceAll(/[-_\[\]]\s*|\.\w{3}$/, "")}/{n.replace(':','-').replaceAll(/[\/:*?"<>|]/,' - ')} ({y}) {any{fn.match(/(?i)25th.+?anniv/)}{''}.replaceAll(/(?i).*25th.+?anniv.*/, "(25th Anniv. Edition)")} {any{fn.match(/(?i)remastered/)}{''}.replaceAll(/(?i).*Remastered.*/, "(Remastered)")} {any{fn.match(/(?i)extended.+?edit/)}{''}.replaceAll(/(?i).*Extended.+?Edit.*/, "(Extended Edition)")} {any{fn.match(/IMAX.+?Edition/)}{''}.replaceAll(/(?i).*imax.+?edition.*/, "(IMAX Edition)")} {any{fn.match(/(?i)direct.+?cut/)}{''}.replaceAll(/(?i).*direct.+?cut.*/, "(Director's Cut)")} {any{fn.match(/(?i)unrated/)}{''}.replaceAll(/(?i).*unrated.*/, "(Unrated)")} {any{fn.match(/(?i)\(limited.*?\)/)}{''}.replaceAll(/(?i).*limited.*/, "(Limited Edition)")} {any{fn.match(/(?i)\(uncut.*?\)/)}{''}.replaceAll(/(?i).*uncut.*/, "(Uncut)")} {any{fn.match(/(?i)collector.+?s.+?edition/)}{''}.replaceAll(/(?i).*collector.+?s.+?edition.*/, "(Collector's Edition)")} {any{fn.match(/\([^\()+?[^\d]+?\)\s*/)} {""}{''}} {self.vf ? self.vf + "" : self.hpi} {"${self.source ?: 'WEB-DL'}"} {ac} {audio[0].channels.replaceAll(/^(\d{1}).*/,'$1')replaceAll(/2/, "2ch").replaceAll(/6/, "5.1ch").replaceAll(/8/, "7.1ch")} {vc}_{any{"$group"}{fn.match(/(?<=[_-])[^\s_-]+?$/)}{'NA'}.replaceAll(/[-_\[\]]\s*|\.\w{3}$/, "")}{any{'.'+lang}{lang}}{any{fn.match(/(?i)sdh.+?/)}{''}.replaceAll(/(?i).*sdh.*/, "_SDH")}{any{fn.match(/(?i)\(foreignpartsonly\)/)}{''}}{"."+ext}How so? What's the problem?stephen147 wrote:It's the only way to rename subtitles and movies together
Code: Select all
filebot -script fn:amc --output "D:\Plex" --action move --conflict skip -non-strict --log-file amc.log --def "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" excludeList=amc.txt movieFormat="D:/Plex/Movies/{fn}" seriesFormat="D:/Plex/TV/{fn}"Code: Select all
filebot -script fn:amc --output "D:\Plex" --action move --conflict skip -non-strict "C:\Users\username\Downloads" --log-file amc.log --def excludeList=amc.txt movieFormat="D:/Plex/Movies/{fn}" seriesFormat="D:/Plex/TV/{fn}"Plex doesn't seem to mind unorganized files just sitting in their TV/Movie folder...at least, as far as I can tell!If you use Plex on your Plex folder, Plex will definitely not be happy with a flat folder of completely and utterly unorganized files.
Yes, using {fn} because I didn't see a need to rename the files.Are you sure you know what {fn} means?
Plex is very explicit about how files must be organized:Plex wrote:It's important that your media files and library folders are named and organized
You're either insanely lucky, or you just haven't seen much yet.kindofblue91 wrote:Yes, using {fn} because I didn't see a need to rename the files.

Code: Select all
filebot -rename *.mkv --output /mydir --format {n}/{episode.special ? "Specials" : "Season "+s.pad(2)}/'{n} - {episode.special ? "S00E"+special.pad(2) : s00e00} - {t}' --db TheTVDBCode: Select all
syntax error near unexpected token `('Code: Select all
FileBot 4.7.9 (r4984)
JNA Native: 5.1.0
MediaInfo: 0.7.73
7-Zip-JBinding: 9.20
Chromaprint: 1.4.2
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2017-04-03 (r494)
Groovy: 2.4.10
JRE: Java(TM) SE Runtime Environment 1.8.0_65
JVM: 32-bit Java HotSpot(TM) Client VM
CPU/MEM: 4 Core / 224 MB Max Memory / 12 MB Used Memory
OS: Linux (arm)
Package: DEB
Data: /---/---/.filebot
uname: Linux ---4.4.50-v7+ #970 SMP Mon Feb 20 19:18:29 GMT 2017 armv7l GNU/Linux
Please give me 1 or more example file names / paths I can test with.kim wrote: 18 Jun 2017, 00:23 FS
I use FS (FullScreen) just like WS is for WideScreen
it's mostly a movie thing
or it gets used like so search/movie?query=*****+****+fs
Code: Select all
\b(DVD|DVD5|DVD9|DVDRip)\bCode: Select all
cd "D:\Google Download Stuff\Series\"
get-childItem 'D:\Google Download Stuff\Series\*.mp4' | filebot -non-strict -rename '*' --db TheTVDB --conflict auto --filter "'s' - 'e'" --format 'D:/Google Download Stuff/Media/Series/{plex[1]} ({y})/Season {s}/{plex.name}' --output 'By Series' --mode interactive
cd "D:\Google Download Stuff\Movies\"
<This section>
get-childItem 'D:\Google Download Stuff\Movies\*.mp4'| filebot -non-strict -rename '*' --mode interactive --db TheMovieDB --conflict auto --format 'D:/Google Download Stuff/Media/Movies/{n0 = n.charAt(0); n0.isDigit() ? "0-9" : n0}/{plex[1]}/{plex.name}' --output 'By First Letter'
</This section>
pauseCode: Select all
D:\Google Download Stuff>PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& 'D:\Google Download Stuff\Scripts\Move.ps1'"
<Ignore this, Series folder is empty>
Illegal Argument: java.nio.file.InvalidPathException: Illegal char <*> at index 0: * (*)
Rename episodes using [TheTVDB]
No media files: [*]
Failure (°_°)
</Ignore this, Series folder is empty>
Rename movies using [TheMovieDB]
Auto-detect movie from context: [D:\Google Download Stuff\Movies\Red Dawn.mp4]
[MOVE] from [D:\Google Download Stuff\Movies\Red Dawn.mp4] to [D:\Google Download Stuff\Media\Movies\R\Red Dawn (1984)\R
ed Dawn (1984).mp4]
Processed 1 files
Press Enter to continue...:
Code: Select all
filebot -rename --db TheMovieDB *.mp4 --filter "y > 2000"Code: Select all
Rename movies using [TheMovieDB]
Auto-detect movie from context: [Red Dawn.mp4]
Apply filter [y > 2000] on [12] items
Include [Red Dawn (2012)]
Include [Red Dawn (2011)]
Include [Red (2008)]
Include [Red (2002)]
Include [RED (2010)]
Include [Rockin' at the Red Dog: The Dawn of Psychedelic Rock (2005)]
Include [Assembly (2007)]
[MOVE] from [Red Dawn.mp4] to [Red Dawn (2012).mp4]
Processed 1 files
Code: Select all
{
def sPath = "";
def mHDRCol = ["BT.709" : "NO", "BT.2020" : "YES"];
def mWebSrc = ["AMZN" : "AMZN", "NF" : "NF", "HBO" : "HBO"];
def hiResPath = "";
boolean isHDR = false;
if(self.video[0].bitdepth != null && self.bitdepth >= 10 && self.video[0].colourprimaries != null && mHDRCol.get(self.video[0].colourprimaries) == "YES") isHDR = true;
if(vf =~ /2160p/) hiResPath = '4k/' + video[0].Format.replace('AVC', 'x264').replace('HEVC', 'x265');
if(isHDR == true){ hiResPath += "(HDR)/" } else {hiResPath += "/"};
def VInfo = " - (FI " + vf + " ";
mWebSrc.any { k, v -> if(f.toString().contains(k)) VInfo += v + " "};
if(self.source =~ 'Remux') VInfo += fn.match(/BluRay/) else if(self.source != null) VInfo += self.source;
VInfo += " [" + video[0].Format.replace('AVC', 'x264').replace('HEVC', 'x265');
VInfo += " ";
if(isHDR == true) VInfo += " HDR " + self.bitdepth + "bit ";
if(isHDR == true && self.video[0].colourprimaries != null) VInfo += self.video[0].colourprimaries.replace(".","") + " ";
VInfo += "]";
sPath + hiResPath + plex + VInfo;
}
{def ADef = 0;
def ADefScore = 100;
def ACurrent = 100;
def ABest = 100;
def ABestIndex;
def ACnt = audio.size;
def iCnt = 0;
//map of scoring, Codec + FormatProfile with '+' and '/' stripped
def mAudioScore =[
"DTS-HDXMACore" : 10, "DTS-HDMACore" : 20, "DTS-HDMAES MatrixCore" : 20, "DTSES DiscreteCore" : 25, "DTS" : 30, "DTS-HDHRACore" : 25,
"TrueHDTrueHDAtmosTrueHD" : 10, "TrueHD" : 18,
"AC3" : 30, "AC3+" : 20, "AAC" : 50, "AAC LCLC" : 45, "AAC LC-SBRHE-AACLC" : 40,
"MPA1L3Layer 3" : 60, "MPA1L2Layer 2" : 70,
"Vorbis" : 65,
"PCM" : 90, "Qclp" : 90, "161" : 90];
//map of Codec + FormatProfile made nice for file name
def mAFP = [
"DTS-HDXMACore" : "DTS-HDMA(DTS-X)", "DTS-HDMACore" : "DTS-HDMA", "DTS" : "DTS", "DTS-HDMAES MatrixCore" : "DTS-HDMA", "DTSES DiscreteCore" : "DTS-ES", "DTS-HDHRACore" : "DTS-HDHRA",
"TrueHDTrueHDAtmosTrueHD" : "TrueHD(Atmos)", "TrueHD" : "TrueHD",
"AC3" : "AC3", "AC3+" : "DDP",
"AAC LCLC" : "AAC",
"MPA1L3Layer 3" : "MP3", "MPA1L2Layer 2" : "MP2",
"PCM" : "PCM", "Qclp" : "Qclp", "161" : "161"];
//map of Audio Channels(minus the slash) to pretty name
def mACH = [
"Object Based10" : "OB+10Ch",
"Object Based8" : "OB+8Ch", "Object Based86" : "OB+8Ch",
"Object Based6" : "OB+6Ch",
"Object Based" : "OBCh",
"9" : "9Ch",
"8" : "8Ch", "86" : "8Ch", "876" : "8Ch",
"7" : "7Ch", "76" : "7Ch",
"6" : "6Ch",
"5" : "5Ch",
"4" : "4Ch", "3" : "3Ch", "2" : "2Ch", "1" : "1Ch" ];
//Intermederia used to make finding missing strings from the maps
def CmACH = { if(mACH.get(it) != null) mACH.get(it) else " (mACH:" + it + " NOT FOUND)"};
def CmAFP = { if(mAFP.get(it) != null) mAFP.get(it) else " (mAFP:" + it + " NOT FOUND)"};
def CmAudioScore = { if(mAudioScore.get(it) != null) mAudioScore.get(it) else " (mAudioScore:" + it + " NOT FOUND)"};
//simple functions for creating audio text for file name
def GetFPSafe = {if(self.audio[it].FormatProfile != null) audio[it].FormatProfile.slash('').replace("+","") else ""};
//def GetAText = {mAFP.get( audio[it].codec + GetFPSafe(it)) + " " + mACH.get( audio[it].channels.slash('') ) };
def GetAText = {CmAFP( audio[it].codec + GetFPSafe(it)) + " " + CmACH( audio[it].channels.slash('') ) };
//Get index # that the default audio is using (only expecting 1 default audio)
audio.eachWithIndex{ a, idx -> if(call{a.default} == "Yes") ADef = idx};
//Get score for default audio
ADefScore = CmAudioScore(self.audio[ADef].codec + GetFPSafe(ADef))
//ADefScore = 50; //for your testing
//Check all audio streams, rank them against one another, get best score
for (iCnt = 0; iCnt < ACnt; iCnt++){
ACurrent = CmAudioScore(self.audio[iCnt].codec + GetFPSafe(iCnt))
if(ACurrent != null && ACurrent.toInteger() < ABest) ABestIndex = iCnt;
if(ACurrent != null && ACurrent.toInteger() < ABest) ABest = ACurrent.toInteger();
};
//end
if(ADefScore.toInteger() == ABest) GetAText(ABestIndex) + ")" else GetAText(ADef) + " [BA " + GetAText(ABestIndex) + "]" + ")";
}
Code: Select all
{
def mHDRCol = ["BT.709" : "NO", "BT.2020" : "YES"];
if(bitdepth >= 10 && mHDRCol.get(self.video[0].colourprimaries) == "YES" ) '(HDR)/' else '(NonHDR)/';
}
and extraDTS-HDMA (mACH:86 NOT FOUND))
here is my audio format:+ ")"
Code: Select all
{
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} =~ '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}{audio.Codec.join().match(/TrueHD/)}{audio.Codec.join().match(/DTS/)+codecSubVersion.replaceAll(/null/)}{ac};
(allOf{'.'+codecVersion.replaceAll(/null/)}
{if( ((ac == 'AAC'||ac == 'MP3') && (channels != '2.0' || ChannelString != channels) ) || ( (ac == 'AC3'||ac == 'DTS'||ac == 'TrueHD') && (channels != '5.1' || ChannelString != channels) ) ) return {any{ChannelString}{channels}}}
{aco.match(/Atmos/)}).join('.')
}Code: Select all
//map of scoring, Codec + FormatProfile with + and / stripped
def mAudioScore =[ "DTS-HDXMACore" : 10, "DTS-HDMACore" : 20, "DTS" : 30, "TrueHDTrueHDAtmosTrueHD" : 10, "TrueHD" : 18, "AC3" : 40, "AAC" : 50, "AAC LCLC" : 50, "MPA1L3Layer 3" : 60,"MPA1L2Layer 2" : 70];
//map of Codec + FormatProfile made nice for file name
def mAFP = [ "DTS-HDXMACore" : "DTS-HDMA(DTS-X)", "DTS-HDMACore" : "DTS-HDMA", "DTS" : "DTS", "TrueHDTrueHDAtmosTrueHD" : "TrueHD(Atmos)", "TrueHD" : "TrueHD", "AC3" : "AC3", "AAC LCLC" : "AAC", "MPA1L3Layer 3" : "MP3", "MPA1L2Layer 2" : "MP2" ];
//map of Audio Channels(minus the slash) to pretty name
def mACH = [ "Object Based10" : "OB+10Ch", "Object Based8" : "OB+8Ch", "Object Based86" : "OB+8Ch", "Object Based6" : "OB+6Ch", "Object Based" : "OBCh", "9" : "9Ch", "8" : "8Ch", "86" : "8Ch", "7" : "7Ch", "6" : "6Ch", "5" : "5Ch", "4" : "4Ch", "3" : "3Ch", "2" : "2Ch", "1" : "1Ch" ];
Code: Select all
if(self.video[0].bitdepth != null && self.bitdepth == 10 && self.video[0].colourprimaries != null && mHDRCol.get(self.video[0].colourprimaries) == "YES") isHDR = "YES";
Yours works well with my Atmos and everything else but it does not identify the other object based format, DTS-X.
Code: Select all
{
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}{audio.Codec.join().match(/TrueHD/)}{audio.Codec.join().match(/DTS/)+codecSubVersion.replaceAll(/null/)}{ac};
(allOf{'.'+codecVersion.replaceAll(/null/)}
{if( ((ac == 'AAC'||ac == 'MP3') && (channels != '2.0' || ChannelString != channels) ) || ( (ac == 'AC3'||ac == 'DTS'||ac == 'TrueHD') && (channels != '5.1' || ChannelString != channels) ) ) return {any{ChannelString}{channels}}}
{aco.match(/Atmos/)}).join('.')
}Code: Select all
{
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};
(allOf{'.'+codecVersion.replaceAll(/null/)}
{if( ((ac == 'AAC'||ac == 'MP3') && (channels != '2.0' || ChannelString != channels) ) || ( (ac == 'AC3'||ac == 'DTS'||ac == 'TrueHD') && (channels != '5.1' || ChannelString != channels) ) ) return {any{ChannelString}{channels}}}
{aco.match(/Atmos/)}).join('.')
}I only have a couple movies and they were both .DTS-X. so I assume thats what it is. I tried to google it but all I could find was stuff about WEBRip and that sort as far as naming goes.
it still use this to lookup movieDTS-MA.5.1
also what about 1, 4 and 8ch + DTS-ES, DTS-HD-HRA and DTS-X + without separator e.g. DTSHD ?+5+1
if so change to something like this:[12457][.]?[01]
to [12457]\.[01]
this is how filebot see it, yes (with the \b) ?\b(FLAC|AAC|AC3|MP3|MP4|DTS|DD|TrueHD|Atmos)(.?HD)?(.?ES|.?MA|.?X|.?HRA)?(.?[12457]\.[01])?\b|\b[12468]ch\b
[M0]?(720|1080)[pi]
test on:\b(FLAC|AAC|AC3|MP3|MP4|DTS|DD[P+]?|TrueHD|Atmos)(.?HD)?(.?ES|.?MA|.?X|.?HRA)?(.?[124567][.]?[01])?\b|\b[124678]ch\b|\b[2|3]?Audio\b|\bDualAudio\b
NEW:some.movie.2000.DTS.MA.5.1
some.movie.2000.DTS.MA.7.1
some.movie.2000.DTS.MA.6ch
some.movie.2000.DTS-HD.MA.5.1
some.movie.2000.DTS-HD.MA.7.1
some.movie.2000.DTS-HD.MA.6ch
some.movie.2000.DTS-HD.MA.8ch
some.movie.2000.DTSHDMA.5.1
some.movie.2000.DTSHDMA.7.1
some.movie.2000.DTS-X.5.1
some.movie.2000.DTS-X.7.1
some.movie.2000.DTS-X.6ch
some.movie.2000.DTS-X.8ch
some.movie.2000.DTS-HD-HRA.7.1
some.movie.2000.DTS-ES.6.1
some.movie.2000.DTS.1.0
some.movie.2000.DTS.2.0
some.movie.2000.DTS.5.1
some.movie.2000.DTS.6.1
some.movie.2000.DTS.7.1
some.movie.2000.DTS.1ch
some.movie.2000.DTS.2ch
some.movie.2000.DTS.6ch
some.movie.2000.DTS.7ch
some.movie.2000.DTS.8ch
some.movie.2000.DTS
some.movie.2000.DTSMA.2Audio
some.movie.2000.DTS.Audio
some.movie.2000.Dtshd Audio
some.movie.2000.Dts Dualaudio
some.movie.2000.DTSES6.1.3Audio
some.movie.2000.AC3.2Audio
some.movie.2000.FLAC.DD51.DualAudio
some.movie.2000.TrueHD.5.1
some.movie.2000.TrueHD.7.1
some.movie.2000.TrueHD.Atmos.5.1
some.movie.2000.TrueHD.Atmos.7.1
some.movie.2000.DTS-HD.TrueHD.7.1.Atmos
some.movie.2000.AC3.1.0
some.movie.2000.AC3.2.0
some.movie.2000.AC3.4.0
some.movie.2000.AC3.5.1
some.movie.2000.AC3.1ch
some.movie.2000.AC3.2ch
some.movie.2000.AC3.4ch
some.movie.2000.AC3.6ch
some.movie.2000.DD.1.0
some.movie.2000.DD.2.0
some.movie.2000.DD.4.0
some.movie.2000.DD.5.1
some.movie.2000.DDP.1.0
some.movie.2000.DDP.2.0
some.movie.2000.DDP.4.0
some.movie.2000.DDP.5.1
some.movie.2000.DD+.1.0
some.movie.2000.DD+.2.0
some.movie.2000.DD+.4.0
some.movie.2000.DD+.5.1
some.movie.2000.DDP1.0
some.movie.2000.DDP2.0
some.movie.2000.DDP4.0
some.movie.2000.DDP5.1
some.movie.2000.DD.5.1
some.movie.2000.DD.7.1
some.movie.2000.MP3.1.0
some.movie.2000.AAC.5.1