SoundCloud, download or stream file via api

前端 未结 2 623
孤独总比滥情好
孤独总比滥情好 2021-02-11 00:58

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

相关标签:
2条回答
  • 2021-02-11 01:50

    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

    0 讨论(0)
  • 2021-02-11 01:55

    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.

    0 讨论(0)
提交回复
热议问题