diff --git a/pyplayready/exceptions.py b/pyplayready/exceptions.py index 244aedf..18032a0 100644 --- a/pyplayready/exceptions.py +++ b/pyplayready/exceptions.py @@ -10,5 +10,9 @@ class InvalidSession(PyPlayredyException): """No Session is open with the specified identifier.""" +class InvalidInitData(PyPlayredyException): + """The Playready Cenc Header Data is invalid or empty.""" + + class DeviceMismatch(PyPlayredyException): """The Remote CDMs Device information and the APIs Device information did not match.""" \ No newline at end of file diff --git a/pyplayready/remotecdm.py b/pyplayready/remotecdm.py index d38989a..251a3ee 100644 --- a/pyplayready/remotecdm.py +++ b/pyplayready/remotecdm.py @@ -11,7 +11,7 @@ from pyplayready.bcert import CertificateChain from pyplayready.ecc_key import ECCKey from pyplayready.pssh import PSSH -from pyplayready.exceptions import (DeviceMismatch, ) +from pyplayready.exceptions import (DeviceMismatch, InvalidInitData) class RemoteCdm(Cdm): @@ -104,7 +104,7 @@ class RemoteCdm(Cdm): if not pssh: raise InvalidInitData("A pssh must be provided.") if not isinstance(pssh, str): - raise InvalidInitData(f"Expected pssh to be a {PSSH}, not {pssh!r}") + raise InvalidInitData(f"Expected pssh to be a {str}, not {pssh!r}") r = self.__session.post( url=f"{self.host}/{self.device_name}/get_license_challenge",