Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to work with spotify #769

Open
Tsjippy opened this issue Nov 29, 2023 · 5 comments
Open

How to work with spotify #769

Tsjippy opened this issue Nov 29, 2023 · 5 comments

Comments

@Tsjippy
Copy link
Contributor

Tsjippy commented Nov 29, 2023

Hello,

I have been using this library in 2020, and now I wanted to start again, but the spotify controller is gone.
How do I work with spotify now?

I use pychromecast with domoticz, see my code here: https://github.com/Tsjippy/ChromecastPlugin

@stackErr-NameNotResolved

Looks like Spotify support was removed in #535 because it was hosted by the spotcast project.

Unfortunately the spotcast project is not maintained anymore https://camo.githubusercontent.com/a9058f39b5fc70fadc797d9b38617c1fc7c6c3d8567744c67e247d0c341d047c/68747470733a2f2f696d672e736869656c64732e696f2f6d61696e74656e616e63652f7965732f323032322e737667

@Tsjippy
Copy link
Contributor Author

Tsjippy commented Dec 6, 2023

So can we add the spotify controller again?

@stackErr-NameNotResolved

I tried to hack in the latest available Spotify controller (release 9.2.0) in the 13.0.8 release.

When launching Spotify on the Google Nest Hub second gen, the Spotify UI splash screen keeps hanging and the launch app will timeout. This was done by using a "normal" Spotify token.

It looks like the 9.2.0 Spotify example is dependant on the spotify_token lib.. This lib will generate a "more permissions" token. However this lib seems to be broken for some time...

Currently I do not know if my attempt failed because i did something wrong, the old code does not integrate anymore or the token that I did use has not enough rights. I expect that the token might be the issue but I do not have the knowledge to debug that unfortunately.

@Tsjippy
Copy link
Contributor Author

Tsjippy commented Dec 11, 2023

This is how you get spotify.

import spotipy
from spotipy.oauth2 import SpotifyOAuth

clientid        = 'SOME ID'
clientsecret    = 'SOME SECRET'

scope = "app-remote-control,playlist-modify-private,playlist-read-private,user-library-read,user-modify-playback-state,user-read-currently-playing,user-read-playback-position,user-read-playback-state"

oauth=SpotifyOAuth(scope=scope,client_id=clientid,client_secret=clientsecret,redirect_uri='http://localhost:9999',open_browser=False)
oauth.get_access_token()['access_token']

But apart from that I don't know how to start Spotify on Chromecast

@kjstultz
Copy link

Landed here after working on this same problem for a while, spotipy won't recognize the google assistant device if it's not already playing something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants