I used YouTube to play music for a long time and compiled a playlist called “Banger Songs,” but I am not using it anymore. It has multiple issues: the shuffle feature doesn’t work very well—it often sticks in a loop of 10–20 songs. It randomly stops autoplaying, plays one song and then stops, and the volume slider is very finicky and hard to set to the desired level.
I switched to fully offline music. I run mpv to play all songs from the ~/Music/banger-songs
directory using the following script:
while true; do
find /home/mika/Music/banger-songs -type f \( -iname "*.mp4" -o -iname "*.mp3" -o -iname "*.flac" -o -iname "*.m4a" -o -iname "*.m4v" -o -iname "*.opus" \) -print0 | shuf | xargs -0 mpv --shuffle --input-ipc-server=/tmp/mpvsocket --no-video --msg-level=ifo_dvdnav=v --no-border --geometry=+1920+0;
sleep 10;
done
I populate that directory using a YouTube downloader CLI tool:
cd ~/Music/
/usr/local/bin/youtube-dl --verbose -f best -ciw --limit-rate 200K -o "%(title)s.%(ext)s" 'link to the music or playlist'
If I do not like a song anymore, I have a one-liner that skips the song and moves it back to the ~/Music
directory:
FILE=$(printf '{ "command": ["get_property", "path"] }\n' | socat - /tmp/mpvsocket | jq -r '.data') && mv "$FILE" ~/Music && printf '{ "command": ["playlist-next", "force"] }\n' | socat - /tmp/mpvsocket # skip song and move it from bangers