I have followed your recommendation and started testing my arguments via separated files and although I am getting results, they're aren't fully positives and wouldn't mind some advices from experts.
Just a note to say that I am fully aware, as a complete novice, that I probably make extremely basic mistakes and asking extremely basic questions, so my deepest apologies to the experts and that you for sharing...
For now I am only testing so the output is the input one and I call my script with:
Code: Select all
filebot -script fn:amc /share/Download --def movieFormat=/Volumes/home/MyScripts/movieFormat.groovy
The actual script is:
Code: Select all
{any{def map=['louisdefunes':'[Actors]/Louis_de_Funes','charleschaplin':'[Actors]/Charles Chaplin','jeanpaulbelmondo':'[Actors]/Jean-Paul Belmondo']; actors.join(', ').lower().replaceAll(/[\W]/, "").matchAll(/louisdefunes|charleschaplin|jeanpaulbelmondo/).findResults{ map[it] }.join(',')+'/'}{def map=[/rifftrax/:'RiffTrax','miniseries':'Mini-Series','monstervision':'MonsterVision','fanedit':'FanEdits','usaupallnight':'USA Up All Night',/elvirasmoviemacabre/:'Elvira\'s Movie Macabre']; '['+file.path.lower().replaceAll(/[\W]/, "").matchAll(/monstervision|rifftrax|fanedit|usaupallnight|elvirasmoviemacabre/).findResults{ map[it].replaceAll("\\[|\\]", "") }.sort{ map.values().indexOf(it)}.join(',')+']/'}{(info.SpokenLanguages.displayLanguage.contains(/English/)) ? '' : '[Foreign Films]/'}{(info.SpokenLanguages.displayLanguage.contains(/French/)) ? '' : '[Foreign Films]/'}{(info.SpokenLanguages.displayLanguage.contains(/Spanish/)) ? '' : '[Foreign Films]/'}}{any{if (genres.join(', ').matchAll(/animation/))('Animes/')}{genre}{'[No Genre]'}}/{norm = {it.upperInitial().lowerTrail().replaceTrailingBrackets().replaceAll(/[`´‘’ʻ""“”]/, "'").replaceAll(/[:|]/, " - ").replaceAll(/[?]/, "!").replaceAll(/[*\s]+/, " ").replaceAll(/\b[IiVvXx]+\b/, { it.upper() }).replaceAll(/\b[0-9](?i:th| nd|rd)\b/, { it.lower() }).replaceFirst(/^(?i)(The)\s(.+)/, /$2, $1/)}; norm(n)}{if (norm(n) != norm(primaryTitle)) ' ('+norm(primaryTitle)+')'}{" (Part ${pi.pad(2)})"}{" ["+file.path.lower().replace(/dc/, 'director\'s cut').replaceAll('limited','limited release').replaceAll('directors','director\'s').replaceAll('-','').replaceAll(/director.s|theatrical/,'$0 Cut').matchAll(/(uncensored|uncut|unrated|remastered|ultimate|extended|director?s|theatrical|ultimate|final|bootleg|special|fan?edit?|limited|rifftrax|monstervision|youtube|hulu|netflix|vimeo|edited|edit|censored+)(?:.edition|.cut|.version|.edit|.release|.extended|.rip)?/)*.upperInitial()*.lowerTrail().sort().join('] [')+']'}{def map=['3d':'3D','hsbs':'Half-SBS','halfsbs':'Half-SBS','fsbs':'Full-SBS','fullsbs':'Full-SBS','sbs':'SBS','halfou':'Half-OU','fullou':'Full-OU','overunder':'OU','anaglyth':'Anaglyth']; " ("+ ((file.path.lower().contains(/3d/)) ? '' : '3D ')+ file.path.lower().replaceAll(/(?i)(?<=^|[^a-z])hou(?=$|[^a-z])/,'halfou').replaceAll(/(?i)(?<=^|[^a-z])fou(?=$|[^a-z])/,'fullou').replaceAll(/(?i)(?<=^|[^a-z])ou(?=$|[^a-z])/,'overunder').replaceAll(/[\W]/, "").matchAll(/3d(?!.*?3d)|hsbs(?!.*?hsbs)|halfsbs(?!.*?halfsbs)|fsbs(?!.*?fsbs)|fullsbs(?!.*?fullsbs)|sbs(?!.*?sbs)|halfou(?!.*?halfou)|fullou(?!.*?fullou)|overunder(?!.*?overunder)|anaglyth(?!.*?anaglyth)/).findResults{ map[it]}.sort().join(' ')+')'}
The result I get which is hard to decrypt for me I have to admit; the result in the folder and from the actual files supposed to be treated is basically null:
Code: Select all
[~] # filebot -script fn:amc /share/Download --def movieFormat=/Volumes/home/MyScripts/movieFormat.groovy
Run script [fn:amc] at [Sun Apr 24 20:49:49 GMT 2016]
Parameter: movieFormat = /Volumes/home/MyScripts/movieFormat.groovy
Argument: /share/CACHEDEV1_DATA/Download
Ignore hidden folder: /share/CACHEDEV1_DATA/Download/@Recycle
Ignore hidden folder: /share/CACHEDEV1_DATA/Download/.@__thumb
Ignore hidden folder: /share/CACHEDEV1_DATA/Download/.AppleDB
Ignore hidden folder: /share/CACHEDEV1_DATA/Download/.gobbler
Input: /share/CACHEDEV1_DATA/Download/45 years.mp4
Input: /share/CACHEDEV1_DATA/Download/@/Volumes/home/MyScripts/movieFormat.groovy.idx
Input: /share/CACHEDEV1_DATA/Download/@/Volumes/home/MyScripts/movieFormat.groovy.smi
Input: /share/CACHEDEV1_DATA/Download/@/Volumes/home/MyScripts/movieFormat.groovy.srt
Input: /share/CACHEDEV1_DATA/Download/@/Volumes/home/MyScripts/movieFormat.groovy.sub
Input: /share/CACHEDEV1_DATA/Download/Ah! Les belles bachantes....avi
Input: /share/CACHEDEV1_DATA/Download/Cars.avi
Input: /share/CACHEDEV1_DATA/Download/City Lights (1931, Charles Chaplin) 480p 2ch.avi
Input: /share/CACHEDEV1_DATA/Download/Flic ou voyou.avi
Input: /share/CACHEDEV1_DATA/Download/a girl like her.avi
Input: /share/CACHEDEV1_DATA/Download/a walk in the wood.mkv
Exclude: /share/CACHEDEV1_DATA/Download/messages
45 years.mp4 [series: null, movie: Trumbo (2015)]
movieFormat.groovy.idx [series: null, movie: Trumbo (2015)]
movieFormat.groovy.smi [series: null, movie: Ride Along (2014)]
movieFormat.groovy.srt [series: null, movie: Trumbo (2015)]
movieFormat.groovy.sub [series: null, movie: Trumbo (2015)]
Ah! Les belles bachantes....avi [series: null, movie: null]
Unable to differentiate: [Ah! Les belles bachantes....avi] => [null] VS [null]
Cars.avi [series: null, movie: Cars (2006)]
Apr 24, 2016 8:49:56 PM net.filebot.web.TMDbClient searchMovie
WARNING: Ignore movie metadata: City Lights [272781]: Missing data: release date
City Lights (1931, Charles Chaplin) 480p 2ch.avi [series: City Lights, movie: City Lights (1931)]
Apr 24, 2016 8:49:56 PM net.filebot.web.TMDbClient searchMovie
WARNING: Ignore movie metadata: City Lights [272781]: Missing data: release date
Exclude Series: City Lights
Flic ou voyou.avi [series: null, movie: Cop or Hood (1979)]
a girl like her.avi [series: null, movie: Thomas & Friends: Sodor's Legend of the Lost Treasure (2015)]
a walk in the wood.mkv [series: null, movie: The Little Prince (2015)]
Group: [tvs:null, mov:trumbo 2015] => [45 years.mp4, movieFormat.groovy.idx, movieFormat.groovy.srt, movieFormat.groovy.sub]
Group: [tvs:null, mov:ride along 2014] => [movieFormat.groovy.smi]
Group: [:] => [Ah! Les belles bachantes....avi]
Group: [tvs:null, mov:cars 2006] => [Cars.avi]
Group: [tvs:null, mov:city lights 1931] => [City Lights (1931, Charles Chaplin) 480p 2ch.avi]
Group: [tvs:null, mov:cop or hood 1979] => [Flic ou voyou.avi]
Group: [tvs:null, mov:thomas friends sodors legend of the lost treasure 2015] => [a girl like her.avi]
Group: [tvs:null, mov:the little prince 2015] => [a walk in the wood.mkv]
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/share/CACHEDEV1_DATA/Download/45 years.mp4]
CmdlineException: [null/45 years.mp4] Multiple options: Force auto-select requires non-strict matching: [45 Years (2015), Trumbo (2015)]
Auto-detect movie from context: [/share/CACHEDEV1_DATA/Download/@/Volumes/home/MyScripts/movieFormat.groovy.idx]
Auto-detect movie from context: [/share/CACHEDEV1_DATA/Download/@/Volumes/home/MyScripts/movieFormat.groovy.srt]
Auto-detect movie from context: [/share/CACHEDEV1_DATA/Download/@/Volumes/home/MyScripts/movieFormat.groovy.sub]
[MOVE] Rename [/share/CACHEDEV1_DATA/Download/@/Volumes/home/MyScripts/movieFormat.groovy.sub] to [/Volumes/home/MyScripts/movieFormat.groovy.sub]
[MOVE] Failed to rename [/share/CACHEDEV1_DATA/Download/@/Volumes/home/MyScripts/movieFormat.groovy.sub]
FileSystemException: /share/CACHEDEV1_DATA/Download/@/Volumes/home/MyScripts/movieFormat.groovy.sub -> /Volumes/home/MyScripts/movieFormat.groovy.sub: No space left on device
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/share/CACHEDEV1_DATA/Download/@/Volumes/home/MyScripts/movieFormat.groovy.smi]
[MOVE] Rename [/share/CACHEDEV1_DATA/Download/@/Volumes/home/MyScripts/movieFormat.groovy.smi] to [/Volumes/home/MyScripts/movieFormat.groovy.smi]
Processed 1 files
Apr 24, 2016 8:49:58 PM net.filebot.media.MediaDetection storeMetaInfo
WARNING: Failed to set xattr: java.lang.RuntimeException: java.nio.file.FileSystemException: /Volumes/home/MyScripts/movieFormat.groovy.smi: Error writing extended attribute 'net.filebot.metadata': Operation not supported
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/share/CACHEDEV1_DATA/Download/Cars.avi]
CmdlineException: [null/Cars.avi] Multiple options: Force auto-select requires non-strict matching: [Cars (2006), Cars 2 (2011), Cars 3 (2017), Hot Cars (1956), Used Cars (1980), Stone Cars (2014), Killing Cars (1986), Stealing Cars (2015), Bikes vs Cars (2015), Ford Muscle Cars (2005), Calling All Cars (1935), The Cars: Unlocked (2006), Two Cars, One Night (2003), Top Gear: Soul Cars (2011), Great Performance Cars (2010), Women Cars Villas Money (1972), Riding in Cars with Boys (2001), Porsche: The Legendary Cars (2006), Babas bilar (2006)]
CmdlineException: Unable to identify or process any files
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/share/CACHEDEV1_DATA/Download/City Lights (1931, Charles Chaplin) 480p 2ch.avi]
Apr 24, 2016 8:49:59 PM net.filebot.web.TMDbClient searchMovie
WARNING: Ignore movie metadata: City Lights [272781]: Missing data: release date
[MOVE] Rename [/share/CACHEDEV1_DATA/Download/City Lights (1931, Charles Chaplin) 480p 2ch.avi] to [/Volumes/home/MyScripts/movieFormat.groovy.avi]
[MOVE] Failed to rename [/share/CACHEDEV1_DATA/Download/City Lights (1931, Charles Chaplin) 480p 2ch.avi]
FileSystemException: /share/CACHEDEV1_DATA/Download/City Lights (1931, Charles Chaplin) 480p 2ch.avi -> /Volumes/home/MyScripts/movieFormat.groovy.avi: No space left on device
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/share/CACHEDEV1_DATA/Download/Flic ou voyou.avi]
[MOVE] Rename [/share/CACHEDEV1_DATA/Download/Flic ou voyou.avi] to [/Volumes/home/MyScripts/movieFormat.groovy.avi]
[MOVE] Failed to rename [/share/CACHEDEV1_DATA/Download/Flic ou voyou.avi]
FileSystemException: /share/CACHEDEV1_DATA/Download/Flic ou voyou.avi -> /Volumes/home/MyScripts/movieFormat.groovy.avi: No space left on device
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/share/CACHEDEV1_DATA/Download/a girl like her.avi]
CmdlineException: [null/a girl like her.avi] Multiple options: Force auto-select requires non-strict matching: [A Girl Like Her (2015), A Girl Like Her (2012), Thomas & Friends: Sodor's Legend of the Lost Treasure (2015)]
CmdlineException: Unable to identify or process any files
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/share/CACHEDEV1_DATA/Download/a walk in the wood.mkv]
CmdlineException: [null/a walk in the wood.mkv] Multiple options: Force auto-select requires non-strict matching: [A Walk in the Woods (2015), A Secret Walk in the Woods (1985), The Walk (2015), The Little Prince (2015)]
CmdlineException: Unable to identify or process any files
Done ヾ(@⌒ー⌒@)ノ
I can see various warnings like "Missing data: release date, Unable to differentiate:, => [null] VS [null], Failed to set xattr: java.lang.RuntimeException: etc..." but it isn't clear to me as to what it really means...Anything obvious at all?