mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 12:21:35 +00:00
Explain URL copy to users
This commit is contained in:
@@ -28,9 +28,15 @@ from gam.var import GM_Globals, GM_WINDOWS
|
|||||||
from gam import utils
|
from gam import utils
|
||||||
|
|
||||||
|
|
||||||
MESSAGE_CONSOLE_AUTHORIZATION_PROMPT = ('\nGo to the following link in your '
|
MESSAGE_CONSOLE_AUTHORIZATION_PROMPT = '''\nGo to the following link in your browser:
|
||||||
'browser:\n\n\t{url}\n')
|
|
||||||
MESSAGE_CONSOLE_AUTHORIZATION_CODE = 'Enter verification code: '
|
\t{url}
|
||||||
|
|
||||||
|
IMPORTANT: If you get a browser error that the site can't be reached AFTER you
|
||||||
|
click the Allow button, copy the URL from the browser where the error occurred
|
||||||
|
and paste that here instead.
|
||||||
|
'''
|
||||||
|
MESSAGE_CONSOLE_AUTHORIZATION_CODE = 'Enter verification code or browser URL: '
|
||||||
MESSAGE_LOCAL_SERVER_AUTHORIZATION_PROMPT = ('\nYour browser has been opened to'
|
MESSAGE_LOCAL_SERVER_AUTHORIZATION_PROMPT = ('\nYour browser has been opened to'
|
||||||
' visit:\n\n\t{url}\n\nIf your '
|
' visit:\n\n\t{url}\n\nIf your '
|
||||||
'browser is on a different machine'
|
'browser is on a different machine'
|
||||||
@@ -570,7 +576,7 @@ def _wait_for_http_client(d):
|
|||||||
|
|
||||||
def _wait_for_user_input(d):
|
def _wait_for_user_input(d):
|
||||||
sys.stdin = open(0)
|
sys.stdin = open(0)
|
||||||
code = input('enter the code:')
|
code = input(MESSAGE_CONSOLE_AUTHORIZATION_CODE)
|
||||||
d['code'] = code
|
d['code'] = code
|
||||||
|
|
||||||
|
|
||||||
@@ -608,7 +614,7 @@ class _ShortURLFlow(google_auth_oauthlib.flow.InstalledAppFlow):
|
|||||||
sleep(0.1)
|
sleep(0.1)
|
||||||
self.redirect_uri = d['redirect_uri']
|
self.redirect_uri = d['redirect_uri']
|
||||||
d['auth_url'], _ = self.authorization_url(**kwargs)
|
d['auth_url'], _ = self.authorization_url(**kwargs)
|
||||||
print(f"URL is: {d['auth_url']}")
|
print(MESSAGE_CONSOLE_AUTHORIZATION_PROMPT.format(url=d['auth_url']))
|
||||||
user_input.start()
|
user_input.start()
|
||||||
userInput = False
|
userInput = False
|
||||||
while True:
|
while True:
|
||||||
|
|||||||
Reference in New Issue
Block a user