From a793c965320e574e254296104335c1105006e56f Mon Sep 17 00:00:00 2001 From: sugoidogo Date: Fri, 12 Dec 2025 23:43:03 -0800 Subject: [PATCH] always open browser if login is called and device_code is availible, and print url to output in case webbrowser.open fails --- astrolobot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/astrolobot.py b/astrolobot.py index c62cddb..ef1b872 100755 --- a/astrolobot.py +++ b/astrolobot.py @@ -394,7 +394,11 @@ def login(*args): global device_code if device_code==None: print('astrolobot is still starting, please wait',sys.stderr) - webbrowser.open('https://www.twitch.tv/activate?public=true&device-code='+device_code) + else: + login_url='https://www.twitch.tv/activate?public=true&device-code='+device_code + print("if your browser doesn't automatically open, go to the following url:") + print(login_url) + webbrowser.open(login_url) def save_tokens(access_token,refresh_token): with open(script_path()+'tokens.json','w') as file: