From 676110c01e28bd2f003558bd8327682510ecad25 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Sat, 30 Jul 2022 01:33:21 +0100 Subject: [PATCH] PSSH: Fix check of Cenc Header data in get_as_box() --- pywidevine/pssh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pywidevine/pssh.py b/pywidevine/pssh.py index bd43666..b0a04d8 100644 --- a/pywidevine/pssh.py +++ b/pywidevine/pssh.py @@ -111,7 +111,7 @@ class PSSH: if isinstance(data, str): data = base64.b64decode(data) if isinstance(data, bytes): - if base64.b64encode(data) == b"CAES": # likely widevine pssh data + if base64.b64encode(data).startswith(b"CAES"): # likely widevine pssh data try: cenc_header = WidevinePsshData() cenc_header.ParseFromString(data)