diff options
author | 0xhtml <34682885+0xhtml@users.noreply.github.com> | 2019-07-31 21:09:02 +0200 |
---|---|---|
committer | 0xhtml <34682885+0xhtml@users.noreply.github.com> | 2019-07-31 21:09:02 +0200 |
commit | b2e1ee8d35050033b41765a2de49c0eea5f8b4b4 (patch) | |
tree | 2c08ab0d44220d9045a9506b473bd42f84d1afb0 /searx | |
parent | 275b37cc7c87b562d08576be5268a4f8797b84ea (diff) | |
download | searxng-b2e1ee8d35050033b41765a2de49c0eea5f8b4b4.tar.gz searxng-b2e1ee8d35050033b41765a2de49c0eea5f8b4b4.zip |
Fix some more errors with none/wrong credentials
Diffstat (limited to 'searx')
-rw-r--r-- | searx/engines/spotify.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/searx/engines/spotify.py b/searx/engines/spotify.py index 57b08a1e4..00c395706 100644 --- a/searx/engines/spotify.py +++ b/searx/engines/spotify.py @@ -38,12 +38,12 @@ def request(query, params): r = requests.post( 'https://accounts.spotify.com/api/token', data={'grant_type': 'client_credentials'}, - headers={'Authorization': 'Basic ' + str(base64.b64encode( + headers={'Authorization': 'Basic ' + base64.b64encode( "{}:{}".format(api_client_id, api_client_secret).encode('utf-8') - ), 'utf-8')} + ).decode('utf-8')} ) j = loads(r.text) - params['headers'] = {'Authorization': 'Bearer ' + j['access_token']} + params['headers'] = {'Authorization': 'Bearer {}'.format(j.get('access_token'))} return params |