Question

I'm trying to get a grasp on how to reverse engineer the URL's to download streams.

I know there are allready Open Souce tools, that do that, but by copying them i do not get the process of how to do it.

As an Example: I try to get a downloader for soundcloud to work. Im guessing the download url should be something like api.soundcloud.com/track/... . Somewhere inbetween there surely are the track_id and client_id which can be excracted from the source of the page. But i can't seem to get further than that right now.

Was it helpful?

Solution

Before I answer my own post, i want to state, that downloading Streams from Soundcloud is illegal and hurts the artists. Also playing the stream outside of Soundcloud is only allowed under their terms, so please check those first.

So to grab the Stream Link i first looked into the Soundcloud Python Library. There i found, that i can just question the API with api.soundcloud.com/resolve?url=<URL of the desired Song Page>&client_id=<client_id>.

The Client id has to be sent with each api request. Searching trough the code its really easy to find a client_id. It seems to be static for unregistered users at least and further searching for it suggested, that it is that way for at least a year.

After you call the resolve URL above you get an XML document with properties of the Song/Stream. There you will find the Stream URL. You can just make a normal HTTP Request for that Stream URL. (Don't forget to append the client_id). If for some reasons the link doesn't work properly, try disabling your 302 HTTP redirections.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top