[GH-ISSUE #659] Spotipy can no longer find devices #393

Closed
opened 2026-02-27 23:22:22 +03:00 by kerem · 7 comments
Owner

Originally created by @Octacon100 on GitHub (Mar 23, 2021).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/659

So I've had some code running for weeks and it's been able to find my chromecasts/google homes pretty well, but last night it seems to have issues finding any chromecasts/google homes, I'm wondering if a Spotify update might have caused it. Seems like the web interface doesn't list google homes/chromecasts any more, it just lists "Google Cast" and you select your speaker inside of there.

Here's my code I'm using:

# Query spotify for active devices
devices_available = client.devices()

# Match active spotify devices with the spotify controller's device id
for device in devices_available["devices"]:
    if device["id"] == sp.device:
        spotify_device_id = device["id"]
        break

if not spotify_device_id:
    print('No device with id "{}" known by Spotify'.format(sp.device))
    print("Known devices: {}".format(devices_available["devices"]))
    sys.exit(1)

Here's the output:

No device with id "4862a56929200af9e9485aae060e7724" known by Spotify
Known devices: []

Looks like it can't find anything at all even if the google home is assigned to the spotify controller.

Originally created by @Octacon100 on GitHub (Mar 23, 2021). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/659 So I've had some code running for weeks and it's been able to find my chromecasts/google homes pretty well, but last night it seems to have issues finding any chromecasts/google homes, I'm wondering if a Spotify update might have caused it. Seems like the web interface doesn't list google homes/chromecasts any more, it just lists "Google Cast" and you select your speaker inside of there. Here's my code I'm using: ``` # Query spotify for active devices devices_available = client.devices() # Match active spotify devices with the spotify controller's device id for device in devices_available["devices"]: if device["id"] == sp.device: spotify_device_id = device["id"] break if not spotify_device_id: print('No device with id "{}" known by Spotify'.format(sp.device)) print("Known devices: {}".format(devices_available["devices"])) sys.exit(1) ``` Here's the output: ``` No device with id "4862a56929200af9e9485aae060e7724" known by Spotify Known devices: [] ``` Looks like it can't find anything at all even if the google home is assigned to the spotify controller.
kerem 2026-02-27 23:22:22 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@provinzio commented on GitHub (Mar 23, 2021):

I have the same problem. I can see my devices using the spotify web api console, but spotipy.Spotify.devices() is empty.

EDIT: It might be due to this error HTTP Error for PUT to https://api.spotify.com/v1/me/player/play?device_id=<MY_DEVICE_ID> returned 403 due to Player command failed: Restriction violated. I use sp_dc and sp_key as login credentials.

<!-- gh-comment-id:804915149 --> @provinzio commented on GitHub (Mar 23, 2021): I have the same problem. I can see my devices using the spotify web api console, but `spotipy.Spotify.devices()` is empty. EDIT: It might be due to this error `HTTP Error for PUT to https://api.spotify.com/v1/me/player/play?device_id=<MY_DEVICE_ID> returned 403 due to Player command failed: Restriction violated`. I use `sp_dc` and `sp_key` as login credentials.
Author
Owner

@Octacon100 commented on GitHub (Mar 24, 2021):

Best answer I can find is that the token security needed for this to work now is "user-read-playback-state", which sounds like a new thing from previous, based on this Spotify help chat: https://community.spotify.com/t5/Spotify-for-Developers/get-users-available-devices-return-empty-even-if-I-am-opening/td-p/5172688

Edit: Here's the information on the api call: https://developer.spotify.com/documentation/web-api/reference/#endpoint-get-a-users-available-devices

Looks like there's a bunch of Spotify tickets around playing on Chromecast. I had this working for weeks, would like to know if there's anything I can do to help with this. https://github.com/spotify/web-api/issues/787

<!-- gh-comment-id:805839933 --> @Octacon100 commented on GitHub (Mar 24, 2021): Best answer I can find is that the token security needed for this to work now is "user-read-playback-state", which sounds like a new thing from previous, based on this Spotify help chat: https://community.spotify.com/t5/Spotify-for-Developers/get-users-available-devices-return-empty-even-if-I-am-opening/td-p/5172688 Edit: Here's the information on the api call: https://developer.spotify.com/documentation/web-api/reference/#endpoint-get-a-users-available-devices Looks like there's a bunch of Spotify tickets around playing on Chromecast. I had this working for weeks, would like to know if there's anything I can do to help with this. https://github.com/spotify/web-api/issues/787
Author
Owner

@jfmennedy commented on GitHub (Apr 3, 2021):

Same issue for me since mars 22.. what happened with spotify? Is there any solution ? if not i will cancel my spotify account... just started paying the family account and now its not working anymore...

<!-- gh-comment-id:812846567 --> @jfmennedy commented on GitHub (Apr 3, 2021): Same issue for me since mars 22.. what happened with spotify? Is there any solution ? if not i will cancel my spotify account... just started paying the family account and now its not working anymore...
Author
Owner

@fondberg commented on GitHub (Apr 11, 2021):

This is a spotify problem. The scope for the super token or for older tokens that hasn't requested the scope user-read-playback-state will not see anything

<!-- gh-comment-id:817289628 --> @fondberg commented on GitHub (Apr 11, 2021): This is a spotify problem. The scope for the super token or for older tokens that hasn't requested the scope user-read-playback-state will not see anything
Author
Owner

@provinzio commented on GitHub (Apr 11, 2021):

@fondberg do you now a way to fix this? I already renewed my sp_dc and sp_key cookies without any effect.

<!-- gh-comment-id:817291931 --> @provinzio commented on GitHub (Apr 11, 2021): @fondberg do you now a way to fix this? I already renewed my `sp_dc` and `sp_key` cookies without any effect.
Author
Owner

@fondberg commented on GitHub (Apr 11, 2021):

Yes and no. Head over to spotcast where I will reveal it soon :-)

<!-- gh-comment-id:817297853 --> @fondberg commented on GitHub (Apr 11, 2021): Yes and no. Head over to spotcast where I will reveal it soon :-)
Author
Owner

@stephanebruckert commented on GitHub (Apr 14, 2021):

Since there is nothing we can do about this on the spotipy side, I'm closing this

<!-- gh-comment-id:819811102 --> @stephanebruckert commented on GitHub (Apr 14, 2021): Since there is nothing we can do about this on the spotipy side, I'm closing this
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#393
No description provided.