Skip to content

ronanyeah/spotify-fresh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This lets you play with your Spotify playlists (in a very basic way) using a Node.js CLI.

  1. First you will need to get your Client ID and Client Secret from a Spotify developer application, and set http://localhost:8000/callback as an allowed Redirect URI.

  2. Update the config.json, it should look like this:

{
  "userId":       "pascal_arbez", // Your Spotify username.
  "clientId":     "8160d65996d54d379391b7cda895185a",
  "clientSecret": "0c7f57984bd2482b956d6d9bbb37ada4"
}
  1. Run this server in your terminal:
    node -e "require('http').createServer( req => console.log( '\n' + req.url.split('code=')[1] ) ).listen(8000)"

  2. Visit this URL (replacing <YOUR_CLIENT_ID>):
    https://accounts.spotify.com/authorize?client_id=<YOUR_CLIENT_ID>&response_type=code&redirect_uri=http%3A%2F%2Flocalhost:8000%2Fcallback&scope=playlist-modify-public

  3. Pass the auth code printed out in the terminal to generateTokens.js:
    CODE=<AUTH_CODE> node generateTokens.js

  4. Your tokens have been written to disk as tokens.json and you can now use the CLI app:
    npm start

NOTE: The app will refresh the tokens itself if necessary, so these steps need only be done once.

Releases

No releases published

Packages

No packages published