diff --git a/src/notebooklm/cli/session.py b/src/notebooklm/cli/session.py index 7a917830..1c360987 100644 --- a/src/notebooklm/cli/session.py +++ b/src/notebooklm/cli/session.py @@ -221,6 +221,20 @@ def login(storage): input("[Press ENTER when logged in] ") + # Navigate to accounts.google.com to ensure .google.com cookies are set + # (fixes UK/regional users whose cookies land on .google.co.uk) + # See: https://github.com/teng-lin/notebooklm-py/issues/146 + try: + urls_to_visit = [ + "https://accounts.google.com/", + "https://myaccount.google.com/", + "https://notebooklm.google.com/", + ] + for url in urls_to_visit: + page.goto(url, wait_until="networkidle", timeout=10000) + except Exception as e: + logger.debug(f"Cross-domain cookie navigation failed: {e}") + current_url = page.url if "notebooklm.google.com" not in current_url: console.print(f"[yellow]Warning: Current URL is {current_url}[/yellow]")