From b301fb43900671727f899d0bdec2d0914857d76e Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Tue, 28 Mar 2023 20:25:30 +0100 Subject: [PATCH] Use tenc boxes within uuid boxes as another fallback for get_key_id --- devine/core/tracks/track.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/devine/core/tracks/track.py b/devine/core/tracks/track.py index e0b5298..62f618e 100644 --- a/devine/core/tracks/track.py +++ b/devine/core/tracks/track.py @@ -124,6 +124,13 @@ class Track: if tenc.key_ID.int != 0: return tenc.key_ID + # look for UUID mp4 boxes holding track encryption mp4 boxes + for uuid_box in get_boxes(init_data, b"uuid"): + if uuid_box.extended_type == UUID("8974dbce-7be7-4c51-84f9-7148f9882554"): + tenc = uuid_box.data + if tenc.key_ID.int != 0: + return tenc.key_ID + def get_init_segment( self, maximum_size: int = 20000,