summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorDalf <alex@al-f.net>2019-07-18 21:34:07 +0200
committerDalf <alex@al-f.net>2019-07-19 08:59:11 +0200
commitda0ce5880fc636acb3356bfa93801a90ec06fa35 (patch)
tree04e87d80127e4d6b28bf3cc7a04c60b6e503bb54 /searx
parent7e201cbf65bdfe961fd5c9b97d92e822824a1dcb (diff)
downloadsearxng-da0ce5880fc636acb3356bfa93801a90ec06fa35.tar.gz
searxng-da0ce5880fc636acb3356bfa93801a90ec06fa35.zip
[fix] fix soundcloud engine, speed up searx start time
Diffstat (limited to 'searx')
-rw-r--r--searx/engines/soundcloud.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/searx/engines/soundcloud.py b/searx/engines/soundcloud.py
index d59755e04..3ba9a7f39 100644
--- a/searx/engines/soundcloud.py
+++ b/searx/engines/soundcloud.py
@@ -28,8 +28,10 @@ categories = ['music']
paging = True
# search-url
-url = 'https://api.soundcloud.com/'
+# missing attribute: user_id, app_version, app_locale
+url = 'https://api-v2.soundcloud.com/'
search_url = url + 'search?{query}'\
+ '&variant_ids='\
'&facet=model'\
'&limit=20'\
'&offset={offset}'\
@@ -57,7 +59,7 @@ def get_client_id():
# gets app_js and searches for the clientid
response = http_get(app_js_url)
if response.ok:
- cids = cid_re.search(response.text)
+ cids = cid_re.search(response.content.decode("utf-8"))
if cids is not None and len(cids.groups()):
return cids.groups()[0]
logger.warning("Unable to fetch guest client_id from SoundCloud, check parser!")