For your consideration, the jukebox from my old CS club:
#!/bin/bash
cd songs
if [[ ! -p q ]]; then
mkfifo q
fi
(while true; do echo "playing" | nc -l 10000 | head -n 1 | cut -f 2 -d " " | cut -b 2- | grep -E "^[a-zA-Z0-9/:.?=-]{1,}$" > q; done) &
while true; do
if read a <q; then
echo $a;
fn=$(youtube-dl -f m4a --id --get-filename $a);
youtube-dl -f m4a --id $a
echo $fn
mplayer $fn
fi
done
To queue up a song, we'd find it on youtube and prepend "http://jukebox.local:10000/" to the url