From 9d7eaf49496a65c1db6232d8031fb48a7fc566c6 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Fri, 5 Aug 2022 05:38:02 +0100 Subject: [PATCH] PSSH: Rework from_playready_pssh as a class method --- pywidevine/pssh.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pywidevine/pssh.py b/pywidevine/pssh.py index ac7e57a..57c1147 100644 --- a/pywidevine/pssh.py +++ b/pywidevine/pssh.py @@ -179,14 +179,14 @@ class PSSH: return cls(box) - @staticmethod - def from_playready_pssh(box: Container) -> Container: + @classmethod + def from_playready_pssh(cls, box: Container) -> PSSH: """ - Convert a PlayReady PSSH to a Widevine PSSH. + Convert a PlayReady PSSH Box to a Widevine PSSH Box. Note: The resulting Widevine PSSH will likely not be usable for Licensing. This - is because there is some data for a Widevine CENC Header that is not going to be - listed in a PlayReady PSSH. + is because there is some data for a Widevine Cenc Header that is missing from a + PlayReady PSSH Box. This converted PSSH will only be useful for it's Key IDs, so realistically only for matching Key IDs with a Track. As a fallback. @@ -211,7 +211,7 @@ class PSSH: box.init_data = cenc_header.SerializeToString() box.system_ID = PSSH.SystemId.Widevine - return box + return cls(box) @staticmethod def from_key_ids(key_ids: list[UUID]) -> Container: