mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-28 18:01:36 +00:00
200 or bust for URL shorten
This commit is contained in:
@@ -7613,9 +7613,11 @@ class ShortURLFlow(google_auth_oauthlib.flow.InstalledAppFlow):
|
||||
url_shortnr = 'https://gam-shortn.appspot.com/create'
|
||||
headers = {'Content-Type': 'application/json'}
|
||||
try:
|
||||
_, content = simplehttp.request(url_shortnr, 'POST', '{"long_url": "%s"}' % long_url, headers=headers)
|
||||
resp, content = simplehttp.request(url_shortnr, 'POST', '{"long_url": "%s"}' % long_url, headers=headers)
|
||||
except:
|
||||
return long_url, state
|
||||
if resp.status != 200:
|
||||
return long_url, state
|
||||
return json.loads(content).get('short_url', ''), state
|
||||
|
||||
def _run_oauth_flow(client_id, client_secret, scopes, access_type, login_hint=None):
|
||||
|
||||
Reference in New Issue
Block a user