brsc.py
Go to the documentation of this file.
1 import soundcloud
2 import sys
3 
4 if len(sys.argv)<3:
5  print 'Not enough arguments. This program needs [trackname], [filepath]'
6  sys.exit(0)
7 
8 trackname = sys.argv[1]
9 filepath = sys.argv[2]
10 
11 #yading - stick the client, secret and redirect uri in here for our app if you want to use it as a user-based interface.
12 client = soundcloud.Client(client_id = 'fbf8350b9a4fa044823f937e5d651573', client_secret = 'f03967ba1016236cb0688ad77af80588', username = 'dspbrutalizer@gmail.com', password = 'epicbrutal')
13 
14 print client.get('me').username
15 
16 fulltitle = 'SoBrutal Auto-Upload: ' + trackname
17 
18 track = client.post('/tracks', track = {'title': fulltitle, 'asset_data': open(filepath, 'rb')})
int len