A quick hack to stream music from the spotify library using your terminal.
This script will look up for the best available result given any keywords.
Ideally you should give the complete track info ( $artist - $song ) for more accurate results.
No sign up or premium subscriptions are required, this is a small workaround to Spotify API.
Queue up any track/album/playlist from the spotify library.
- Type a song title or artist name for a quick search.
- Add prefix
Playlistfor respective results.
- You can direcly input a playlist URL.
- Spotify client must be running. (cf. below on how to hide it).
Tricks & Notes :
- This script doesn't provide a client interface (pause,next,prev)
I suggest you use SP (https://gist.github.com/wandernauta/6800547) for this purpose.
- If you want to queue a single artist playlist, add the prefix
somebefore to load
a complete playlist, acronyms are accepted for popular bands:
play some PFwill queue up a Pink Floyd playlist
play some NMHwill queue up a Neutral milk hotel playlist
- To hide the Spotify GUI you can try out these commands. (will work better on a WM)
xdotool search --name spotify windowunmap
wmctrl -r "spotify" -b toggle,hidden
- Some songs may not play for you due to country restrictions.
- Download the script
- Add it to your ~/.local/bin/
- Rename or change alias to
playin your .bashrc/.zshrc