我最近开始使用Soundcloud API开发一个简单的应用程序,可以将数据保存在播放列表中。然而,在我看来,并不是所有播放列表中的曲目都会被返回。在
我正在使用以下代码:
import soundcloud, shelve, time
client = soundcloud.Client(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET,
username=E-MAIL,
password=PASSWORD)
playlists = client.get('/users/24196709/playlists', limit=1)
tracknames = []
trackids= []
for pl in playlists:
for track in pl.tracks:
print(track['title'])
tracknames.append(track['title'])
trackids.append(track['id'])
print(tracknames)
在包含13首曲目的播放列表:https://soundcloud.com/michiel-tammeling/sets/icecubes上使用它,但是代码只返回11首。在
任何帮助都将不胜感激。在
不幸的是,这无法解决。关于这个问题的话题已经很多了。问题是playlistapi返回播放列表中的所有曲目,而tracks API只返回不受保护的曲目。既然你已经知道哪两个音轨丢失了,我验证了这一点,当你尝试使用track API时,它们都返回了403。所以这两个音轨在某种程度上是无法使用track API访问的。在
更多背景:
SoundCloud Playlist tracks is empty
和@nickf the tech lead of soundcloud says:
相关问题 更多 >
编程相关推荐