Skip to content

Instantly share code, notes, and snippets.

@kaivalyapowale
Created January 19, 2020 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaivalyapowale/0627a2cd07327107197232d8eb55540b to your computer and use it in GitHub Desktop.
Save kaivalyapowale/0627a2cd07327107197232d8eb55540b to your computer and use it in GitHub Desktop.
Function for base64 encoding of the Spotify Client IDs
# Defining base64 encoding of the IDs
def base64_encode(client_id,client_secret):
encodedData = base64.b64encode(bytes(f"{client_id}:{client_secret}", "ISO-8859-1")).decode("ascii")
authorization_header_string = f"{encodedData}"
return(authorization_header_string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment