Python Spotipy 缺少 headers 的权限

Python Spotipy missing permission for headers

我正在尝试使用 Spotipy,Spotify API 之一,在 Python,你可以找到这个 here

在我尝试使用 start_playback() 函数播放一些音乐之前,一切正常(除了开始部分我没有做太多)。

在文档中,据说范围必须是 user-read-playback-state,但即使使用这个范围,这也不起作用。

这是我写的:

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: 缺少权限

我不明白为什么,而且我很新,所以可能是新手的错误或其他原因 感谢您以后的帮助:)

我找到了 'repair' 的方法! 范围必须是:'streaming' 并且播放列表的 url 必须是完整的,所以 spotify:playlist:6a0PMD9AsNoK3XD5Nnheig 而不是 6a0PMD9AsNoK3XD5Nnheig

如果对某人也有帮助,我会很高兴:)