Ithiel's super crazy renaming scheme for perfectionists!

All about user-defined episode / movie / file name format expressions
DavidRTurner
Power User
Posts: 85
Joined: 01 Feb 2014, 16:59

Re: Ithiel's super crazy renaming scheme for perfectionists!

Post by DavidRTurner »

Hey, elgallo -

FB has the capability of (almost) endless customization, so those who decide to perfect their naming schemes through a tool, rather than manually, have an opportunity to do so.
That's why the program exists. If you really need/want only a basic renamer, there are lots of other apps out there that do just that.

As anything becomes more complex, it becomes more prone to problems.
The more lengths one goes to to cover more digital situations, the more likely the code will glitch.
So sure... simplifying things makes it easier... but it's not as fun!
besides has anyone ever seen/downloaded a 3D show? plus theres no need for uncut/unrated etc for TV shows. did the same for anime and got it to work on a Mac. hope it helps.
FYI - 3-D TV is here! Some BluRays offer 3D video, so as TV series archives move from DVD to BD, there WILL be a need for it.
Maybe it will be a while before a 3D episode can be ripped, but if a software player offers the 3D capability from a video file and not just from the disc, then there's a need for renaming those ripped videos.


As for uncut/unrated... yes, there certainly is a need for these, on DVD releases mostly.
Or on cable channels that may broadcast these episodes.
Some of us collect 'the broadcast episode' as well as 'the unaired version' and 'the uncut version with deleted scenes' and 'the uncensored version'... see where I'm going? All of these would be named as the same episode of the show, but this renaming feature allows various terms in the filename we can use to keep track of our collection.
It's all a matter of "How much work do YOU want to do on it?". There's no right, or wrong, answer...
Urlryn
Posts: 16
Joined: 18 Sep 2014, 22:29

Re: Ithiel's super crazy renaming scheme for perfectionists!

Post by Urlryn »

Hey Ithiel,

Running into a couple of issues....

The Movie scheme located in this thread works fine..no errors.
The Updated Movie Script on your github is generating this error.

Code: Select all

ScriptExecution: java.lang.Exception: Pattern not found
Both the Anime scheme located in this thread and the Updated Anime Script generate this error:

Code: Select all

BindingException: "pi": undefined
Been trying to figure it out if this was something on my end or not....but stumped atm!

Figured this out....so this part is Resolved
Also is there away to reverse the folder name itself?
So instead of ENGTitle (JPNTitle) it would be JPNTitle (ENGTitle)...example:

Kenichi - The Mightiest Disciple (Shijou Saikyou No Deshi Ken'ichi) (2006)
it would be
Shijou Saikyou No Deshi Ken'ichi (Kenichi - The Mightiest Disciple) (2006)

Thanks
Urlryn
JohnnyT009
Posts: 15
Joined: 19 Dec 2016, 02:16

Re: Ithiel's super crazy renaming scheme for perfectionists!

Post by JohnnyT009 »

I have been trying to get this to work with cat amc.arguments | tr '\n' '\0' | xargs -0 filebot but keep getting the error below. I included my amc.aruments.

FileBot 4.7.5 (r4639) / Java(TM) SE Runtime Environment 1.8.0_25 / Linux 4.4.30-unRAID (amd64)

Code: Select all

cat amc.arguments | tr '\n' '\0' | xargs -0 filebot
/bin/bash: -c: line 0: syntax error near unexpected token `('
/bin/bash: -c: line 0: `. /mnt/cache/.PhAzE-Common/Filebot/startcfg.sh; /usr/local/Filebot/filebot.sh -script fn:amc --output /mnt/user/Media/TEMP --log-file amc.log --action copy --conflict override -non-strict --def ut_dir=/mnt/user/Media/INPUT "seriesFormat=TVShows/{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)+')'}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""} ({y}{' '+any{certification}{imdb.certification}.replaceAll(/^\d+$/, 'PG-$0')})/{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|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, " ") + ')'}{" Part $pi"}{" [$vf $vc $ac $af]"}" "animeFormat=/mnt/user/Media/TEMP/Anime/{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)+')'}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""} ({y}{' '+any{certification}{imdb.certification}.replaceAll(/^\d+$/, 'PG-$0')})/{norm(n)} - {absolute.pad(episodelist.size() < 99 ? 2 : 3)}{'Special '+special.pad(episodelist.size() < 99 ? 2 : 3)} - {norm(t)}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, " ") + ')'}{" Part $pi"}{" [$vf $vc $ac $af]"}" "movieFormat=/mnt/user/Media/TEMP/Movies/{collection.replaceFirst(/^(?i)(The)\s(.+)/, /$2, $1/).replaceFirst(/^(?i)(Collection of the)\s(.+)/, /$2 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) != norm(primaryTitle)) ' ('+norm(primaryTitle)+')'}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""} ({y}{' '+any{certification}{imdb.certification}.replaceAll(/^\d+$/, 'PG-$0')})/{norm(n)}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, " ") + ')'}{" Part $pi"}{" [$vf $vc $ac $af]"}" "musicFormat=/mnt/user/Media/TEMP/Music/{n}/{album}/{media.TrackPosition.pad(2)} - {t}" minFileSize=0 minLengthMS=0 excludeList=amc.excludes pushbullet=*******

Code: Select all

-script
fn:amc
--output
/mnt/user/Media/TEMP
--log-file
amc.log
--action
copy
--conflict
override
-non-strict
--def
ut_dir=/mnt/user/Media/INPUT
seriesFormat=TVShows/{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)+')'}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""} ({y}{' '+any{certification}{imdb.certification}.replaceAll(/^\d+$/, 'PG-$0')})/{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|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, " ") + ')'}{" Part $pi"}{" [$vf $vc $ac $af]"}
animeFormat=/mnt/user/Media/TEMP/Anime/{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)+')'}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""} ({y}{' '+any{certification}{imdb.certification}.replaceAll(/^\d+$/, 'PG-$0')})/{norm(n)} - {absolute.pad(episodelist.size() < 99 ? 2 : 3)}{'Special '+special.pad(episodelist.size() < 99 ? 2 : 3)} - {norm(t)}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, " ") + ')'}{" Part $pi"}{" [$vf $vc $ac $af]"}
movieFormat=/mnt/user/Media/TEMP/Movies/{collection.replaceFirst(/^(?i)(The)\s(.+)/, /$2, $1/).replaceFirst(/^(?i)(Collection of the)\s(.+)/, /$2 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) != norm(primaryTitle)) ' ('+norm(primaryTitle)+')'}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""} ({y}{' '+any{certification}{imdb.certification}.replaceAll(/^\d+$/, 'PG-$0')})/{norm(n)}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, " ") + ')'}{" Part $pi"}{" [$vf $vc $ac $af]"}
musicFormat=/mnt/user/Media/TEMP/Music/{n}/{album}/{media.TrackPosition.pad(2)} - {t}
minFileSize=0
minLengthMS=0
excludeList=amc.excludes
pushbullet=######
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Ithiel's super crazy renaming scheme for perfectionists!

Post by rednoah »

@file syntax is the recommended way of passing in complex arguments via text files: viewtopic.php?f=3&t=3244
:idea: Please read the FAQ and How to Request Help.
Post Reply