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

Support parsing srt without sequence numbers. #93

Merged
merged 2 commits into from
Oct 2, 2023

Conversation

samuel
Copy link
Contributor

@samuel samuel commented Sep 30, 2023

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.

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 many 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
Copy link
Contributor Author

samuel commented Sep 30, 2023

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

Copy link
Owner

@asticode asticode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice PR 👍

I've only one comment though

srt_test.go Outdated Show resolved Hide resolved
@samuel samuel requested a review from asticode October 1, 2023 15:54
@asticode asticode merged commit fae4bff into asticode:master Oct 2, 2023
1 check passed
@asticode
Copy link
Owner

asticode commented Oct 2, 2023

Thanks for the PR! ❤️

@asticode
Copy link
Owner

asticode commented Oct 2, 2023

Let me know whether you need a tag 👍

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

Successfully merging this pull request may close these issues.

2 participants