mantas-done / subtitles

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

Undefined array key 1 when converting .sub to .srt #33

Closed foremtehan closed 1 year ago

foremtehan commented 3 years ago

File: Serbian.zip

Looks like it cannot convert .sub to .srt

Subtitles::convert('Serbian.sub', 'Serbian.srt')
ErrorException : Undefined array key 1
\vendor\mantas-done\subtitles\src\code\Converters\SubConverter.php:70
\vendor\mantas-done\subtitles\src\code\Converters\SubConverter.php:21
\vendor\mantas-done\subtitles\src\Subtitles.php:201
\vendor\mantas-done\subtitles\src\Subtitles.php:190
\vendor\mantas-done\subtitles\src\Subtitles.php:39
vendor\mantas-done\subtitles\src\Subtitles.php:33
tacman commented 3 years ago

It looks like SubConverter.php was based on srt and not finished. For example, it looks for a comma-delimited time, but the .sub format is {time}{time}. I've started to fix this, but wanted to make sure that there wasn't already some other solution available.

mantas-done commented 1 year ago

Seems that this .sub file is in MicroDVD format, not in SubViewer. Its support was added and you can now convert your file :)