go-astisub icon indicating copy to clipboard operation
go-astisub copied to clipboard

Broken VTT styling in output (0.26.0 only)

Open kloon15 opened this issue 1 year ago • 3 comments

2_Eng.zip

The simplified code:

var sub *astisub.Subtitles
if strings.HasSuffix(file.Name, ".srt") {
sub, err = astisub.ReadFromSRT(fd)
} else if strings.HasSuffix(file.Name, ".ass") || strings.HasSuffix(file.Name, ".ssa") {
sub, err = astisub.ReadFromSSA(fd)
}
var buf = &bytes.Buffer{}
sub.WriteToWebVTT(buf)

kloon15 avatar Oct 16 '23 19:10 kloon15

What is actually missing is parsing the html tags in .srt (and other formats as well) and writing them in .vtt (and other formats as well).

I won't have time to work on this anytime soon but I'm welcoming PRs. I can point towards the proper direction 👍

asticode avatar Oct 17 '23 07:10 asticode

What is actually missing is parsing the html tags in .srt (and other formats as well) and writing them in .vtt (and other formats as well).

I won't have time to work on this anytime soon but I'm welcoming PRs. I can point towards the proper direction 👍

I see, well i have some javascript code that does srt to vtt with styles as a starting point, but im far from a go dev. How complicated would this be in go?

kloon15 avatar Oct 18 '23 19:10 kloon15

Regarding parsing html tags in .srt we'd have to:

Regarding writing htmk tags in .srt we'd have to:

  • add a (li LineItem) srtBytes() (c []byte) method similar to webVTTBytes

asticode avatar Oct 19 '23 07:10 asticode