BelkaDev / Spotify-Headless

Experimental wrapper for Spotify API to search songs and control the web player using the cli (Feat. Puppeteer)
GNU General Public License v3.0
100 stars 7 forks source link

node play.js not doing anything #7

Open amadeusdotpng opened 2 years ago

amadeusdotpng commented 2 years ago

I'm not sure if I'm doing this correctly, but I've done the following commands with my credentials so far:

export SPOTIFY_USER=""
export SPOTIFY_PWD=""
node token.js
cd lib

then I ran node play.js Two Slow Dancers and it doesn't really do anything. I'm not sure what else I'm supposed to do. What is the ACCESS_TOKEN that node token.js outputs used for?

BelkaDev commented 2 years ago

Hi. Due to the nature of the script, it can only read a properly formatted string (allowing multiple inputs and a server validation) So you need to pipe the search.js command into the play.js:

node search.js Two Slow Dancers | node play.js
## Play the first match only:
## node search.js Two Slow Dancers | head -n1 | node play.js 

If you're looking for a simpler alternative you can use my other shell script that takes a different approach.