mantas-done / subtitles

Subtitle/caption converter
https://gotranscript.com/subtitle-converter
MIT License
142 stars 48 forks source link

MicroDVD converter expects dot at the end of line #90

Closed choks87 closed 6 months ago

choks87 commented 6 months ago

Issue at: https://github.com/mantas-done/subtitles/blob/20b84a593af883318aac8a325f6d5ed2bf95874e/src/Code/Converters/SubMicroDvdConverter.php#L11

\Done\Subtitles\Code\Converters\SubMicroDvdConverter

Cannot convert micro DVD of content:

{0}{100}Subtitle line 1
{150}{300}Subtitle line 2
{350}{550}Subtitle line 3

Because regex is /\{\d+\}\{\d+\}(.*)\./ . It matches this one:

{0}{100}Subtitle line 1.
{150}{300}Subtitle line 2.
{350}{550}Subtitle line 3.

There is a [dot] at the end, by removing /\{\d+\}\{\d+\}(.*) it accepts.

Not sure if it's by design or which standard. I found this articles: https://docs.fileformat.com/video/sub/ https://en.wikipedia.org/w/index.php?title=MicroDVD&oldid=1179638991

and both are saying that format is:

{start-frame}{stop-frame}Text
mantas-done commented 6 months ago

You are right! Will fix it tomorrow.

mantas-done commented 6 months ago

@choks87 Fixed.