From fe5dac7b6a274edd4c938893f0ccc1f9ed6497d9 Mon Sep 17 00:00:00 2001 From: Nirvana Date: Mon, 4 May 2026 16:12:23 +0200 Subject: [PATCH] Fix discovery login --- lib/streaming_providers/providers/discovery/auth.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/streaming_providers/providers/discovery/auth.py b/lib/streaming_providers/providers/discovery/auth.py index bb2e563..3c282ac 100644 --- a/lib/streaming_providers/providers/discovery/auth.py +++ b/lib/streaming_providers/providers/discovery/auth.py @@ -597,14 +597,17 @@ class DiscoveryAuthenticator(BaseAuthenticator): bearer_token: Anonymous access token from /token """ try: + # Use _build_authenticated_headers to get all required headers + # We need a token object for _build_authenticated_headers + temp_token = DiscoveryAuthToken(access_token=bearer_token) + headers = self._build_authenticated_headers(temp_token) + # Remove Content-Type as feature flags expects it but we're sending JSON + headers["Content-Type"] = "application/json" + response = self.http_manager.post( DISCOVERY_FEATURE_FLAGS_URL, operation="auth", - headers={ - "User-Agent": get_user_agent(self.platform_os), - "Content-Type": "application/json", - "Authorization": f"Bearer {bearer_token}", - }, + headers=headers, json_data=DISCOVERY_FEATURE_FLAGS_PAYLOAD, ) response.raise_for_status()