搜索SoundCloud播放列表时出现502错误

时间:2015-06-26 16:56:05

标签: python soundcloud

import soundcloud

client = soundcloud.Client(client_id='mykey')
page_size = 10
tracks = client.get('/tracks', q='lorde',limit=page_size)
users = client.get('/users', q='lorde',limit=page_size)
sets = client.get('/playlists',q='lorde',limit=page_size)

在Python代码的上述摘录中,虽然曲目和用户完美地工作,但最后一行返回以下错误。

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "soundcloud/client.py", line 130, in _request
    return wrapped_resource(make_request(method, url, kwargs))
  File "soundcloud/request.py", line 134, in make_request
    result.raise_for_status()
  File "/Library/Python/2.7/site-packages/requests/models.py", line 829, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 502 Server Error: Bad Gateway

对于返回较少结果的短语,例如“香蕉电话”,查询工作完全正常(尽管稍微缓慢)。但是,对于上面的搜索返回更多结果,将返回错误。这个搜索也适用于网站,所以我的假设是这与我使用soundcloud-python的事实有关。我做错了什么以及如何解决这个错误?

0 个答案:

没有答案