First of all the command I use:
Code: Select all
filebot -script fn:amc --action test --output "/<disk>/Media" --conflict --def clean=y unsorted=y subtitles=en artwork=y excludeList=".excludes" ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL" exec="chmod 664 '{file}'" --def @/<disk>/scripts/pushover.txt --def [email protected]/<disk>/scripts/movies.groovy [email protected]/<disk>/scripts/tvshows.groovy
Here's the Movie one:
Code: Select all
{ 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/) } }
{ transl = { it.transliterate("Any-Latin; NFD; NFC; Title") }
isLatin = { java.text.Normalizer.normalize(it, java.text.Normalizer.Form.NFD)
.replaceAll(/\p{InCombiningDiacriticalMarks}+/, "") ==~ /^\p{InBasicLatin}+$/ } }
{ allOf
{"Movies"}
// Movies directory
{n.colon(" - ") + " ($y, $director)"}
// File name
{ allOf
{ isLatin(primaryTitle) ? primaryTitle : transl(primaryTitle) }
{" ($y)"}
// tags + a few more variants
{ specials = { allOf
{tags}
{ fn.findAll(/(?i:alternate[ ._-]cut|limited|proper|repack)/)*.upperInitial()*.lowerTrail()*.replaceAll(/[._-]/, " ") }
.flatten().sort() }
specials().size() > 0 ? specials().join(", ").replaceAll(/^/, " - ") : "" }
{" PT $pi"}
{" ["}
{ allOf
// Video stream
{[vf,vc].join(" ")}
{ allOf
// Audio stream and language
{[channels,ac].join(" ")}
{ def a = audioLanguages
a.size() > 1 ? a.ISO3.join(", ").upperInitial() : a.name.first() }
.join(" ") }
{source}
.join(" - ") }
{"]"}
{"-" + group}
{subt}
.join("") }
.join("/") }
- From /<disk>/download/movies/少林足球 (Uncut).mp4 to /<disk>/Media/Movies/Shaolin Soccer (2001, Stephen Chow)/Shǎo Lín Zú Qiú (2001) - Uncut [1080p x264 - 5.1 AAC - Blu-ray].mp4
- From /<disk>/download/movies/少林足球 (Uncut).eng.srt to /<disk>/Media/Movies/Shaolin Soccer (2001, Stephen Chow)/Shǎo Lín Zú Qiú (2001) - Uncut [1080p x264 - 5.1 AAC - Blu-ray].eng.srt
- From /<disk>/download/movies/GHOST IN THE SHELL (1995)-FGT.mkv to /<disk>/Media/Movies/Ghost in the Shell (1995, Mamoru Oshii)/GHOST IN THE SHELL (1995) [1080p x264 - 2.0 AC3 Eng, Jpn - BluRay]-FGT.mkv
And here the TV Shows one, this is greener and less polished:
Code: Select all
{ 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/) } }
{ allOf
{"TV Shows"}
{ allOf
{ (norm(n) == norm(primaryTitle)) ? norm(n) : norm(n) + ' [' + norm(primaryTitle) + ']' }
{ "($y)" }
.join(" ") }
{ episode.special ? 'Specials' : 'Season ' + s.pad(2) }
{ allOf
{ norm(n) }
{ episode.special ? 'S00E' + special.pad(2) : s00e00 }
{ allOf
{ norm(t) }
{"PT $pi"}
{ allOf
{ allOf
{"["}
{ allOf
{[vf,vc].join(" ")}
{[channels,ac].join(" ")}
{source}
.join(" - ") }
{"]"}
.join("") }
{"-$group"}
{subt}
.join("") }
.join(" ") }
.join(" - ") }
.join("/") }
- From /<disk>/download/tvshows/Boris - Stagione 1/Boris.1x01.Il mio primo giorno.FFT.sat.ITA.avi to /<disk>/Media/TV Shows/Boris (2007)/Season 01/Boris - S01E01 - Il Mio Primo Giorno [480p DivX - 2.0 MP3]-iTA.avi
- From /<disk>/download/tvshows/Boris - Stagione 1/Boris.1x02.L'anello del conte.FFT.sat.ITA.avi to /<disk>/Media/TV Shows/Boris (2007)/Season 01/Boris - S01E02 - L'anello Del Conte [480p DivX - 2.0 MP3]-iTA.avi