gettoken.py WORKING IN MY GENTOO

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
Marcin Woźniak 2021-01-06 17:20:49 +01:00
parent 90f154f23b
commit ebacbe892d
Signed by: y0rune
GPG Key ID: F204C385F57EB348

View File

@ -6,8 +6,12 @@ from urllib.parse import parse_qs
import sys
import requests as r
no_browser = False
if len(sys.argv) > 1 :
API_ADDRESS = "http://" + sys.argv[1] + ":1285"
if (sys.argv[1] == "no-browser" or sys.argv[2] == "no-browser"):
no_browser = True
else:
API_ADDRESS = "http://localhost:1285"
@ -39,5 +43,6 @@ def wait_for_request(server_class=HTTPServer,
url = 'https://cas.amu.edu.pl/cas/login?service=http://localhost:' + \
str(PORT) + '&locale=pl'
if no_browser == False:
webbrowser.open_new_tab(url)
wait_for_request()