I wish that someone would come up with a standard format for naming these types of files but apparently, that is never going to happen. So I have a question to hopefully save me, well, I already have no hair to pull out...so (lol). How can I take all these various naming formats and make them so they work with Filebot?
I know that the supposed standard standard is: filename.en_US.srt with lowercase language and uppercase country code. But most don't use the country code unless they are doing subs in say eng_UK, eng_US, eng_IE, etc.... For my library, since my current script doesn't handle it well, I usually just delete most sub files that Filebot thinks are the same after they process. I'd like to change this.
Quick example of what I am looking at now. (and yes, I know Filebot handles them currently, but it's not handling how some are named....like this:)
Movie Folder
- Subs Folder
- English.srt (this is the same as the one in the main folder, just doesn't contain the movie name (yes, I know you know this))
- SDH.eng.srt
- CC.eng.srt
- This Movie.mp4
- This Movie.srt
Using the above I end up with this output:
This Movie.mp4
This Movie.eng.srt
This Movie.eng.srt
This Movie.eng.srt
This Movie.eng.srt
My problem is that now when I click to rename it shows that 3 will be removed. I don't like that but it's simply quicker and easier to just click them into oblivion. However, I usually will rename the SDH files manually to keep them.
I have found that when just using the {subt} at the end of my code it seems to handle the language correctly but not anything else. Well, that's not entirely true. Take the SDH file. The {subt} doesn't like that format. However, if I manually rename it to eng-SDH.srt it handles that perfectly and outputs .eng.SDH.srt
All that to ask how to automate all of that? I guess I could do the text file read to fix SDH.eng > eng.SDH but is that the only way? And I am guessing that code in the script would be:
{any{csv('M:/replacesrt.csv').get(srt)}{srt}{"eng"} } Maybe? And then I guess I would fill that will all the variations I find.
Or, is there a simpler way for Filebot to figure out that sdh.eng is the same as eng.sdh and name it that way? And then what about all the language/country codes. Is there no way for Filebot to handle them better? Or at all? I seem to have the issues like above with several of the languages. Portuguese and Chinese are perfect examples...as is Spanish. They all can have various flavors for various locations.
I guess before anything the question would be what does Filebot want to see and what variations does it spit out?
Greg
.srt file handling
Re: .srt file handling
Fortunately, you can just write your own custom format, since the target file path is ultimately up to your custom format over which you have absolute control. FileBot by default forces everything into the common case which is .eng.srt or .eng-SDH.srt (ISO 639-3 language codes only; no support locale strings) as everything else is rare and / or requires you to make assumptions (eng -> en_US, no language -> en_US, etc) that FileBot cannot make for everyone, but that you can make for yourself.
e.g. add "Subs" folder to target path for subtitle files that are in a "Subs" folder:
e.g. add "-SDH" if the file name contains the "SDH" keyword:
e.g. add "_US" if the file name contains the "_US" keyword:
e.g. add ".eng" if the file at hand is a subtitle file and the language is undefined:
And so on. You will want to collect lots of subtitle files that represent all the various corner cases, and the prototype your format with rapid trial & error testing.
tl;dr you can write your own code to interpret the original subtitle file name and then produce the desired target subtitle file name
e.g. add "Subs" folder to target path for subtitle files that are in a "Subs" folder:
Format: Select all
{ folder.name == /Subs/ ? 'Subs' : null }
Format: Select all
{ fn =~ /SDH/ ? '-SDH' : null }
Format: Select all
{ fn =~ /_US/ ? '_US' : null }
Format: Select all
{ f.subtitle ? any{ '.' + lang }{ '.eng' } : null }
tl;dr you can write your own code to interpret the original subtitle file name and then produce the desired target subtitle file name
Please read the FAQ and How to Request Help.
Re: .srt file handling
Thank you so much red... You know, I have this so much harder in my head than it is...then you post the example and it makes so much sense. So many times I read your replies and think, I honestly should have thought of that. I have read so many examples of things and look at how to put things together, and why the code does what it does....but then when I need to do something I never seem to look for the easy solution. Always knowing it's there.... LOL
again for the 70th time or so.... Thank you so very much! This is the reason I will always have my Filebot license!!!!
Greg
Oh, and just an FYI: I ONLY use the rename feature of the app. I mean, from the videos I have watched I see it is so much more powerful than what I use it for...I almost wish I had a reason to use the rest of it. What's scary is that I am 100% sure I could use it and would love using it but then my life would be much more complicated because those are more rabbit holes I probably should not go down!!! My friends already laugh at how much time I spend on my file formats, names, Plex work (fixing errors, fixing posters, creating play-lists, etc...)
again for the 70th time or so.... Thank you so very much! This is the reason I will always have my Filebot license!!!!
Greg
Oh, and just an FYI: I ONLY use the rename feature of the app. I mean, from the videos I have watched I see it is so much more powerful than what I use it for...I almost wish I had a reason to use the rest of it. What's scary is that I am 100% sure I could use it and would love using it but then my life would be much more complicated because those are more rabbit holes I probably should not go down!!! My friends already laugh at how much time I spend on my file formats, names, Plex work (fixing errors, fixing posters, creating play-lists, etc...)
Re: .srt file handling
I will be doing exactly this. And your simple suggestion of testing JUST what you need to figure out has saved me sooooo much time and headaches. Another 'how did I not think of that' moment. LOLrednoah wrote: ↑03 Jan 2024, 17:33
And so on. You will want to collect lots of subtitle files that represent all the various corner cases, and the prototype your format with rapid trial & error testing.
you can write your own code to interpret the original subtitle file name and then produce the desired target subtitle file name
Greg
Re: .srt file handling
Cheers.
The more you get familiar with custom formats for the purpose of media renaming, the more you will want to use custom formats for the purpose of any kind of batch renaming, aka Plain File Mode. It's a steep learning curve, but if you've already familiarized yourself with a bit of coding for reasons, then all the other GUI renaming tools feel so limited because you can only do so much with checkboxes and comboboxes.
The more you get familiar with custom formats for the purpose of media renaming, the more you will want to use custom formats for the purpose of any kind of batch renaming, aka Plain File Mode. It's a steep learning curve, but if you've already familiarized yourself with a bit of coding for reasons, then all the other GUI renaming tools feel so limited because you can only do so much with checkboxes and comboboxes.
Please read the FAQ and How to Request Help.