mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-26 16:15:51 +03:00
[GH-ISSUE #754] How to start playback on a device that was used by another spotify user before #458
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#458
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tikeyknax on GitHub (Dec 10, 2021).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/754
I have several spotify users in the house that all want to play music on the same Yamaha MusicCast boxes. From the spotify Android and Desktop Apps, this works fine. So if user A was playing on a device, user B can select the same device and start playing there. This automatically stops the music from user A if it is still playing.
However, this doesn't seem to work with spotipy. If user A was playing something on a device and user B wants to use that device via spotipy, there is an error "Device not found". This even happens when user A has already stopped playing music on the device.
I'm using the following code:
So with that code, if user B was previously playing something on the device, that device is listed with show_devices() and the playback works. However, if user A was previously playing something on the device, the same code doesn't work. The device is not listed with show_devices() and start_playback() gives the error: ERROR:spotipy.client:HTTP Error for PUT to https://api.spotify.com/v1/me/player/play?device_id=055a55a152a33ae1fec9bc657e83091d2ab31c28 with Params: {} returned 404 due to Device not found
Any idea what the problem is and how I could solve this?
@tikeyknax commented on GitHub (Dec 16, 2021):
I assume that the issue is due to the restriction mentioned here: https://developer.spotify.com/documentation/web-api/guides/using-connect-web-api/#devices-not-appearing-on-device-list
Are there any ideas how to work around that restriction?