from imgurpython import ImgurClient
client_id = 'id here'
client_secret = 'secret here'
client_pin = None
#client_pin = 'abcdefghjk'
client = ImgurClient(client_id, client_secret)
if client_pin:
credentials = client.authorize(client_pin, 'pin')
print (credentials['access_token'])
print (credentials['refresh_token'])
client.set_user_auth(credentials['access_token'], credentials['refresh_token'])
else:
# Authorization flow, pin example (see docs for other auth types)
authorization_url = client.get_auth_url('pin')
print(authorization_url)
# ... redirect user to `authorization_url`, obtain pin (or code or token) ...
Comments
0 B
|👍
/👎