Session keys from master playlists often contain PSSHs with multiple KIDs covering all tracks, causing licensing to return keys for wrong KIDs. Changes: - Unified DRM licensing logic for all downloaders - Prefer media playlist EXT-X-KEY tags which contain track-specific KIDs - Add filter_keys_for_cdm() to select keys matching configured CDM type - Add get_track_kid_from_init() to extract KID from init segment with fallback to drm.kid from PSSH - Track initial_drm_key to prevent double-licensing on first segment - Simplify n_m3u8dl_re block to reuse common licensing flow - Use strict PlayReady keyformat matching via PR_PSSH.SYSTEM_ID URN instead of loose substring match - Fix PlayReady keyformat comparisons that incorrectly compared strings to PlayReadyCdm class - Fix byterange header format in get_track_kid_from_init() to use HLS.calculate_byte_range() Also fixes PlayReady keyformat matching in: - unshackle/core/tracks/track.py - unshackle/core/drm/playready.py Fixes download failures where track_kid was null or mismatched, causing wrong content keys to be obtained during PlayReady/Widevine licensing.
30 KiB
30 KiB