Soundcloud python api在M上包装了\u资源错误

2024-10-01 09:15:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试遵循Soundcloud Python api文档中的this example

我使用的是MacOS10.10,当我尝试运行示例代码时出现了这个错误。我的api键可以工作,其他一些例子也可以。你知道吗

import soundcloud

# create a client object with your app credentials
client = soundcloud.Client(client_id='YOUR_CLIENT_ID')

# find all sounds of buskers licensed under 'creative commons share     alike'
tracks = client.get('/tracks', q='buskers', license='cc-by-sa')

我得到以下错误:

Traceback (most recent call last):
  File "music.py", line 7, in <module>
    tracks = client.get('/tracks', q='buskers')
  File "build/bdist.macosx-10.10-intel/egg/soundcloud/client.py", line 130, in _request
  File "build/bdist.macosx-10.10-intel/egg/soundcloud/resource.py", line 52, in wrapped_resource
TypeError: decode() argument 1 must be string, not None

Tags: inpybuildclientapiget错误line