Organize subtitles

Any questions? Need some help?
Post Reply
madro17
Posts: 3
Joined: 07 Feb 2020, 07:53

Organize subtitles

Post by madro17 »

Hi,

i use this sheme to organize my movies and series. Everything works well, but i want to have the subtitles in an extra folder called Subs. Please can you help me guys?

MOVIES:

Code: Select all

U:/downloads/_SORTED-MOVIES/{n} - {y} {vf} {ac}-{channels}/{n} - {y} {vf} {ac}-{channels}
{if (file.subtitle) fn =~ /[-]eng$/ ? '-eng' : '' }
{if (file.subtitle) fn =~ /[-]ger$/ ? '-ger' : '' }
{if (file.subtitle) fn =~ /[-]forced$/ ? '-forced' : '' }
{if (file.subtitle) fn =~ /[.]eng$/ ? '-eng' : '' }
{if (file.subtitle) fn =~ /[.]ger$/ ? '-ger' : '' }
{if (file.subtitle) fn =~ /[.]forced$/ ? '-forced' : '' }
{if (file.subtitle) fn =~ /[_]eng$/ ? '-eng' : '' }
{if (file.subtitle) fn =~ /[_]ger$/ ? '-ger' : '' }
{if (file.subtitle) fn =~ /[_]forced$/ ? '-forced' : '' }
{if (file.subtitle) fn =~ /[-]engl$/ ? '-eng' : '' }
{if (file.subtitle) fn =~ /[.]engl$/ ? '-eng' : '' }
{if (file.subtitle) fn =~ /[_]engl$/ ? '-eng' : '' }
SERIES:

Code: Select all

U:/downloads/_SORTED-SERIEN/{n} - {s00e00} - {t} - {vf} {ac}-{channels}/{n} - {s00e00} - {t} - {airdate} {vf} {ac}-{channels}
{if (file.subtitle) fn =~ /[-]eng$/ ? '-eng' : '' }
{if (file.subtitle) fn =~ /[-]ger$/ ? '-ger' : '' }
{if (file.subtitle) fn =~ /[-]forced$/ ? '-forced' : '' }
{if (file.subtitle) fn =~ /[.]eng$/ ? '-eng' : '' }
{if (file.subtitle) fn =~ /[.]ger$/ ? '-ger' : '' }
{if (file.subtitle) fn =~ /[.]forced$/ ? '-forced' : '' }
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Organize subtitles

Post by rednoah »

I suppose you could just insert the extra folder level somewhere in your destination path:

Code: Select all

{f.subtitle ? '/SUBS' : null}

:idea: As for adding .eng-forced and friends to the end of the file path, {subt} will generally take care of that.
:idea: Please read the FAQ and How to Request Help.
madro17
Posts: 3
Joined: 07 Feb 2020, 07:53

Re: Organize subtitles

Post by madro17 »

Hi,

thanks for your answer. For sure i did something wrong.
I tested now with this sheme:

Code: Select all

U:/downloads/_SORTED-SERIEN/{n} - {s00e00} - {t} - {vf} {ac}-{channels}/{n} - {s00e00} - {t} - {airdate} {vf} {ac}-{channels}
{f.subtitle ? '/SUBS' : null}
{if (file.subtitle) fn =~ /[-]eng$/ ? '-eng' : '' }
{if (file.subtitle) fn =~ /[-]ger$/ ? '-ger' : '' }
{if (file.subtitle) fn =~ /[-]forced$/ ? '-forced' : '' }
{if (file.subtitle) fn =~ /[.]eng$/ ? '-eng' : '' }
{if (file.subtitle) fn =~ /[.]ger$/ ? '-ger' : '' }
{if (file.subtitle) fn =~ /[.]forced$/ ? '-forced' : '' }

Now i get an extra folder, which has the same name as the movie folder. In this folder are the subtitle files, but they got renamed to SUBS.idx and SUBS.sub
madro17
Posts: 3
Joined: 07 Feb 2020, 07:53

Re: Organize subtitles

Post by madro17 »

It works now, thank you :)

Code: Select all

U:/downloads/_SORTED-SERIEN/{n} - {s00e00} - {t} - {vf} {ac}-{channels}/{f.subtitle ? 'Subs' : null}/{n} - {s00e00} - {t} - {airdate} {vf} {ac}-{channels}
{if (file.subtitle) fn =~ /[-]eng$/ ? '-eng' : '' }
{if (file.subtitle) fn =~ /[-]ger$/ ? '-ger' : '' }
{if (file.subtitle) fn =~ /[-]forced$/ ? '-forced' : '' }
{if (file.subtitle) fn =~ /[.]eng$/ ? '-eng' : '' }
{if (file.subtitle) fn =~ /[.]ger$/ ? '-ger' : '' }
{if (file.subtitle) fn =~ /[.]forced$/ ? '-forced' : '' }
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Organize subtitles

Post by rednoah »

Yep. You got it. Insert it where you want it to be inserted. ;)
:idea: Please read the FAQ and How to Request Help.
Silke79
Posts: 28
Joined: 11 Dec 2018, 22:13

Re: Organize subtitles

Post by Silke79 »

Couldn't find what I was looking for and this was in the area of sort, but i'm looking on how to make my script only select the eng & swe subs and if there are forced subs too in the same language if possible?
Because sometimes one get a media with about 20 different language and needing to go through all media files can take some time.

Code: Select all

/TV-Serier/{az}/{(n == primaryTitle ? ny : ny + ' (' + primaryTitle + ')').colon(' - ')}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n.colon(' - ').lowerTrail()} - {s00e00} {'- #' + absolute.pad(4)} - {t.colon(' - ').lowerTrail()} - [{resolution}] [{vf} - {vc}] [{ac} - {af}] [{airdate}]{'.'+lang}
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Organize subtitles

Post by kim »

something like this:

Code: Select all

{
text.findAll{it.language == 'en' | it.language == 'sv' | it.forced == 'Yes'}.languageString3.unique().join(', ')
}
Silke79
Posts: 28
Joined: 11 Dec 2018, 22:13

Re: Organize subtitles

Post by Silke79 »

Still get the other subs, but then it could also be me that have not put the code in right in the script under here.

Code: Select all

/TV-Serier/{az}/{(n == primaryTitle ? ny : ny + ' (' + primaryTitle + ')').colon(' - ')}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n.colon(' - ').lowerTrail()} - {s00e00} {'- #' + absolute.pad(4)} - {t.colon(' - ').lowerTrail()} - [{resolution}] [{vf} - {vc}] [{ac} - {af}] [{airdate}]{'.'+lang}{text.findAll{it.language == 'en' | it.language == 'sv' | it.forced == 'Yes'}.languageString3.unique().join(', ')}
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Organize subtitles

Post by kim »

looks correct, but what files, because my code is only for video files not subs
try removing the

Code: Select all

{'.'+lang}
my code sample
eng, swe
Silke79
Posts: 28
Joined: 11 Dec 2018, 22:13

Re: Organize subtitles

Post by Silke79 »

Only thing that happened when I tried it when testing after you gave me the code was that I lost the tagg .eng and .swe at the end on my subs and I got every subs as usually then without language tagg.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Organize subtitles

Post by kim »

so you only want to rename subs and not video ?

then you can only use or custom format like 'madro17' :
lang subtitle language eng Language
subt subtitle tags .eng.forced String
https://www.filebot.net/naming.html
Post Reply