在过去的几天里,我一直在为Spotify Web API使用优秀的Spotipy python库。然而,在浏览了访问基本信息(曲目/艺术家/专辑名称、urls、uris等)的方式之后,我现在正在尝试寻找一些更深层次的曲目特性(BPM、tempo等)。
我知道Spotify将这些信息公之于众,因为some enterprising services已经将这些整合到了他们的产品中。我的问题是,有没有办法通过spotipy.Spotify()对象访问这种类型的信息,或者在最新的spotipy发行版(v2.3.8)中根本不能实现?
任何帮助都将不胜感激!
发布于 2016-08-08 16:30:28
该链接不是企业服务,它是Spotify Web API的Echo嵌套部分的示例的一部分。
https://developer.spotify.com/web-api/code-examples/#echo-nest-example-apps https://github.com/plamere/SortYourMusic
可能令人困惑的是,这些属性在track对象上不可用,但您需要调用一个名为audio_features的新方法。
https://developer.spotify.com/web-api/get-several-audio-features/ http://spotipy.readthedocs.io/en/latest/#spotipy.client.Spotify.audio_features
这对我很有效:
import spotipy
import spotipy.oauth2
credentials = spotipy.oauth2.SpotifyClientCredentials()
spotify = spotipy.Spotify(client_credentials_manager=credentials)
print spotify.audio_features(['4uLU6hMCjMI75M1A2tKUQC'])https://stackoverflow.com/questions/38823403
复制相似问题