Page 1 of 1

Trouble with complex custom movie format

Posted: 17 Jan 2017, 06:30
by DHoarder
I'm using movie/episode naming scheme as in log below successfully for quite some time. Recently though, filebot is sending movies to the incorrect folder.

Code: Select all

Run script [fn:amc] at [Wed Jan 11 08:56:14 IST 2017]
Parameter: pushbullet = *****
Parameter: subtitles = en
Parameter: clean = y
Parameter: movieFormat = //mnt/MyMedia/{info.genres.contains('Documentary') ? 'Documentaries': info.SpokenLanguages =~ /hi/  ? 'Hindi' : 'Movies'}/{Collection.replaceAll(/Saga Collection/, Saga).replaceAll(/[`\�\�\�\?""\�\�]/, "'").replaceAll(/[:|]/, " - ").replaceAll(/[?]/, "!").replaceAll(/[*\s]+/, " ")}\{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).equals(norm(primaryTitle))) ' ('+norm(primaryTitle)+')'}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""} ({y})/{norm(n)}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}{'.' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition|mind.bending.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, " ")}{" Part $pi"}{".$y"}{".$vf"}{".$vc"}{".$source"}{".$group"}
Parameter: seriesFormat = //mnt/MyMedia/{info.genres.contains('Documentary') ? 'Documentaries': 'TV Shows'}/{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)}{(!norm(n).equals(norm(primaryTitle))) ' ('+norm(primaryTitle)+')'}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""} ({y})/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{norm(n)} {episode.special ? 'S00E'+special.pad(2) : s00e00} {norm(t)}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}{'.' + fn.matchAll(/extended|uncensored|remastered|unrated|special[ ._-]edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[.]/, " ")}{".$y"}{".$vf"}{".$vc"}{".$source"}{".$group"}
Argument[0]: /mnt/data/torrents/Sultan.2016.Hindi.720p.BluRay.x264.ShAaNiG.mkv
Input: /mnt/data/torrents/Sultan.2016.Hindi.720p.BluRay.x264.ShAaNiG.mkv
Group: [mov:sultan 2016] => [Sultan.2016.Hindi.720p.BluRay.x264.ShAaNiG.mkv]
Get [English] subtitles for 1 files
Looking up subtitles by hash via OpenSubtitles
No matching subtitles found: /mnt/data/torrents/Sultan.2016.Hindi.720p.BluRay.x264.ShAaNiG.mkv
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/mnt/data/torrents/Sultan.2016.Hindi.720p.BluRay.x264.ShAaNiG.mkv]
Fetch failed: java.net.SocketTimeoutException: connect timed out [https://api.themoviedb.org/3/movie/376812?language=en&api_key=66308fb6e3fd850dde4c7d21df2e8306]
Failed to retrieve localized movie data
java.net.SocketTimeoutException: connect timed out
	at net.filebot.web.WebRequest.fetch(WebRequest.java:143)
	at net.filebot.CachedResource.lambda$fetchIfNoneMatch$12(CachedResource.java:218)
	at net.filebot.CachedResource.lambda$withPermit$15(CachedResource.java:247)
	at net.filebot.CachedResource.lambda$null$0(CachedResource.java:83)
	at net.filebot.CachedResource.retry(CachedResource.java:112)
	at net.filebot.CachedResource.lambda$get$1(CachedResource.java:83)
	at net.filebot.Cache.computeIf(Cache.java:85)
	at net.filebot.CachedResource.get(CachedResource.java:78)
	at net.filebot.web.TMDbClient.request(TMDbClient.java:358)
	at net.filebot.web.TMDbClient.getMovieInfo(TMDbClient.java:174)
	at net.filebot.web.TMDbClient.getMovieInfo(TMDbClient.java:163)
	at net.filebot.web.TMDbClient.getMovieDescriptor(TMDbClient.java:147)
	at net.filebot.media.MediaDetection.getLocalizedMovie(MediaDetection.java:704)
	at net.filebot.cli.CmdlineOperations.renameMovie(CmdlineOperations.java:444)
	at net.filebot.cli.CmdlineOperations.rename(CmdlineOperations.java:105)
	at net.filebot.cli.ScriptShellBaseClass.rename(ScriptShellBaseClass.java:329)
	at Script1$_run_closure55.doCall(Script1.groovy:439)
	at Script1.run(Script1.groovy:403)
	at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:62)
	at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:72)
	at net.filebot.cli.ArgumentProcessor.runScript(ArgumentProcessor.java:113)
	at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:28)
	at net.filebot.Main.main(Main.java:124)
