From 2fb3b21e4a0213f4adcb0a9c9db0f711f6f64945 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Wed, 8 Nov 2023 19:34:50 +0000 Subject: [PATCH] Raise an exception if PlayReadyHeader KID VALUE doesn't exist --- pywidevine/pssh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pywidevine/pssh.py b/pywidevine/pssh.py index 909b888..4261b89 100644 --- a/pywidevine/pssh.py +++ b/pywidevine/pssh.py @@ -257,7 +257,7 @@ class PSSH: ] elif prr_header_version == "4.1.0.0": key_ids = [ - x.get("VALUE") + x.attrib["VALUE"] for x in prr_header.findall("./wrm:DATA/wrm:PROTECTINFO/wrm:KID", wrm_ns) ] elif prr_header_version in ("4.2.0.0", "4.3.0.0"): @@ -265,7 +265,7 @@ class PSSH: # This is because some Key IDs can be AES-CTR while some are AES-CBC. # Conversion to WidevineCencHeader could use this information. key_ids = [ - x.get("VALUE") + x.attrib["VALUE"] for x in prr_header.findall("./wrm:DATA/wrm:PROTECTINFO/wrm:KIDS/wrm:KID", wrm_ns) ] else: