Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python SpotifyWebAPI经常出现500个错误_Python_Django_Spotify_Python Requests - Fatal编程技术网

Python SpotifyWebAPI经常出现500个错误

Python SpotifyWebAPI经常出现500个错误,python,django,spotify,python-requests,Python,Django,Spotify,Python Requests,我正在使用python包“spotipy”构建一个与SpotifyWebAPI接口的应用程序 但是,我会随机得到500个错误,如下所示: http status: 500, code:-1 - the requested resource could not be found: https://api.spotify.com/v1/users/[USERNAME]/playlists 以下是我的工作流程(减去api密钥信息) 用户通过身份验证后,会将其重定向到以下视图: def spotify

我正在使用python包“spotipy”构建一个与SpotifyWebAPI接口的应用程序

但是,我会随机得到500个错误,如下所示:

http status: 500, code:-1 - the requested resource could not be found: https://api.spotify.com/v1/users/[USERNAME]/playlists
以下是我的工作流程(减去api密钥信息)

用户通过身份验证后,会将其重定向到以下视图:

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个错误。

获取用户播放列表的端点昨天有点问题,但今天似乎工作正常。我会再试一次

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'])