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

stream.hls: fix byterange parser #4301

Merged

Conversation

bastimeyer
Copy link
Member

Fixes #4300

https://datatracker.ietf.org/doc/html/rfc8216#section-4.3.2.2

The EXT-X-BYTERANGE tag indicates that a Media Segment is a sub-range
of the resource identified by its URI. It applies only to the next
URI line that follows it in the Playlist. Its format is:

#EXT-X-BYTERANGE:<n>[@<o>]

where n is a decimal-integer indicating the length of the sub-range
in bytes. If present, o is a decimal-integer indicating the start of
the sub-range, as a byte offset from the beginning of the resource.
If o is not present, the sub-range begins at the next byte following
the sub-range of the previous Media Segment.

If o is not present, a previous Media Segment MUST appear in the
Playlist file and MUST be a sub-range of the same media resource, or
the Media Segment is undefined and the client MUST fail to parse the
Playlist.


I'll take a look at writing some tests for this once I get the time. I'm currently busy with other stuff. There's also the other issue which I've talked about in #4300 which needs to be fixed too.

@gravyboat gravyboat merged commit 35a91ea into streamlink:master Jan 19, 2022
@bastimeyer bastimeyer deleted the stream/hls/fix-byterange-parser branch January 19, 2022 16:44
Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ValueError: Padding is incorrect.
2 participants