From dbd77744707100ab96a95d07664a1cec244cd781 Mon Sep 17 00:00:00 2001 From: Nirvana Date: Sat, 30 May 2026 21:38:16 +0200 Subject: [PATCH] joyn deviceinfo --- .../providers/joyn/auth.py | 23 ++++++++++++++++++- .../providers/joyn/constants.py | 1 + 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/streaming_providers/providers/joyn/auth.py b/lib/streaming_providers/providers/joyn/auth.py index 9d1bc3d..65636b8 100644 --- a/lib/streaming_providers/providers/joyn/auth.py +++ b/lib/streaming_providers/providers/joyn/auth.py @@ -481,7 +481,28 @@ class JoynAuthenticator(BaseOAuth2Authenticator): except Exception as e: logger.debug(f"User check failed (non-fatal): {e}") - # Step 1: Initiate PASSWORD verification + # Step 1a: Register device fingerprint — required before PASSWORD initiation + try: + import hashlib + _fingerprint_input = f"{request_id}{self._device_id}{JOYN_USER_AGENT}" + _fingerprint = hashlib.sha256(_fingerprint_input.encode()).hexdigest() + _request( + "POST", + "https://auth.7pass.de/device-srv/deviceinfo", + json={ + "fingerprint": _fingerprint, + "userAgent": "", + }, + content_type="application/json", + headers={ + "Referer": signin_url, + "Origin": "https://signin.7pass.de", + }, + ) + except Exception as e: + logger.debug(f"Device info registration failed (non-fatal): {e}") + + # Step 1b: Initiate PASSWORD verification # Wrapped in try/except so HTTPError from raise_for_status inside the # HTTP manager doesn't bypass our Cloudflare detection. try: diff --git a/lib/streaming_providers/providers/joyn/constants.py b/lib/streaming_providers/providers/joyn/constants.py index 5abb4ca..3dea12c 100644 --- a/lib/streaming_providers/providers/joyn/constants.py +++ b/lib/streaming_providers/providers/joyn/constants.py @@ -28,6 +28,7 @@ JOYN_7PASS_ENDPOINTS = { "REGISTRATION_SETUP": f"{JOYN_7PASS_BASE_URL}/registration-setup-srv/public/list", "VERIFICATION_CONFIGURED": f"{JOYN_7PASS_BASE_URL}/verification-srv/v2/setup/public/configured/list", "VERIFICATION_INITIATE": f"{JOYN_7PASS_BASE_URL}/verification-srv/v2/authenticate/initiate/PASSWORD", # NEW + "DEVICE_INFO": f"{JOYN_7PASS_BASE_URL}/device-srv/deviceinfo", # Required before PASSWORD initiation } # Joyn auth endpoints (non-OIDC)