SoundCloud,无法通过查询对特定用户的曲目进行过滤 [英] SoundCloud, filtering by query on the tracks of a specific user doesn't work

查看:157
本文介绍了SoundCloud,无法通过查询对特定用户的曲目进行过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用soundcloud api获取与我输入的查询相匹配的特定用户的曲目

I'm trying to use the soundcloud api to get the tracks of a specific user that's matching the query i am inputting

这是一个无需查询的示例,效果很好,可以获取该用户的所有曲目 http://api.soundcloud.com/users/4493849/tracks.json ?client_id = YOUR_CLIENT_ID

here's an example without querying, works fine, gets all tracks for that user http://api.soundcloud.com/users/4493849/tracks.json?client_id=YOUR_CLIENT_ID

工作正常,并为我找到了该用户的5条音轨

works fine and gets me the 5 tracks for that user

现在我只需要获取名为测试音频"的曲目即可.所以我做如下 http://api.soundcloud.com/users/4493849 /tracks.json?client_id=YOUR_CLIENT_ID&q=Test

now I need to only get the track called "Test Audio". so I do as follows http://api.soundcloud.com/users/4493849/tracks.json?client_id=YOUR_CLIENT_ID&q=Test

现在的问题是,当我放q =时,它只是带给我与Test相匹配的整个音云中的所有音轨,即,它向所有音云查询了该用户的5条音轨,而不是我想要的

now the problem is, when I put the q= , it simply brings me all tracks in the whole of soundcloud which match Test, i.e. it queries all soundcloud not the 5 tracks for that user as I want to

请帮助

推荐答案

SoundCloud的API不适用于用户子资源和搜索查询.

The SoundCloud's API doesn't work with user sub-resources and search query.

因此,执行此操作的最佳方法是加载所有轨道(如果用户有很多轨道,则使用offset参数批量加载)所有轨道,然后在搜索结果中进行编码.

So, the best way to do this is to load all tracks (batch load with offset parameter, if user has lots of tracks) all tracks and then code your search in the results.

这是我启动我的应用程序时也需要的第一个功能,但是仅使用自己的API便无法做到这一点.

This was the first feature that i needed too when i started my app, but there is no way to do this only with thiers API.

这篇关于SoundCloud,无法通过查询对特定用户的曲目进行过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