Andrew's Blog     All posts     Feed     About


Command line Grooveshark post-Grooveshark

In this post I’ll share a way to get a Grooveshark-like experience with a Linux command-line application.

Step 1: Build a YouTube playlist with some music you like.

Step 2: Go to your channel, select Playlists, find the one you just made, and click View full playlist. Make sure the privacy setting is either public or unlisted. Copy the playlist ID in the URL (after list=). For example, the playlist ID of one of my playlists is PLmaRvdyzIrIGkRbl7jJdzEYrRcXe4od9G.

Step 3: Install mpv and mps-youtube.

Step 4: Run

mpsyt pl <playlist ID>, dump, \*

You’re streaming the playlist! Press <space> to pause/play, < to play previous track, > to play next track.

To play the playlist shuffled, run this instead:

mpsyt pl <playlist ID>, dump, shuffle \*

I have this alias in my .zshrc file:

alias playlistName="mpsyt pl PLmaRvdyzIrIGkRbl7jJdzEYrRcXe4od9G, dump, shuffle \*"

so I can get music playing with just one command.

If, as in Grooveshark, your YouTube playlists are public, you can open mpsyt and run userpl <YouTube username> to see your YouTube playlists and select one to play.

The good thing is that the whole videos aren’t streamed, just high-quality audio.

Among other features, mpsyt allows you to search for YouTube videos and create local playlists (not connected to a YouTube account), which you can do if you want to avoid the YouTube web interface completely.

* * *