使用 Spotipy 并尝试“current_user_recently_played”
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.current_user_saved_tracks() 运行得很好, sp.current_user_recently_played() 显然不存在,即使它在文档中明确显示https://spotipy.readthedocs.io/en/latest/#more-examples。
正在运行 - 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'