Skip to content

Instantly share code, notes, and snippets.

@scompo
Created October 3, 2013 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scompo/6810682 to your computer and use it in GitHub Desktop.
Save scompo/6810682 to your computer and use it in GitHub Desktop.
Soundcloud API test. Full code available here: https://github.com/scompo/soundcloud-streaming-helper
import soundcloud
print '-------------------------------'
print '- Soundcloud streaming helper -'
print '-------------------------------\n'
client = soundcloud.Client(client_id='YOUR_CLIENT_ID')
track_url = raw_input('Insert track URL: ')
print 'Resolving url', track_url , '...'
track = client.get('/resolve', url=track_url)
print 'track id: ', track.id
stream_url = client.get(track.stream_url, allow_redirects=False)
print 'track: ', track.title
print 'stream url: ', stream_url.location
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment