SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
Fix spotify engine
0xhtmlc329ea135ed8
diff --git a/searx/engines/spotify.py b/searx/engines/spotify.pyindex aed756be3..da32b334c 100644--- a/searx/engines/spotify.py+++ b/searx/engines/spotify.py@@ -12,10 +12,14 @@from json import loadsfrom searx.url_utils import urlencode+import requests+import base64# engine dependent configcategories = ['music']paging = True+api_client_id = None+api_client_secret = None# search-urlurl = 'https://api.spotify.com/'@@ -31,6 +35,16 @@ def request(query, params):params['url'] = search_url.format(query=urlencode({'q': query}), offset=offset)+ r = requests.post(+ 'https://accounts.spotify.com/api/token',+ data={'grant_type': 'client_credentials'},+ headers={'Authorization': 'Basic ' + str(base64.b64encode(+ (api_client_id + ":" + api_client_secret).encode('utf-8')+ ), 'utf-8')}+ )+ j = loads(r.text)+ params['headers'] = {'Authorization': 'Bearer ' + j['access_token']}+return params