Elgindy-VTT-to-SRT-Subtitle-Converter icon indicating copy to clipboard operation
Elgindy-VTT-to-SRT-Subtitle-Converter copied to clipboard

converted vtt file contains text format in srt output

Open darodi opened this issue 3 years ago • 4 comments

converted vtt file contains text format in srt output

source file https://gist.github.com/darodi/3ff8be373302fcd8c8bb0f9069dc7208#file-je-suis-la-2853734-fra-vtt

target file https://gist.github.com/darodi/3ff8be373302fcd8c8bb0f9069dc7208#file-je-suis-la-2853734-fra-srt

as you can see,

1
00:00:07,120 --> 00:00:09,480 
<c.magenta.bg_black>Musique douce</c>

insead of

1
00:00:07,120 --> 00:00:09,480 
Musique douce

darodi avatar Jan 21 '22 20:01 darodi

Mmmm, in all lines or specific ones?

zezo010 avatar Jan 22 '22 11:01 zezo010

all lines, as seen in output https://gist.github.com/darodi/3ff8be373302fcd8c8bb0f9069dc7208#file-je-suis-la-2853734-fra-srt

darodi avatar Jan 22 '22 11:01 darodi

the input is


WEBVTT

STYLE
::cue {
    font-family: Verdana, Arial, Tiresias;
    line-height: 125%;
}
::cue(.white) {
    color: #ffffff;
}
::cue(.lime) {
    color: #00ff00;
}
::cue(.cyan) {
    color: #00ffff;
}
::cue(.red) {
    color: #ff0000;
}
::cue(.yellow) {
    color: #ffff00;
}
::cue(.magenta) {
    color: #ff00ff;
}
::cue(.blue) {
    color: #0000ff;
}
::cue(.black) {
    color: #000000;
}
::cue(.bg_black) {
    background: rgba(0, 0, 0, 0.76);
}

sub0
00:00:07.120 --> 00:00:09.480 line:-1
<c.magenta.bg_black>Musique douce</c>

the output should be something like this i think

1
00:00:07,120 --> 00:00:09,480 
<font color=#ff00ff">Musique douce</font> 

darodi avatar Jan 22 '22 11:01 darodi

This because this file used VTT classes, So we should check if each line uses classes tags and removing it.

zezo010 avatar Jan 25 '22 08:01 zezo010