Skip to content

Commit ed87c87

Browse files
committed
refactor(auth): extract login URLs into constants
1 parent b96a4a8 commit ed87c87

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/notebooklm/cli/session.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343

4444
logger = logging.getLogger(__name__)
4545

46+
GOOGLE_ACCOUNTS_URL = "https://accounts.google.com/"
47+
NOTEBOOKLM_URL = "https://notebooklm.google.com/"
48+
NOTEBOOKLM_HOST = "notebooklm.google.com"
49+
4650

4751
def _sync_server_language_to_config() -> None:
4852
"""Fetch server language setting and persist to local config.
@@ -212,7 +216,7 @@ def login(storage):
212216
)
213217

214218
page = context.pages[0] if context.pages else context.new_page()
215-
page.goto("https://notebooklm.google.com/")
219+
page.goto(NOTEBOOKLM_URL)
216220

217221
console.print("\n[bold green]Instructions:[/bold green]")
218222
console.print("1. Complete the Google login in the browser window")
@@ -223,11 +227,11 @@ def login(storage):
223227

224228
# Force .google.com cookies for regional users (e.g. UK lands on
225229
# .google.co.uk). Use "load" not "networkidle" to avoid analytics hangs.
226-
page.goto("https://accounts.google.com/", wait_until="load")
227-
page.goto("https://notebooklm.google.com/", wait_until="load")
230+
page.goto(GOOGLE_ACCOUNTS_URL, wait_until="load")
231+
page.goto(NOTEBOOKLM_URL, wait_until="load")
228232

229233
current_url = page.url
230-
if "notebooklm.google.com" not in current_url:
234+
if NOTEBOOKLM_HOST not in current_url:
231235
console.print(f"[yellow]Warning: Current URL is {current_url}[/yellow]")
232236
if not click.confirm("Save authentication anyway?"):
233237
context.close()

0 commit comments

Comments
 (0)