From 8f7cacb10a0345b6c9bc4b48bdf601f1466e2b53 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Sat, 30 Jul 2022 02:21:02 +0100 Subject: [PATCH] PSSH: Remove from_init_data() This is unused and will soon be unnecessary. --- pywidevine/pssh.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/pywidevine/pssh.py b/pywidevine/pssh.py index b0a04d8..2ef4db9 100644 --- a/pywidevine/pssh.py +++ b/pywidevine/pssh.py @@ -22,28 +22,6 @@ class PSSH: def __init__(self, box: Container): self._box = box - @staticmethod - def from_init_data(init_data: Union[str, bytes, WidevinePsshData]) -> Container: - """Craft a new PSSH Box from just Widevine PSSH Data (init data).""" - if isinstance(init_data, str): - init_data = base64.b64decode(init_data) - if isinstance(init_data, bytes): - cenc_header = WidevinePsshData() - cenc_header.ParseFromString(init_data) - init_data = cenc_header - if not isinstance(init_data, WidevinePsshData): - raise ValueError(f"Unexpected value for init_data, {init_data!r}") - - box = Box.parse(Box.build(dict( - type=b"pssh", - version=0, - flags=0, - system_ID=PSSH.SystemId.Widevine, - init_data=init_data.SerializeToString() - ))) - - return box - @staticmethod def from_playready_pssh(box: Container) -> Container: """