-
Notifications
You must be signed in to change notification settings - Fork 474
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
Parsing and dumping of multiple EXT-X-KEYs per segment is not supported #283
Comments
Subscribing as an interested observer...
I think this is a good idea.
Documentation could be added to say that |
I would go with an empty list, then it would match the main |
+1. Having this issue as well. |
This closes globocom#283 as it now follows RFC and keeps all preceding keys for the segment. - `m3u8_obj.keys` still has the same behaviour. - `m3u8_obj.segments[0].key` is now removed. - `m3u8_obj.segments[0].keys` is added in it's place, which will now always be a list. - The list will always be present, it will never be `None` anymore, and if the segment explicitly has no DRM by specifying an EXT-X-KEY of METHOD=NONE then it will be a list with that key. - It does not check if there's a METHOD=NONE with other conflicting EXT-X-KEY information. - It still follows the same behaviour of not duplicating the EXT-X-KEY information on future segments when dumping. Do note that it only clears the list of Keys when it reaches an EXT-X-DISCONTINUITY, or it has reached a ts segment. The copy() statement is used because it clears after the segment is appended to `data`, yet the .clear() to `current_keys` follows in the appended `segment` unless we copy that data in memory prior. I don't think there's a need for `.by_key()` or `m3u8_obj.keys` anymore, but I've made sure those still work as intended in case there's a different reason those exist.
The HLS spec is clear that a segment may be preceeded with multiple EXT-X-KEY tags, so long as they resolve to a single decryption key. This allows multiple DRMs to be supported using Common Encryption.
When the example playlist below is parsed,
segment[0]['key']
only lists the last key that preceeded the segment. Dumping the playlist object results in only the last key preceeding the segment appearing in the output. We need to be able to have a list of keys associated with a segments, possibly manipulate these, and dump them correctly.Note:
m3u8['keys']
includes all keys, but it doesn't correctly associated keys with segments usingby_key
, presumably because of the above.Usually I would knock something together, but key handling seems a bit confusing to me and am looking for a bit of direction about what might be the best way to approach this. I am tempted simply to add
segment['keys']
and always return a list (or None when no keys), but it's not obvious whatsegment['key']
should be, or howm3u8['keys']
would operate, in this model. Does anyone else have an opinion here?The text was updated successfully, but these errors were encountered: