Created
October 3, 2013 14:22
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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