summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-01-02 20:51:29 -0800
committerFuwn <[email protected]>2023-01-02 20:51:29 -0800
commit2ed4aa7f39b8bb6e730df3db2d6d9b05e1d58e45 (patch)
tree9bf33f1695bab15e00c9163b7e2f2304f4adb172
parentfix(spotify.py): headers (diff)
downloadrubys_song_skipper-2ed4aa7f39b8bb6e730df3db2d6d9b05e1d58e45.tar.xz
rubys_song_skipper-2ed4aa7f39b8bb6e730df3db2d6d9b05e1d58e45.zip
fix(spotify.py): headers
-rw-r--r--rubys_song_skipper/spotify.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/rubys_song_skipper/spotify.py b/rubys_song_skipper/spotify.py
index 05d5b99..f816efd 100644
--- a/rubys_song_skipper/spotify.py
+++ b/rubys_song_skipper/spotify.py
@@ -1,6 +1,7 @@
import utilities
import requests
import urllib
+import base64
CLIENT_ID = "3b278200b722431488a0e70111700211"
CLIENT_SECRET = "0689cf819adb442a9abddce154f58cad"
@@ -15,7 +16,9 @@ def bearer(code):
# "client_secret": CLIENT_SECRET,
# },
headers={
- "Authorization": f"{CLIENT_ID}:{CLIENT_SECRET}",
+ "Authorization": base64.urlsafe_b64encode(
+ f"{CLIENT_ID}:{CLIENT_SECRET}".encode()
+ ).decode(),
"Accept": "application/json",
"Content-Type": "application/x-www-form-urlencoded",
"code": code,