asticode / go-astisub

Manipulate subtitles in GO (.srt, .ssa/.ass, .stl, .ttml, .vtt (webvtt), teletext, etc.)
MIT License
577 stars 111 forks source link

Support parsing srt without sequence numbers. #93

Closed samuel closed 1 year ago

samuel commented 1 year ago

There are many srt in the wild that are missing sequence numbers. It's easy to detect by looking for an empty line vs index/sequence in the line before the time. In my analysis of a good number of srt I have not seen ones missing the empty line, but it's feasible that these also exist. This shouldn't affect parsing otherwise, however, and in my experience the missing sequence number is common enough that it's useful to handle.

samuel commented 1 year ago

Examples of these srt files: https://media.defcon.org/DEF%20CON%2023/DEF%20CON%2023%20video/

asticode commented 1 year ago

Thanks for the PR! ❤️

asticode commented 1 year ago

Let me know whether you need a tag 👍