Caused by: java.net.SocketTimeoutException: connect timed out
	at net.filebot.web.WebRequest.fetch(WebRequest.java:140)
	... 22 more
Fetch failed: java.net.SocketTimeoutException: connect timed out [https://api.themoviedb.org/3/movie/376812?append_to_response=alternative_titles%2Creleases%2Ccasts%2Ctrailers&language=en&api_key=66308fb6e3fd850dde4c7d21df2e8306]
Fetch failed: java.net.SocketTimeoutException: connect timed out [https://api.themoviedb.org/3/movie/376812?language=en&api_key=66308fb6e3fd850dde4c7d21df2e8306]
Stripping invalid characters from new path: //mnt/MyMedia//\Sultan (2016)/Sultan.2016.720p.x264.BluRay.ShAaNiG
[COPY] Rename [/mnt/data/torrents/Sultan.2016.Hindi.720p.BluRay.x264.ShAaNiG.mkv] to [/mnt/MyMedia/Sultan (2016)/Sultan.2016.720p.x264.BluRay.ShAaNiG.mkv]
Processed 1 files
Sending PushBullet report
Done ヾ(@⌒ー⌒@)ノ
"Sultan: being a Hindi Movie should've moved to "mnt/MyMedia/Hindi", instead it copied to "mnt/MyMedia/".

Code: Select all

Run script [fn:amc] at [Fri Jan 13 00:15:56 IST 2017]
Parameter: pushbullet = *****
Parameter: subtitles = en
Parameter: clean = y
Parameter: movieFormat = //mnt/MyMedia/{info.genres.contains('Documentary') ? 'Documentaries': info.SpokenLanguages =~ /hi/  ? 'Hindi' : 'Movies'}/{Collection.replaceAll(/Saga Collection/, Saga).replaceAll(/[`\�\�\�\?""\�\�]/, "'").replaceAll(/[:|]/, " - ").replaceAll(/[?]/, "!").replaceAll(/[*\s]+/, " ")}\{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).equals(norm(primaryTitle))) ' ('+norm(primaryTitle)+')'}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""} ({y})/{norm(n)}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}{'.' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition|mind.bending.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, " ")}{" Part $pi"}{".$y"}{".$vf"}{".$vc"}{".$source"}{".$group"}
Parameter: seriesFormat = //mnt/MyMedia/{info.genres.contains('Documentary') ? 'Documentaries': 'TV Shows'}/{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)}{(!norm(n).equals(norm(primaryTitle))) ' ('+norm(primaryTitle)+')'}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""} ({y})/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{norm(n)} {episode.special ? 'S00E'+special.pad(2) : s00e00} {norm(t)}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}{'.' + fn.matchAll(/extended|uncensored|remastered|unrated|special[ ._-]edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[.]/, " ")}{".$y"}{".$vf"}{".$vc"}{".$source"}{".$group"}
Argument[0]: /mnt/data/torrents/Close.Encounters.of.the.Third.Kind.1977.D.C.1080p.Bluray.x264.anoXmous
Input: /mnt/data/torrents/Close.Encounters.of.the.Third.Kind.1977.D.C.1080p.Bluray.x264.anoXmous/Close.Encounters.of.the.Third.Kind.1977.D.C.1080p.Bluray.x264.anoXmous_.mp4
Input: /mnt/data/torrents/Close.Encounters.of.the.Third.Kind.1977.D.C.1080p.Bluray.x264.anoXmous/Close.Encounters.of.the.Third.Kind.1977.D.C.1080p.Bluray.x264.anoXmous_eng.srt
Input: /mnt/data/torrents/Close.Encounters.of.the.Third.Kind.1977.D.C.1080p.Bluray.x264.anoXmous/Close.Encounters.of.the.Third.Kind.1977.D.C.1080p.Bluray.x264.anoXmous_swe.srt
Group: [mov:close encounters of the third kind 1977] => [Close.Encounters.of.the.Third.Kind.1977.D.C.1080p.Bluray.x264.anoXmous_.mp4, Close.Encounters.of.the.Third.Kind.1977.D.C.1080p.Bluray.x264.anoXmous_eng.srt, Close.Encounters.of.the.Third.Kind.1977.D.C.1080p.Bluray.x264.anoXmous_swe.srt]
No missing subtitles
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/mnt/data/torrents/Close.Encounters.of.the.Third.Kind.1977.D.C.1080p.Bluray.x264.anoXmous/Close.Encounters.of.the.Third.Kind.1977.D.C.1080p.Bluray.x264.anoXmous_.mp4]
Stripping invalid characters from new path: //mnt/MyMedia/Hindi/\Close Encounters Of The Third Kind (1977)/Close Encounters Of The Third Kind.1977.1080p.x264.BluRay.anoXmous
Stripping invalid characters from new path: //mnt/MyMedia/Hindi/\Close Encounters Of The Third Kind (1977)/Close Encounters Of The Third Kind.1977.1080p.x264.BluRay.anoXmous
Stripping invalid characters from new path: //mnt/MyMedia/Hindi/\Close Encounters Of The Third Kind (1977)/Close Encounters Of The Third Kind.1977.1080p.x264.BluRay.anoXmous
[COPY] Rename [/mnt/data/torrents/Close.Encounters.of.the.Third.Kind.1977.D.C.1080p.Bluray.x264.anoXmous/Close.Encounters.of.the.Third.Kind.1977.D.C.1080p.Bluray.x264.anoXmous_.mp4] to [/mnt/MyMedia/Hindi/Close Encounters Of The Third Kind (1977)/Close Encounters Of The Third Kind.1977.1080p.x264.BluRay.anoXmous.mp4]
[COPY] Rename [/mnt/data/torrents/Close.Encounters.of.the.Third.Kind.1977.D.C.1080p.Bluray.x264.anoXmous/Close.Encounters.of.the.Third.Kind.1977.D.C.1080p.Bluray.x264.anoXmous_eng.srt] to [/mnt/MyMedia/Hindi/Close Encounters Of The Third Kind (1977)/Close Encounters Of The Third Kind.1977.1080p.x264.BluRay.anoXmous.srt]
Skipped [/mnt/data/torrents/Close.Encounters.of.the.Third.Kind.1977.D.C.1080p.Bluray.x264.anoXmous/Close.Encounters.of.the.Third.Kind.1977.D.C.1080p.Bluray.x264.anoXmous_swe.srt] because [/mnt/MyMedia/Hindi/Close Encounters Of The Third Kind (1977)/Close Encounters Of The Third Kind.1977.1080p.x264.BluRay.anoXmous.srt] already exists
Processed 2 files
Sending PushBullet report
Done ヾ(@⌒ー⌒@)ノ
"Close Encounters Of The Third Kind" should've been moved to "mnt/MyMedia/Movies", instead it moved to "mnt/MyMedia/Hindi".

I think I'm running latest version-1 filebot.

Re: filebot moving files to wrong folder

Posted: 17 Jan 2017, 06:51
by rednoah
Your movieFormat decides where files are moved. Please use the Format Editor to test and debug your format.

What is the value of info.SpokenLanguages for the movie that doesn't get processed right?

Code: Select all

info.SpokenLanguages =~ /hi/  ? 'Hindi' : 'Movies'