jansenicus / vtt-to-srt.py

python script to convert all vtt files in a directory and all of its subdirectories to srt subtitle format
61 stars 33 forks source link

Not Stripping/Converting Metadata #9

Closed agret closed 5 years ago

agret commented 5 years ago

The VTT file:

WEBVTT

0
00:01.760 --> 00:04.640 position:50% align:middle size:80%
<c.box><c.yellow.bg_black>(ALARM BEEPS)</c></c>```

1
00:08.080 --> 00:12.280 position:50% align:middle size:80%
<c.box><c.cyan.bg_black>('THE LOVECATS' BY THE CURE PLAYS)</c></c>

The generated SRT file:

00:01,760 --> 00:04,640 position:50% align:middle size:80%
<c.box><c.yellow.bg_black>(ALARM BEEPS)</c></c>

00:08,080 --> 00:12,280 position:50% align:middle size:80%
<c.box><c.cyan.bg_black>('THE LOVECATS' BY THE CURE PLAYS)</c></c>

This file is invalid and doesn't load properly in SRT playback, it should be:

00:01,760 --> 00:04,640
(ALARM BEEPS)

00:08,080 --> 00:12,280
'THE LOVECATS' BY THE CURE PLAYS)
heniotierra commented 5 years ago

You're right. I think stripping these stuff should solve the problem.

channchetra commented 5 years ago

I think should be like this:

`1 00:01,760 --> 00:04,640 (ALARM BEEPS)

2 00:08,080 --> 00:12,280 'THE LOVECATS' BY THE CURE PLAYS)

3 ==================`

heniotierra commented 5 years ago

Fixed. Thank you guys!