Skip to content

Instantly share code, notes, and snippets.

@avoidik
Last active March 16, 2017 15:51
Show Gist options
  • Save avoidik/cf4d82411ee603768b8abe31e0939050 to your computer and use it in GitHub Desktop.
Save avoidik/cf4d82411ee603768b8abe31e0939050 to your computer and use it in GitHub Desktop.
SoundnodeApp - solver 429 HTTP request error
  1. Request data with the help of python script:
import getpass
import json
import re
import requests

client_id = re.compile(',client_id:"(.*?)"').search(requests.get(re.compile('src="https://a-v2.sndcdn.com/assets/app-.*.js"').search(requests.get('https://soundcloud.com/').text).group()[5:-1]).text).group()[12:-1]

username = raw_input('Username: ')
password = getpass.getpass()

access_token = requests.post('https://sign-in.soundcloud.com/sign-in/password?client_id={}'.format(client_id), data=json.dumps({'client_id': client_id, 'scope': 'fast-connect non-expiring purchase signup upload', 'recaptcha_response': '', 'credentials': {'identifier': username, 'password': password}}), headers={'Content-type': 'application/json'}).json()['session']['access_token']

print 'Client ID: {}'.format(client_id)
print 'Access Token: {}'.format(access_token)
print requests.get('https://api-v2.soundcloud.com/me?client_id={}'.format(client_id), headers={'Authorization': 'OAuth {}'.format(access_token)}).json()

On Ubuntu/Mint you have to install pip and install requests module:

sudo apt-get install python-pip
pip install requests

And then run the script above:

chmod +x script.py
python script.py
  1. Put it in SoundnodeApp via Developer Console (CTRL + ? or CTRL + /)
  1. Open Soundnode
  2. Open developer tools, go to tab Resources, under local storage open file://
  3. Add the Access Token under the key scAccessToken
  4. Add the Client ID under the key scClientId
  5. Restart Soundnode
  1. Restart application. Repeat everything if login windows occurs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment