on master help sign in
Fix some more errors with none/wrong credentials
commitb2e1ee8d35050033b41765a2de49c0eea5f8b4b4 author0xhtml <34682885+0xhtml@users.noreply.github.com> dateWed 31 Jul 2019, 21:09 (7 years ago) parent275b37c
1 file changed+3−3
searx/engines/spotify.py+3−3
searx/engines/spotify.py+3−3
@@ -38,12 +38,12 @@ def request(query, params):
3838 r = requests.post(
3939 'https://accounts.spotify.com/api/token',
4040 data={'grant_type': 'client_credentials'},
41− headers={'Authorization': 'Basic ' + str(base64.b64encode(
41+ headers={'Authorization': 'Basic ' + base64.b64encode(
4242 "{}:{}".format(api_client_id, api_client_secret).encode('utf-8')
43− ), 'utf-8')}
43+ ).decode('utf-8')}
4444 )
4545 j = loads(r.text)
46− params['headers'] = {'Authorization': 'Bearer ' + j['access_token']}
46+ params['headers'] = {'Authorization': 'Bearer {}'.format(j.get('access_token'))}
4747
4848 return params
4949