获取歌曲曲目ID/名称的包
trackRetriever的Python项目详细描述
追踪检索器
使人们更容易使用Spotify播放列表中的曲目
先决条件
我假设你已经做了一个Spotify项目,如果没有,你可以这样做here
You'll need your: username, client_id, client_secret, redirect_uri and userId
安装
pip install trackRetriever
功能
我制作了getplaylistid和get playlist曲目作为gettrack的助手,但非常欢迎您使用它们
getTracks(username, client_id, client_secret,redirect_uri,getNames = False)
All the parameters should be input as string except getNames
When getNames is set to True getTracks will return a list of the names of the tracks in your playlists
When getNames is set to False getTracks will return a list of the track id's of the tracks in your playlists
getPlaylistIds(playlists)
This will get the playlist id's of your playlists
playlists = sp.user_playlists(userId) *userId is not your username*
get_playlist_tracks(userId, playlist_id,sp)
sp is the spotify object created by spotipy.Spotify(auth=token)
playlist_id is the id of the playlist you want to retrieve the tracks for