forked from kenzuya/unshackle
feat(remote): license with the client's device when the user picked one
A remote client that passes --cdm, has a cdm entry for the service that named the loaded device, or sets server_cdm: false now declines the server CDM at session create, and warns when the server keeps it. A service option listed in SERVER_DEVICE_OPTIONS keeps the server CDM.
This commit is contained in:
@@ -70,6 +70,17 @@ def resolve_cdm_name(cdm: dict, service: str, override: Any = None) -> Any:
|
||||
return override or ci_get(cdm, service) or ci_get(cdm, "default")
|
||||
|
||||
|
||||
def cdm_entry_names_device(entry: Any, profile: Optional[str] = None) -> bool:
|
||||
"""Whether a per-service ``cdm`` entry names a device when no quality is known.
|
||||
|
||||
An entry that selects only by quality, or by a different profile, names none.
|
||||
"""
|
||||
if not isinstance(entry, dict):
|
||||
return bool(entry)
|
||||
systems = {"widevine", "playready"} & {str(key).lower() for key in entry}
|
||||
return bool(systems or entry.get(profile) or entry.get("default"))
|
||||
|
||||
|
||||
class Config:
|
||||
class _Directories:
|
||||
# default directories, do not modify here, set via config
|
||||
|
||||
Reference in New Issue
Block a user