mirror of
https://github.com/Amor-Aprca/WPGSKD.git
synced 2026-10-12 12:02:20 +02:00
Update loader.py
This commit is contained in:
@@ -12,10 +12,15 @@ from wpgskd.core.cdm.detect import detect_cdm_type
|
||||
log = logging.getLogger("CDMLoader")
|
||||
|
||||
class CdmProvider:
|
||||
def __init__(self, cdm_name: str, device_dir: Path, cdm_api_config: Optional[Dict[str, Any]] = None):
|
||||
def __init__(self, cdm_name: str, device_dir: Path, cdm_api_config: Optional[Any] = None):
|
||||
self.cdm_name = cdm_name
|
||||
self.device_dir = device_dir
|
||||
self.cdm_api_config = cdm_api_config or {}
|
||||
|
||||
if isinstance(cdm_api_config, list):
|
||||
self.cdm_api_config = {item.get('name'): item for item in cdm_api_config if isinstance(item, dict) and item.get('name')}
|
||||
else:
|
||||
self.cdm_api_config = cdm_api_config or {}
|
||||
|
||||
self._cdm_instance: Optional[BaseCdm] = None
|
||||
|
||||
@property
|
||||
@@ -258,4 +263,4 @@ class PlayReadyCdmAdapter(BaseCdm):
|
||||
kid = k.key_id.hex if hasattr(k.key_id, 'hex') else str(k.key_id).replace("-", "")
|
||||
key = k.key.hex() if isinstance(k.key, bytes) else str(k.key)
|
||||
result.append({"kid": kid, "key": key, "type": "CONTENT"})
|
||||
return result
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user