diff --git a/pyplayready/cdm.py b/pyplayready/cdm.py index 2096c89..9c84418 100644 --- a/pyplayready/cdm.py +++ b/pyplayready/cdm.py @@ -123,7 +123,7 @@ class Cdm: def _build_digest_content( self, - content_header: str, + wrm_header: str, nonce: str, wmrm_cipher: str, cert_cipher: str @@ -131,7 +131,7 @@ class Cdm: return ( '' f'{self.protocol_version}' - f'{content_header}' + f'{wrm_header}' '' f'{self.client_version}' '' @@ -170,7 +170,7 @@ class Cdm: '' ) - def get_license_challenge(self, session_id: bytes, content_header: str) -> str: + def get_license_challenge(self, session_id: bytes, wrm_header: str) -> str: session = self.__sessions.get(session_id) if not session: raise InvalidSession(f"Session identifier {session_id!r} is invalid.") @@ -179,7 +179,7 @@ class Cdm: session.encryption_key = self.encryption_key la_content = self._build_digest_content( - content_header=content_header, + wrm_header=wrm_header, nonce=base64.b64encode(get_random_bytes(16)).decode(), wmrm_cipher=base64.b64encode(self._get_key_data(session)).decode(), cert_cipher=base64.b64encode(self._get_cipher_data(session)).decode() diff --git a/pyplayready/serve.py b/pyplayready/serve.py index 6582f2f..e40a4d1 100644 --- a/pyplayready/serve.py +++ b/pyplayready/serve.py @@ -138,7 +138,7 @@ async def get_license_challenge(request: web.Request) -> web.Response: try: license_request = cdm.get_license_challenge( session_id=session_id, - content_header=init_data, + wrm_header=init_data, ) except InvalidSession: return web.json_response({