diff --git a/lib/streaming_providers/providers/rtlplus/constants.py b/lib/streaming_providers/providers/rtlplus/constants.py index 1edf695..8cef4ab 100644 --- a/lib/streaming_providers/providers/rtlplus/constants.py +++ b/lib/streaming_providers/providers/rtlplus/constants.py @@ -182,6 +182,18 @@ class RTLPlusHeaders: "Referer": RTLPlusDefaults.BASE_WEBSITE, } + @staticmethod + def get_event_manifest_headers(access_token: str, user_agent: str = None) -> dict: + """Get headers for the event manifest endpoint (stus.player.streamingtech.de/liveevent). + Uses X-Auth-Token scheme as required by this endpoint.""" + return { + "X-Auth-Token": access_token, + "Content-Type": "application/json", + "Origin": RTLPlusDefaults.BASE_WEBSITE.rstrip("/"), + "Referer": RTLPlusDefaults.BASE_WEBSITE, + "User-Agent": user_agent or RTLPlusDefaults.USER_AGENT, + } + @staticmethod def get_playready_drm_headers(access_token: str, device_id: str = None) -> dict: """Get headers for PlayReady DRM license acquisition (SOAP/XML)""" @@ -272,6 +284,13 @@ class RTLPlusConfig: user_agent=self.user_agent, ) + def get_event_manifest_headers(self, access_token: str) -> dict: + """Get event manifest headers with this config's settings.""" + return RTLPlusHeaders.get_event_manifest_headers( + access_token=access_token, + user_agent=self.user_agent, + ) + def get_playready_drm_headers(self, access_token: str) -> dict: """Get PlayReady-specific DRM headers (Edge UA, SOAP content-type)""" return RTLPlusHeaders.get_playready_drm_headers( diff --git a/lib/streaming_providers/providers/rtlplus/provider.py b/lib/streaming_providers/providers/rtlplus/provider.py index 159cb3a..f8dabc0 100644 --- a/lib/streaming_providers/providers/rtlplus/provider.py +++ b/lib/streaming_providers/providers/rtlplus/provider.py @@ -99,6 +99,10 @@ class RTLPlusProvider(StreamingProvider): bearer_token = self.authenticator.get_bearer_token(force_upgrade=True) return self.rtl_config.get_api_headers(access_token=bearer_token) + def _get_event_manifest_headers(self) -> Dict[str, str]: + access_token = self.authenticator.get_bearer_token() + return self.rtl_config.get_event_manifest_headers(access_token=access_token) + def get_channels(self, **kwargs) -> List[StreamingChannel]: """ Fetch channels from RTL+ GraphQL API with authentication @@ -337,8 +341,7 @@ class RTLPlusProvider(StreamingProvider): logger.debug(f"RTL+ Manifest Request: GET {manifest_url}") if ":live-events:" in content_id: - access_token = self.authenticator.get_bearer_token() - headers = self.rtl_config.get_api_headers(access_token=access_token) + headers = self._get_event_manifest_headers() else: headers = self.rtl_config.get_base_headers()