Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken VTT styling in output (0.26.0 only) #94

Open
kloon15 opened this issue Oct 16, 2023 · 3 comments
Open

Broken VTT styling in output (0.26.0 only) #94

kloon15 opened this issue Oct 16, 2023 · 3 comments

Comments

@kloon15
Copy link

kloon15 commented Oct 16, 2023

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)
@asticode
Copy link
Owner

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 👍

@kloon15
Copy link
Author

kloon15 commented Oct 18, 2023

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?

@asticode
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants