SoundCloud API returning 0 tracks despite user having tracks

牧云@^-^@ 提交于 2019-12-28 23:14:33

问题


I'm trying to get the tracks of specific users but for some users, even though they have tracks, the SoundCloud API return an empty list.

For example, the following user has 17 tracks as you can see from his track_count

http://api.soundcloud.com/users/1250904?client_id=XXXXXX

If I try to get his tracks it returns an empty list

http://api.soundcloud.com/users/1250904/tracks?client_id=XXXXXX

Is it possible for users to make their songs not available via API? Is there a field on the user that can distinguish this?


回答1:


This is very interesting. Using a normal CLIENT_ID I generated myself, I get the same results you do. Additionally, if I try to hit the API for information about a specific track, I get a 403 Forbidden error:

HTTP GET https://api.soundcloud.com/tracks/149151252.json?client_id=XXXXXX

There could be a few reasons why this is occurring:

  1. The user has hit their download limit for all of their tracks.
  2. The user has disabled oEmbed, causing the API requests to 403 (see this post).
  3. The user has somehow managed to block normal API access to their tracks.

I'm leaning on choice 3 here. I've done some testing with some other CLIENT_IDs in this question trying the CLIENT_ID used by the youtube-dl application. Using their _IPHONE_CLIENT_ID, I was able to see information for all 17 tracks. If my understanding of that key is correct, it is a master API key used by SoundCloud for their iOS application, which would explain why that key works and others do not.

This user must have some setting enabled to block standard API access to their tracks.



来源:https://stackoverflow.com/questions/33485387/soundcloud-api-returning-0-tracks-despite-user-having-tracks

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