Genres and types filters not working in Soundcloud API?

本秂侑毒 提交于 2020-01-01 07:23:07

问题


This link does not return tracks from the rock genre as described in this post: Using the genres filter on Soundcloud API

Is this something that recently broke?

I'm using the Python SDK and have tried various calls to get the filter to work, and currently I can only get the created_at filter to be respected. Here is the python code:

track_page=client.get('/tracks', 
            created_at={'from':'2013-01-01 00:00:00','to':'2013-01-07 00:00:00'}, 
            genre='house',
            types=['recording','remix','original'],
            limit=limit_size,
            offset=offset)

The relevant documentation is here


回答1:


i just found a solution, add q='*' in your query. it will return correct results for the genre.

but i'm not sure about created_at[from/to] and duration[from/to]




回答2:


They haven't blogged about this change, but given that they're responding with 400 Client Error and the message "'q' parameter is required", it looks like you MUST supply a query now. (This is a new error that wasn't there a few days ago AFAIK).

I just tried passing an empty q parameter with a genre filter and it seemed to return appropriately filtered results.




回答3:


Your sample code shows that you're passing a genre parameter instead of the plural genres parameter. Make sure your actual code uses the plural — Soundcloud's API silently ignores the singular, as I learned the hard way last week.



来源:https://stackoverflow.com/questions/17735941/genres-and-types-filters-not-working-in-soundcloud-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!