|
@ -25,6 +25,9 @@ def token_get_by_code(): |
|
|
code = input('Enter code: ') |
|
|
code = input('Enter code: ') |
|
|
|
|
|
|
|
|
auth = '%s:%s' % (client_id, client_secret) |
|
|
auth = '%s:%s' % (client_id, client_secret) |
|
|
|
|
|
if hasattr(base64, 'encodebytes'): |
|
|
|
|
|
auth_base64 = base64.encodebytes(auth.encode('utf-8')).decode('utf-8') |
|
|
|
|
|
else: |
|
|
auth_base64 = base64.encodestring(auth.encode()).decode("utf-8") |
|
|
auth_base64 = base64.encodestring(auth.encode()).decode("utf-8") |
|
|
headers = { |
|
|
headers = { |
|
|
"Authorization": "Basic %s" % auth_base64.replace('\n', '').strip() |
|
|
"Authorization": "Basic %s" % auth_base64.replace('\n', '').strip() |
|
|