From e3a72c8c90e0e8835d3eb38fbb0cec70b04f86c2 Mon Sep 17 00:00:00 2001 From: Nirvana Date: Sun, 7 Jun 2026 13:14:11 +0200 Subject: [PATCH] fix for new software drm --- routes/streams.py | 1 + service.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/routes/streams.py b/routes/streams.py index d697ac5..8eb55a8 100644 --- a/routes/streams.py +++ b/routes/streams.py @@ -392,6 +392,7 @@ def setup_stream_routes(app, manager, service): return service.get_decrypted_manifest( provider, content_id, keyids, receiver_side=True, + drm_variant=drm_variant, ) else: return service.get_proxied_manifest(provider, content_id) diff --git a/service.py b/service.py index 84309fc..2b67113 100644 --- a/service.py +++ b/service.py @@ -395,7 +395,8 @@ class UltimateService: def get_decrypted_manifest( self, provider: str, channel_id: str, keyids: dict, - highest_quality_only: bool = False, receiver_side: bool = False + highest_quality_only: bool = False, receiver_side: bool = False, + drm_variant: str = "auto", ) -> str: """ Get rewritten MPD manifest for decrypted playback via media proxy. @@ -407,6 +408,9 @@ class UltimateService: keyids: Dictionary of kid:key pairs highest_quality_only: If True, keep only highest quality video representation receiver_side: If True, inject ClearKey signaling for receiver-side decryption + drm_variant: 'auto' (provider default) or 'software' (prefer ClearKey manifest). + Must match the variant used in the original _resolve_stream call so + the second manifest fetch selects the same stream as the first. Returns: Rewritten MPD content as string @@ -416,11 +420,13 @@ class UltimateService: # Note: We don't cache decrypted manifests as they contain keys logger.info( f"Generating {'receiver-side clearkey' if receiver_side else 'decrypted'} manifest " - f"for {provider}/{channel_id} (highest_quality_only={highest_quality_only})" + f"for {provider}/{channel_id} (highest_quality_only={highest_quality_only}, " + f"drm_variant={drm_variant})" ) manifest_url = self.manager.get_channel_manifest( - provider_name=provider, channel_id=channel_id, country=country + provider_name=provider, channel_id=channel_id, country=country, + drm_variant=drm_variant, ) if not manifest_url: response.status = 404