File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 4343
4444logger = 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
4751def _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" )
@@ -221,8 +225,13 @@ def login(storage):
221225
222226 input ("[Press ENTER when logged in] " )
223227
228+ # Force .google.com cookies for regional users (e.g. UK lands on
229+ # .google.co.uk). Use "load" not "networkidle" to avoid analytics hangs.
230+ page .goto (GOOGLE_ACCOUNTS_URL , wait_until = "load" )
231+ page .goto (NOTEBOOKLM_URL , wait_until = "load" )
232+
224233 current_url = page .url
225- if "notebooklm.google.com" not in current_url :
234+ if NOTEBOOKLM_HOST not in current_url :
226235 console .print (f"[yellow]Warning: Current URL is { current_url } [/yellow]" )
227236 if not click .confirm ("Save authentication anyway?" ):
228237 context .close ()
You can’t perform that action at this time.
0 commit comments