AlexPoint / SubtitlesParser

Multi formats subtitles parser in C#
MIT License
134 stars 40 forks source link

MIght want a way for SubParser to report which subtitle type it found #36

Open mshiels opened 2 years ago

mshiels commented 2 years ago

I have a situation where I am using subliminal to download subtitles, and it seems to default to naming them .en.srt, but some are NOT SRT, so I used our code to read them and it worked great, but I can't tell it was not a Srt to start with, so have to read/rewrite them all instead of just rewriting the few 'wrong ones'.

AlexPoint commented 2 years ago

Indeed, that would be useful to make public which subtitle file type was detected in the parsing. That should not be too difficult and I'll have a look at that development as soon as possible.

To make sure I understand correctly your usecase, some of your subtitle files have the wrong extension and you want to detect which ones as well as their "real" subtitle type, and update their extension?

b-rad15 commented 2 years ago

Not op but I can confirm that often people submit subs as .srt when they are a different format either just due to laziness or not understanding the different formats or because the site they submit to only allows .srt files to be submitted. They all still work mostly because vlc will read files regardless of the extension. I also think youtube-dl does not always use the correct extension, but I may be wrong on that specifically.

mshiels commented 2 years ago

The bigger problem is feeding stuff to 'ffmpeg' and it was having problems based on extension of course. But yes I figured it has the smarts for auto-detection, so return the info, that way it can be used for all sorts of stuff possibly.