问题
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