我试图在Python中使用SpotifyAPI中的Spotipy,您可以找到这个here
在我尝试使用start_playback()函数播放一些音乐之前,一切都正常(除了开始部分,我没有做太多)
在文档中,有人说作用域必须是用户读取回放状态,这是,但即使有了这个作用域,这也不起作用
以下是我写的:
scope = 'user-read-playback-state'
token = util.prompt_for_user_token(username,
scope,
client_id=clientID,
client_secret=clientsecret,
redirect_uri="http://google.com/")
# création of spotify object
spotifyObject = spotipy.Spotify(auth=token)
# the url of one of my playlist
iden = "6a0PMD9AsNoK3XD5Nnheig"
# here, I want to play a music of the paylist i've just chosen
spotifyObject.start_playback(context_uri = iden)
# and the problem is here
问题是:https://api.spotify.com/v1/me/player/play: 权限缺失
我不明白为什么,而且我是个新手,所以可能是新手犯了个错误或者别的什么 感谢您未来的帮助:)
我找到了如何“修复”它! 范围必须是:“流媒体” 播放列表的url必须是完整的,因此spotify:playlist:6a0PMD9AsNoK3XD5Nnheig而不是6a0PMD9AsNoK3XD5Nnheig
如果这对别人也有帮助,我会很高兴:)
相关问题 更多 >
编程相关推荐