mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-04 04:41:35 +00:00
short URLs fix back
This commit is contained in:
@@ -217,6 +217,16 @@ def run_flow(flow, storage, flags=None, http=None):
|
|||||||
flow.redirect_uri = oauth_callback
|
flow.redirect_uri = oauth_callback
|
||||||
authorize_url = flow.step1_get_authorize_url()
|
authorize_url = flow.step1_get_authorize_url()
|
||||||
|
|
||||||
|
if flags.short_url:
|
||||||
|
try:
|
||||||
|
from googleapiclient.discovery import build
|
||||||
|
service = build('urlshortener', 'v1', http=http)
|
||||||
|
url_result = service.url().insert(body={'longUrl': authorize_url},
|
||||||
|
key=u'AIzaSyBlmgbii8QfJSYmC9VTMOfqrAt5Vj5wtzE').execute()
|
||||||
|
authorize_url = url_result['id']
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
if not flags.noauth_local_webserver:
|
if not flags.noauth_local_webserver:
|
||||||
import webbrowser
|
import webbrowser
|
||||||
webbrowser.open(authorize_url, new=1, autoraise=True)
|
webbrowser.open(authorize_url, new=1, autoraise=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user