我正在使用python包'spotipy‘构建一个与spotify web API接口的应用程序。
但是,我会随机得到500个错误,如下所示:
http status: 500, code:-1 - the requested resource could not be found: https://api.spotify.com/v1/users/[USERNAME]/playlists这是我的工作流的样子(减去我的api密钥信息)
client_id = ''
client_secret = ''
redirect_uri = 'http://127.0.0.1:8000/spotify/'
scope = 'playlist-read-private user-read-private playlist-modify-private'
auth = oauth2.SpotifyOAuth(client_id, client_secret, redirect_uri, scope = scope)
def spotify_auth(request):
auth_url = auth.get_authorize_url()
return HttpResponseRedirect(auth_url)用户通过身份验证后,将被重定向至以下视图:
def spotify(request):
token_code = request.GET.get('code')
token = auth.get_access_token(token_code)
sp = spotipy.Spotify(auth=token['access_token'])
user = sp.me()
playlists = sp.user_playlists(user['id'])在这一点上,我会经常(但不总是)得到一个500错误...
发布于 2014-08-20 20:35:35
获取用户播放列表的端点在昨天还有点过时,但今天它似乎运行得很好。我会再试一次。
https://stackoverflow.com/questions/25388122
复制相似问题