Last active
July 8, 2018 16:49
-
-
Save hannesbe/a7d3bebf9c5375a812752ecce2c02459 to your computer and use it in GitHub Desktop.
Gets your spotify playlists (name and uri), useful for configuring a Home Assistant Spotify player (https://community.home-assistant.io/t/spotify-playlist-player/22491). This should work as is on hassio, for other setups change /config/.spotify-token-cache to the actual path of your HA config/.spotify-token-cache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Gets your spotify playlists (name and uri), useful for configuring a Home Assistant Spotify player (https://community.home-assistant.io/t/spotify-playlist-player/22491). | |
| # This should work as is on hassio, for other setups change /config/.spotify-token-cache to the actual path of your HA config/.spotify-token-cache | |
| HA_SPOTIFY_TOKEN=`cat /config/.spotify-token-cache | jq --raw-output .access_token` | |
| curl -X GET "https://api.spotify.com/v1/me/playlists?offset=0&limit=50" -H "Authorization: Bearer $HA_SPOTIFY_TOKEN" | jq '.items[] | {name: .name, uri: .uri}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment