diff --git a/debug_auth.py b/debug_auth.py index 2c1fa7b..1a8374c 100644 --- a/debug_auth.py +++ b/debug_auth.py @@ -23,4 +23,15 @@ print("Calling /api/auth/session (with Chrome TLS impersonation) ...") r = s.get("https://chatgpt.com/api/auth/session", timeout=15) print(f"Status: {r.status_code}") print(f"Content-Type: {r.headers.get('content-type', '(none)')}") -print(f"Response body (first 500 chars):\n{r.text[:500]}") + +try: + data = r.json() + print(f"Top-level keys: {list(data.keys())}") + access_token = data.get("accessToken") + if access_token: + print(f"accessToken: FOUND (length={len(access_token)}, starts with '{access_token[:10]}...')") + else: + print("accessToken: NOT FOUND in response") + print(f"Full response body:\n{r.text}") +except Exception as e: + print(f"Could not parse JSON: {e}\nRaw body:\n{r.text[:500]}")