![]() It’ll give you a URL to copy/paste into a browser so you can authenticate. When you first run this, using python get_spot.py Token_info = oauth.refresh_access_token(token_info)Ĭurrent_playing = sp.current_user_playing_track()Īlbum_art = current_playing If token_info and oauth.is_token_expired(token_info): Oauth = SpotifyOAuth(client_id=SPOTIPY_CLIENT_ID, SPOTIPY_REDIRECT_URI = 'your_redirect_uri' SPOTIPY_CLIENT_SECRET = 'your_spotify_client_secret' SPOTIPY_CLIENT_ID = 'your_spotify_client_id' So, install python pip install spotipyĪlso, to use this we also need to add it to a Python virtual environment using this: pip install virtualenvĪnd using source myenv/bin/activate to recall.Īfter many iterations (thanks ai), we get to a script: Luckily there’s a Python library that does things. ![]() I decided to use one of my public web servers, so I can get the image from anywhere, not just at home, but you can use localhost. This means you need to be able to put a web page somewhere that you can access. You must also set a Redirect URIs because Spotify requires you to use a web browser to authenticate: it’s not possible to do entirely on the command line (no, you can’t use CURL either, apparently). To get going, set up a developer account in Spotify, create a new app and then get hold of So, with a bit of help (actually a lot of help) from ChatGPT-4* and many rabbit holes explored, I’ve now got a call directly to the Spotify API of “now playing”. This is far more painful than it needs to be and Spotify could do better (see footnote). Unfortunately, upgrading to a new amp ‘improved’ its operating system and the artwork vanished, so I had to bite the bullet to get it straight from Spotify. In a previous post, I hacked this by getting the album artwork jpg from my amplifier.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |