A CLI tool using puppeteer to intercept your own validated spotify OAuth token alongside of the session cookies, then reinject them to mimic an authorized, user-like traffic.
git clone https://github.com/BelkaDev/Spotify-Headless ~/Spotify-Headless
cd ~/Spotify-Headless && npm install
To provide your credentials you need to set them as environement variables within your bashrc (or your default shell rc)
export SPOTIFY_USER=""
export SPOTIFY_PWD=""
Manually grab your access token: node token.js
Other commands are found under /lib
folder, they are examples of commands from the API with extra features (search, play/resume etc..)
The sole purpose is to combine aliases into automated and complex tasks, this can offer a lot of flexibility as shown below:
play.js
reads input from stdin only, it works in pair with the search command.transfer.js
takes phone/mobile
,computer/pc
,browser
as parameters, if the suggested device isn't opened, it sends the signal to the actual active device.search.js
will lookup for tracks by default, unlike other items (albums,playlists etc..), tracks can be stacked and enqueued at once, more details here. It takes album
,artist
,playlist
as arguments.