https://github.com/artdevgame/spotify
Connect to Spotify API and write currently playing track to disk
https://github.com/artdevgame/spotify
obs spotify-api
Last synced: about 1 year ago
JSON representation
Connect to Spotify API and write currently playing track to disk
- Host: GitHub
- URL: https://github.com/artdevgame/spotify
- Owner: artdevgame
- Created: 2018-07-21T11:19:20.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-03-26T06:56:37.000Z (about 2 years ago)
- Last Synced: 2025-01-13T04:29:57.037Z (over 1 year ago)
- Topics: obs, spotify-api
- Language: JavaScript
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# artdevgame/spotify
Connects to the Spotify API to retrive the current track and write to disk. The information can then be picked up by a third-party, such as OBS.
## Requirements
* yarn
* node.js
## Usage
Define environment variables called `SPOTIFY_API_ID` & `SPOTIFY_API_SECRET` and set it to your Spotify app's client id / secret (get this from the [Spotify developer dashboard](https://developer.spotify.com/dashboard)).
Make sure all of the dependencies are installed using `yarn`.
### Generating a new access token
**This only needs to be done on first-run or if you're having problems with authentication.**
In order to retrieve an access token, we need to handshake with Spotify using our client id and secret.
`yarn run start:auth`
You will need to add a whitelist address in the [Spotify apps settings](https://developer.spotify.com/dashboard) (default: http://localhost:8081/login) so it can talk back to your machine after logging in.
Finally, in a browser visit the server you're running (default: http://localhost:8081). If everything is setup correctly you'll be asked to confirm your identity with Spotify and the access tokens will be written to disk (default: ./config/local.json)
### Listening for Spotify changes
Run: `yarn start`
By default, the artist and album name will be written to /tmp/spotify-currently-playing.txt