-
Notifications
You must be signed in to change notification settings - Fork 56
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
MalformedCaptionError: Invalid Time Format #44
Comments
Thank you @ZhijingEu - this is certainly helpful, but I think the real solution to the problem is for webvtt-py to be much more forgiving in the way it parses VTTs. I don't know what the precise VTT spec says about time formats, but judging by the fact that mainstream sources like, e.g., the Microsoft Teams autogenerated transcripts, exhibit this behaviour, it would behoove webvtt-py to accommodate this relatively trivial change. I'll hopefully open a PR for that soon. |
https://www.w3.org/TR/webvtt1/#webvtt-timestamp Exactly 3 digits are required by the standard. Else things like VideoJS will stop execution. Basically the Teams, AWS and many services are breaking the standard and instead of getting it fixed there - everyone is doing their own hacks to handle broken things. |
I get that, but pragmatically speaking, it's probably best for tools to be as permissive as they reasonably can, especially for spec violations that are widely common in the wild. Users of webvtt-py likely can't choose to just consume transcripts from some other source, but they can choose to just use some other VTT parser. |
I've found this works as a temporary fix for Teams time formats.
|
Ah yeah, clever - you can just monkey-patch those variables directly in the module. ... still would be nicer not to have to do that, though 😅 |
Hey everyone - I just wanted to share a quick fix for a problem where I noticed webvtt-py does not do well when timestamps are in the format of 0:1:5.2 as opposed to 00:01:05:002.
I have written a piece of regex find replace to convert the format that I've shared over here on this repo https://github.com/ZhijingEu/VTT_File_Cleaner and also accompanied by a video tutorial https://www.youtube.com/watch?v=iZ0pOSL8JZw
Hope this helps someone out there in the future facing this issue
The text was updated successfully, but these errors were encountered: