【发布时间】:2017-03-06 08:31:39
【问题描述】:
根据https://developers.soundcloud.com/docs/api/reference#tracks 的 SoundCloud API 文档,我开始在我的一个项目中编写 SoundCloud API 的实现。我尝试使用以下代码获取 50 首特定类型的曲目,最小长度为 120000 毫秒:
def get_starttracks(genres="Rock"):
return client.get("/tracks", genres=genres, duration={
'from': 120000
}, limit='50')
SoundCloud 以有效的曲目列表进行响应,但它们的持续时间与给定的过滤器不匹配。
例子:
print(get_starttracks(genres="Pop")[0].fields()['duration'])
> 30000
API 是否忽略了“持续时间”参数,或者我的代码内部的过滤器是否有错误?
Ps.:如果错误不在 python 代码中,可能与soundcloud search api ignoring duration filter? 有关。
【问题讨论】:
标签: python api dictionary soundcloud