diff options
| author | Dalf <alex@al-f.net> | 2020-08-06 17:42:46 +0200 |
|---|---|---|
| committer | Alexandre Flament <alex@al-f.net> | 2020-09-10 10:39:04 +0200 |
| commit | 1022228d950c2a809ed613df1a515d9a6cafda7c (patch) | |
| tree | d792dddea1a5b278b018ed4e024cd13340d5c1b1 /searx/engines/soundcloud.py | |
| parent | 272158944bf13503e2597018fc60a00baddec660 (diff) | |
Drop Python 2 (1/n): remove unicode string and url_utils
Diffstat (limited to 'searx/engines/soundcloud.py')
| -rw-r--r-- | searx/engines/soundcloud.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/searx/engines/soundcloud.py b/searx/engines/soundcloud.py index 284689bf6..5165ea3ea 100644 --- a/searx/engines/soundcloud.py +++ b/searx/engines/soundcloud.py @@ -14,14 +14,11 @@ import re from json import loads from lxml import html from dateutil import parser +from io import StringIO +from urllib.parse import quote_plus, urlencode from searx import logger from searx.poolrequests import get as http_get -from searx.url_utils import quote_plus, urlencode -try: - from cStringIO import StringIO -except: - from io import StringIO # engine dependent config categories = ['music'] @@ -61,7 +58,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.content.decode("utf-8")) + cids = cid_re.search(response.content.decode()) 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!") |