feat: 🚧 Starting working on Spotify authentification for playlist creation

This commit is contained in:
2024-07-01 00:19:39 +02:00
parent f3d606ee7d
commit 708c8beac6
3 changed files with 59 additions and 4 deletions

View File

@ -23,4 +23,13 @@ def searchSpotify(spotifySearch, limit=10):
def createPlaylist(playlistName):
#TODO: Implement this function
pass
pass
def spotifyLogin():
"""
This function is used to login to spotify to get the user token
:return: user token
"""
credentials = spotipy.oauth2.SpotifyClientCredentials(client_id=os.getenv("client_id"), client_secret=os.getenv("client_secret"))
spotify_token = credentials.get_access_token()
return spotify_token