From 999900278f9f3ab425c0b1527ddaca5fef7d731a Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Sat, 30 Jul 2022 04:31:03 +0100 Subject: [PATCH] Create a Session class --- pywidevine/session.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 pywidevine/session.py diff --git a/pywidevine/session.py b/pywidevine/session.py new file mode 100644 index 0000000..c3373cd --- /dev/null +++ b/pywidevine/session.py @@ -0,0 +1,14 @@ +from typing import Optional + +from Crypto.Random import get_random_bytes + +from pywidevine.key import Key +from pywidevine.license_protocol_pb2 import DrmCertificate + + +class Session: + def __init__(self): + self.id = get_random_bytes(16) + self.service_certificate: Optional[DrmCertificate] = None + self.context: dict[bytes, tuple[bytes, bytes]] = {} + self.keys: list[Key] = []