Skip to content
Merged
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions src/notebooklm/cli/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ 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("https://accounts.google.com/", wait_until="load")
page.goto("https://notebooklm.google.com/", wait_until="load")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and avoid magic strings, consider defining these URLs as constants at the module level. This would also allow reusing the NOTEBOOKLM_URL constant, as "https://notebooklm.google.com/" is hardcoded elsewhere in this file (e.g., line 215).

For example, you could add at the top of the file:
ACCOUNTS_GOOGLE_URL = "https://accounts.google.com/"
NOTEBOOKLM_URL = "https://notebooklm.google.com/"
And then use page.goto(ACCOUNTS_GOOGLE_URL, ...) and page.goto(NOTEBOOKLM_URL, ...) here.


current_url = page.url
if "notebooklm.google.com" not in current_url:
console.print(f"[yellow]Warning: Current URL is {current_url}[/yellow]")
Expand Down