glut23 / webvtt-py

Read, write, convert and segment WebVTT caption files in Python.
MIT License
192 stars 56 forks source link

Malformed VTT Cue treated as ok data #49

Closed zevlg closed 5 months ago

zevlg commented 1 year ago

https://w3c.github.io/webvtt/#webvtt-cue-block explicitly specifies that VTT Cue ends with the WebVTT line terminator. However, in the test_parse_captions_with_bom test case the last caption (without WebVTT line terminator) is treated as ok data, but is definitely malformed, because there is no WebVTT line terminator at the end.

glut23 commented 5 months ago

Hi @zevlg recent changes in the library were made to be less strict that is essentially closer to what video players are doing with caption files. I fixed the output of the WebVTT files produced to have a line break after the last caption to match the specs. 0.5.1 includes the fix. Thanks for raising the issue.