feat(cdm): add remote PlayReady CDM support via pyplayready RemoteCdm

This commit is contained in:
Andy
2026-01-26 01:08:54 -07:00
parent 98d579dc9b
commit 4b1d938b49
2 changed files with 27 additions and 8 deletions

View File

@@ -27,6 +27,7 @@ from construct import ConstError
from pymediainfo import MediaInfo
from pyplayready.cdm import Cdm as PlayReadyCdm
from pyplayready.device import Device as PlayReadyDevice
from pyplayready.remote.remotecdm import RemoteCdm as PlayReadyRemoteCdm
from pywidevine.cdm import Cdm as WidevineCdm
from pywidevine.device import Device
from pywidevine.remotecdm import RemoteCdm
@@ -2425,6 +2426,15 @@ class dl:
# All Custom API CDMs use CustomRemoteCDM
return CustomRemoteCDM(service_name=service, vaults=self.vaults, **cdm_api)
else:
device_type = cdm_api.get("Device Type", cdm_api.get("device_type", ""))
if str(device_type).upper() == "PLAYREADY":
return PlayReadyRemoteCdm(
security_level=cdm_api.get("Security Level", cdm_api.get("security_level", 3000)),
host=cdm_api.get("Host", cdm_api.get("host")),
secret=cdm_api.get("Secret", cdm_api.get("secret")),
device_name=cdm_api.get("Device Name", cdm_api.get("device_name")),
)
else:
return RemoteCdm(
device_type=cdm_api["Device Type"],

View File

@@ -264,6 +264,15 @@ remote_cdm:
host: "https://keyxtractor.decryptlabs.com"
secret: "your_decrypt_labs_api_key_here"
# PyPlayReady RemoteCdm - connects to an unshackle serve instance
- name: "playready_remote"
Device Type: PLAYREADY
System ID: 0
Security Level: 3000 # 2000 for SL2000, 3000 for SL3000
Host: "http://127.0.0.1:8786/playready" # Include /playready path
Secret: "your-api-secret-key"
Device Name: "my_prd_device" # Device name on the serve instance
# Key Vaults store your obtained Content Encryption Keys (CEKs)
# Use 'no_push: true' to prevent a vault from receiving pushed keys
# while still allowing it to provide keys when requested