Search tracks with Soundcloud API not working anymore

442 views Asked by At

I have been using the Soundcloud API (Python-client) for a few months in production but starting a few weeks ago, searching tracks was not possible anymore.

I'm using the python-client. I tested the sample-code from the official docs:

>>> import soundcloud
>>> client = soundcloud.Client(client_id='CLIENT_ID')
>>> tracks = client.get('/tracks', q='buskers', license='cc-by-sa')

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/soundcloud/client.py", line 130, in _request
return wrapped_resource(make_request(method, url, kwargs))
File "/usr/local/lib/python2.7/dist-packages/soundcloud/resource.py", line 52, in wrapped_resource
response_content = response.content.decode(response.encoding)
TypeError: decode() argument 1 must be string, not None

Something in the API must have changed!

Can anyone from the SC-developers please fix this?

Thanks!

2

There are 2 answers

2
TimD On

It's not broken.

From this snipped and it looks like you are executing from the Python console you never define CLIENT_ID.

The error confirms it too. It says it's None Type.

I could be wrong though. Replace client ID with your real ID maybe?

0
Saskia Vola On

It's a known and solved issue. By checking out the soundcloud-client from github, it works.

https://github.com/soundcloud/soundcloud-python/issues/57