There is a property "streamable" of a track which is if "false", I'm unable to get stream_url of that track.
But I see there are few downloaders which gets stream_url of the very same song & then gets then cdn link of that track.
I even did authenticate my app but no luck finding the stream_url. Here is what I did.
import soundcloud
# create client object with app credentials
client = soundcloud.Client(client_id='YOUR_CLIENT_ID',
client_secret='YOUR_CLIENT_SECRET',
redirect_uri='REDIRECT_URL')
# exchange authorization code for access token
code = params['code']
access_token = client.exchange_token(code)
#'YOUR_ACCESS_TOKEN' is access_token which I got in above step.
client = soundcloud.Client(access_token='YOUR_ACCESS_TOKEN')
track = client.get('/tracks/161730338')
Below is the track object
>track.__dict__
{'obj': {u'attachments_uri': u'https://api.soundcloud.com/tracks/161730338/attachments', u'video_url': None, u'track_type': None, u'release_month': None, u'original_format': u'wav', u'label_name': None, u'duration': 198443, u'id': 161730338, u'streamable': False, u'user_id': 14090772, u'user_favorite': False, u'title': u'Jessie J + Ariana Grande + Nicki Minaj - Bang Bang', u'favoritings_count': 94563, u'commentable': True, u'label_id': None, u'state': u'finished', u'downloadable': False, u'policy': u'ALLOW', u'waveform_url': u'https://w1.sndcdn.com/EDiPRlpWkJ2V_m.png', u'sharing': u'public', u'description': u'', u'release_day': None, u'purchase_url': None, u'permalink': u'jessie-j-ariana-grande-nicki-minaj-bang-bang', u'comment_count': 957, u'purchase_title': None, u'last_modified': u'2015/03/25 04:05:16 +0000', u'user': {u'username': u'RepublicRecords', u'permalink': u'universalrepublic', u'avatar_url': u'https://i1.sndcdn.com/avatars-000025014448-peqymq-large.jpg', u'kind': u'user', u'uri': u'https://api.soundcloud.com/users/14090772', u'last_modified': u'2014/11/10 20:57:55 +0000', u'permalink_url': u'http://soundcloud.com/universalrepublic', u'id': 14090772}, u'genre': u'playbook', u'isrc': None, u'download_count': 0, u'permalink_url': u'http://soundcloud.com/universalrepublic/jessie-j-ariana-grande-nicki-minaj-bang-bang', u'playback_count': 4883398, u'kind': u'track', u'release_year': None, u'license': u'all-rights-reserved', u'artwork_url': None, u'created_at': u'2014/08/05 00:19:41 +0000', u'bpm': None, u'uri': u'https://api.soundcloud.com/tracks/161730338', u'original_content_size': 34992416, u'key_signature': None, u'user_playback_count': 1, u'release': None, u'tag_list': u'', u'embeddable_by': u'all'}, 'encoding': 'utf-8', 'url': u'https://api.soundcloud.com/tracks/161730338.json?oauth_token=1-124233-146384181-db7bf19453bd8', 'raw_data': u'{"kind":"track","id":161730338,"created_at":"2014/08/05 00:19:41 +0000","user_id":14090772,"duration":198443,"commentable":true,"state":"finished","original_content_size":34992416,"last_modified":"2015/03/25 04:05:16 +0000","sharing":"public","tag_list":"","permalink":"jessie-j-ariana-grande-nicki-minaj-bang-bang","streamable":false,"embeddable_by":"all","downloadable":false,"purchase_url":null,"label_id":null,"purchase_title":null,"genre":"playbook","title":"Jessie J + Ariana Grande + Nicki Minaj - Bang Bang","description":"","label_name":null,"release":null,"track_type":null,"key_signature":null,"isrc":null,"video_url":null,"bpm":null,"release_year":null,"release_month":null,"release_day":null,"original_format":"wav","license":"all-rights-reserved","uri":"https://api.soundcloud.com/tracks/161730338","user":{"id":14090772,"kind":"user","permalink":"universalrepublic","username":"RepublicRecords","last_modified":"2014/11/10 20:57:55 +0000","uri":"https://api.soundcloud.com/users/14090772","permalink_url":"http://soundcloud.com/universalrepublic","avatar_url":"https://i1.sndcdn.com/avatars-000025014448-peqymq-large.jpg"},"user_playback_count":1,"user_favorite":false,"permalink_url":"http://soundcloud.com/universalrepublic/jessie-j-ariana-grande-nicki-minaj-bang-bang","artwork_url":null,"waveform_url":"https://w1.sndcdn.com/EDiPRlpWkJ2V_m.png","playback_count":4883398,"download_count":0,"favoritings_count":94563,"comment_count":957,"attachments_uri":"https://api.soundcloud.com/tracks/161730338/attachments","policy":"ALLOW"}', 'reason': 'OK', 'status_code': 200}
According to documentation I was supposed to get the stream_url from
# get the tracks streaming URL
stream_url = client.get(track.stream_url, allow_redirects=False)
# print the tracks stream URL
print stream_url.location
I'm stuck here from 4 days. Is there a way to get the final cdn link of the MP3 track or How do these soundclouddownlaoder do this.