From c0b6b74b097c7ba148b11eb2ff04a9e9c84bd7a7 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Fri, 22 Nov 2024 17:12:30 +0100 Subject: [PATCH] + README update --- README.md | 5 +++++ pyplayready/cdm.py | 3 +++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index d09dc2e..83cc9eb 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,11 @@ pyplayready test DEVICE.prd > [!IMPORTANT] > There currently isn't a proper method of extracting Group Certificates/Keys. They can be found inside older Samsung phones/Smart TVs, Windows DLLs and set-top-boxes in encrypted form. +Export a provisioned device to its raw .dat files +```shell +pyplayready export-device DEVICE.prd +``` + ## Usage An example code snippet: diff --git a/pyplayready/cdm.py b/pyplayready/cdm.py index 9c84418..cd034fc 100644 --- a/pyplayready/cdm.py +++ b/pyplayready/cdm.py @@ -252,6 +252,9 @@ class Cdm: if not session: raise InvalidSession(f"Session identifier {session_id!r} is invalid.") + if not session.encryption_key or not session.signing_key: + raise InvalidSession("Cannot parse a license message without first making a license request") + try: root = ET.fromstring(licence) license_elements = root.findall(".//{http://schemas.microsoft.com/DRM/2007/03/protocols}License")