refactor(drm): resolve content keys in one licence path behind ServerKeySource

Drop null keys from every licence, server and export source, not only Widevine. dl now finds remote sessions and imports through ServerKeySource instead of private fields.
This commit is contained in:
imSp4rky
2026-11-02 21:13:23 -07:00
parent d8a4950b99
commit c4677341c8
15 changed files with 463 additions and 491 deletions
+23
View File
@@ -0,0 +1,23 @@
from types import SimpleNamespace
from typing import Any, Iterable, Optional
from uuid import UUID
from unshackle.core.remote_service import RemoteService, ServerVault
def remote_keys(
server_cdm: Optional[bool] = True,
server_cdm_type: str = "widevine",
client_licensed: Iterable[str] = (),
local_cdm: Any = None,
server_vault_keys: Optional[dict[UUID, str]] = None,
) -> RemoteService:
"""A RemoteService with only the state dl reads through ServerKeySource, and no server."""
svc = RemoteService.__new__(RemoteService)
svc._server_cdm = server_cdm
svc.server_cdm_type = server_cdm_type
svc.client_licensed = set(client_licensed)
svc.server_vault_keys = dict(server_vault_keys or {})
svc.server_vault = ServerVault(svc)
svc.ctx = SimpleNamespace(obj=SimpleNamespace(cdm=local_cdm))
return svc