Raise error if no supported drm was found in HLS.get_drm

This commit is contained in:
rlaphoenix 2023-02-21 01:31:52 +00:00
parent c3f2d0d9cc
commit 09989f8b94
1 changed files with 6 additions and 0 deletions

View File

@ -201,6 +201,7 @@ class HLS:
@staticmethod
def get_drm(keys: list[Union[m3u8.model.SessionKey, m3u8.model.Key]]) -> list[DRM_T]:
drm = []
unsupported_systems = []
for key in keys:
if not key:
@ -217,6 +218,11 @@ class HLS:
pssh=PSSH(key.uri.split(",")[-1]),
**key._extra_params # noqa
))
else:
unsupported_systems.append(key.method + (f" ({key.keyformat})" if key.keyformat else ""))
if not drm and unsupported_systems:
raise NotImplementedError(f"No support for any of the key systems: {', '.join(unsupported_systems)}")
return drm