Skip to content

Instantly share code, notes, and snippets.

@moopet
Created January 16, 2013 11:12
Show Gist options
  • Save moopet/4546412 to your computer and use it in GitHub Desktop.
Save moopet/4546412 to your computer and use it in GitHub Desktop.
With a shared MPD server, sometimes other people will add shit music. Stop the rot.
#!/usr/bin/env bash
# Given a blacklist file with one pattern per line, automatically removes them from your playlist
# To nuke an artist or song just do something like:
#
# echo Nickleback >> /var/music/blacklist.txt
BLACKLIST=/var/music/blacklist.txt
MPD_HOST=localhost
[ -f "$BLACKLIST" ] || touch "$BLACKLIST"
while :
do
mpc current | grep -i -f $BLACKLIST && mpc del $(mpc status -f %position% | head -1)
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment