Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/notebooklm/cli/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@

logger = logging.getLogger(__name__)

GOOGLE_ACCOUNTS_URL = "https://accounts.google.com/"
NOTEBOOKLM_URL = "https://notebooklm.google.com/"
NOTEBOOKLM_HOST = "notebooklm.google.com"


def _sync_server_language_to_config() -> None:
"""Fetch server language setting and persist to local config.
Expand Down Expand Up @@ -212,7 +216,7 @@ def login(storage):
)

page = context.pages[0] if context.pages else context.new_page()
page.goto("https://notebooklm.google.com/")
page.goto(NOTEBOOKLM_URL)

console.print("\n[bold green]Instructions:[/bold green]")
console.print("1. Complete the Google login in the browser window")
Expand All @@ -221,8 +225,13 @@ def login(storage):

input("[Press ENTER when logged in] ")

# Force .google.com cookies for regional users (e.g. UK lands on
# .google.co.uk). Use "load" not "networkidle" to avoid analytics hangs.
page.goto(GOOGLE_ACCOUNTS_URL, wait_until="load")
page.goto(NOTEBOOKLM_URL, wait_until="load")

current_url = page.url
if "notebooklm.google.com" not in current_url:
if NOTEBOOKLM_HOST not in current_url:
console.print(f"[yellow]Warning: Current URL is {current_url}[/yellow]")
if not click.confirm("Save authentication anyway?"):
context.close()
Expand Down