使用Spotipy并尝试“当前用户最近播放”
token = util.prompt_for_user_token(username, scope = scope, client_id=client_id, client_secret=client_secret, redirect_uri=redirect_uri)
sp = spotipy.Spotify(auth = token)
saved = sp.current_user_saved_tracks()
print(saved)
recent = sp.current_user_recently_played()
print(recent)
SP.CurrntUsSerixSaveDeTrx()运行得很好,SP.CurrntUsSerixReCurtLyPyReD()显然不存在,即使它明显在文档AA>中。
运行-v2.4.4-2017年1月4日
提前谢谢。
Traceback (most recent call last):
File "C:\Users\Martin\Google Drive\Python\Spotify\try_req.py", line 19, in <module>
recent = sp.current_user_recently_played()
AttributeError: 'Spotify' object has no attribute 'current_user_recently_played'
最佳答案
你必须手动获取代码。The installation via pip is outdated.
导航到您安装Spotipy的位置(对我来说是C:\Users\[myName]\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\spotipy
),打开client.py
,用找到的新代码替换代码。