feat(remote): spoof a type-only CDM so server_cdm clients need no local .wvd/.prd

Stand in a SimpleNamespace CDM matching the server's DRM system when server_cdm is active and no local device is loaded, guarded on the resolved _server_cdm. Centralizes cdm_type_stub in cdm.detect, reused by the REST handlers.
This commit is contained in:
imSp4rky
2026-08-31 22:15:47 -06:00
parent 006a7c2ef0
commit 5670f610aa
3 changed files with 15 additions and 8 deletions
+8
View File
@@ -1,8 +1,16 @@
from __future__ import annotations
from types import SimpleNamespace
from typing import Any
def cdm_type_stub(cdm_type: str) -> SimpleNamespace:
"""Type-only CDM stand-in so is_widevine_cdm()/is_playready_cdm() (and thus
get_drm_for_cdm) route correctly without loading a real device. Used for
server_cdm mode, where the server holds the device and returns the keys."""
return SimpleNamespace(is_playready=cdm_type == "playready")
def is_remote_cdm(cdm: Any) -> bool:
"""
Return True if a remote CDM or a service CDM backs the CDM instance.