在python身份验证错误中使用spotipy库



大家好,我正在尝试创建一个函数,其中将使用spotifyAPI和用于python 的spotipy库

即使我在这里和我的spotify仪表板上都设置了相同的uri ,我的重定向uri也有问题

我收到的错误

OSError:[Erno 48]地址已在使用

def create_playlist((:

client_id = '_______'
client_secret = '______'
redirect_uri = 'http://localhost:8888/callback'
username = 'csrupido01'
scope = 'playlist-modify-public'

token = SpotifyOAuth(scope=scope, username=username , client_id= client_id,client_secret =client_secret ,redirect_uri=redirect_uri)
spotifyObject = spotipy.Spotify(auth_manager = token)
playlist = input ("Enter the name of the playlist: ")
desc = input ("Enter a description for the playlist: ")
spotifyObject.user_playlist_create(user=username,name=playlist,public=True,description=desc)
song= input("Enter a song:")
songlist = []
while song != "quit":
search = spotifyObject.search(q=song)

songlist.append(result['track']['item'][0][uri])
song = input ("Enter another song: ")

pplay =spotifyObject.user_playlist(user=username)
lists = pplay ['items'][0]['id']
spotifyObject.user_playlist_add_track (user=username,playlist_id=lists,tracks=songlist)

create_playlist((

错误告诉您要使用的端口已经在使用中。尝试将代码和仪表板中的端口更改为另一个数字,并检查它是否有效。

最新更新