502 Error When Searching on SoundCloud Playlists

匿名 (未验证) 提交于 2019-12-03 00:56:02

问题:

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)

In the above extract of Python code, whilst tracks and users works perfectly fine, the last line returns the following error.

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

For phrases which return less results, such as 'banana phone', the query works perfectly fine (albeit slightly slowly). However for the search above which returns more results, an error is returned. This search also works on the website, so my assumption is that this is linked to the fact I'm using soundcloud-python. What am I doing wrong and how I can I resolve this error?

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!