SoundCloud, download or stream file via api

…衆ロ難τιáo~ 提交于 2019-12-21 02:50:07

问题


I try to use download_url to get file from soundcloud.

I either get 'redirected' or '401 unauthorized', how can I download/stream it to client side?

thanks


回答1:


If you are getting a 401 response, then you should include your client_id in the request. It might also be that it's a private sound, in which case, you'd also have to include the oauth credentials.

The actual success response is a redirect, since the stream files are accessible from a different server, but only with special time-limited access tokens (included in the redirect response). Basically, just follow the redirect and you'll have your stream.




回答2:


You are using Wrong Url Structure... Try This ,Its Working (I tested) : http://api.soundcloud.com/tracks/773150/download?client_id={Your ID Here}

You Should Use ? Instead Of & before client_id



来源:https://stackoverflow.com/questions/11447819/soundcloud-download-or-stream-file-via-api

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