[GH-ISSUE #385] spotipy.client.SpotifyException: http status: 400, code:-1 - Malformed json when trying to use start_playback with parameters #226

Closed
opened 2026-02-27 23:21:29 +03:00 by kerem · 1 comment
Owner

Originally created by @shillshocked on GitHub (Jul 2, 2019).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/385

Traceback (most recent call last):
File "test.py", line 115, in
test = sp.start_playback(device_id = devs['devices'][0]['id'], context_uri = ["spotify:album:01cbQN8LXD53sEV31mpARQ"], uris = None, offset = {"uri": "spotify:track:6M6MC6OgvXBj9YnLjnJ1RF"})
File "/usr/lib/python2.7/site-packages/spotipy/client.py", line 948, in start_playback
return self._put(self._append_device_id("me/player/play", device_id), payload=data)
File "/usr/lib/python2.7/site-packages/spotipy/client.py", line 190, in _put
return self._internal_call('PUT', url, payload, kwargs)
File "/usr/lib/python2.7/site-packages/spotipy/client.py", line 126, in _internal_call
headers=r.headers)
spotipy.client.SpotifyException: http status: 400, code:-1 - https://api.spotify.com/v1/me/player/play?device_id=5d81cefb30a59997f5dcd7af0548f3a1b0fc1935c3:
Malformed json

Originally created by @shillshocked on GitHub (Jul 2, 2019). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/385 Traceback (most recent call last): File "test.py", line 115, in <module> test = sp.start_playback(device_id = devs['devices'][0]['id'], context_uri = ["spotify:album:01cbQN8LXD53sEV31mpARQ"], uris = None, offset = {"uri": "spotify:track:6M6MC6OgvXBj9YnLjnJ1RF"}) File "/usr/lib/python2.7/site-packages/spotipy/client.py", line 948, in start_playback return self._put(self._append_device_id("me/player/play", device_id), payload=data) File "/usr/lib/python2.7/site-packages/spotipy/client.py", line 190, in _put return self._internal_call('PUT', url, payload, kwargs) File "/usr/lib/python2.7/site-packages/spotipy/client.py", line 126, in _internal_call headers=r.headers) spotipy.client.SpotifyException: http status: 400, code:-1 - https://api.spotify.com/v1/me/player/play?device_id=5d81cefb30a59997f5dcd7af0548f3a1b0fc1935c3: Malformed json
kerem closed this issue 2026-02-27 23:21:29 +03:00
Author
Owner

@shillshocked commented on GitHub (Jul 2, 2019):

Ah, I had to upgrade librespot. It was a bug in the older version.

<!-- gh-comment-id:507714572 --> @shillshocked commented on GitHub (Jul 2, 2019): Ah, I had to upgrade librespot. It was a bug in the older version.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#226
No description provided.