Streaming private tracks from Soundcloud's API

2019-04-14 04:31发布

问题:

So I know there's plenty of SoundCloud documentation on creating custom players -- as well as streaming private sounds with their own player.

But I can't find a definitive answer to:

Can I stream private tracks through my own custom player using the API -- but WITHOUT requiring any SoundCloud login authentication?

--

Or in bullet form, I want to know if i can:

  • stream Soundcloud hosted tracks
  • these tracks must be private and NOT publicly available on SoundCloud
  • the player must be completely of our own design
  • no SoundCloud login is required for anyone to listen to these tracks

--

I realize this would just make SoundCloud into a music hosting service, so just wondering if anyone has done this.

回答1:

in theory, yes, you can do that.

first you'll need to gain access token for the users who has uploaded these private tracks. (this should happen on server side)

after that, you will impersonate every visitor on the site as this default user, and he will have access to the tracks.

but, this is not a good practice. you need to be worried about is that you need to hide this token pretty good, so the visitors can't abuse it.

my suggestion is to create a server code that will do all the job related to access token (getting tracks, getting tracks streams etc), and in client side just show the final results. this way, you'll keep your access token safe.