Music Player Daemon Community Wiki


522pages on
this wiki
Add New Page
Talk0 Share

itunes2mpd is a single line of awk designed to load an iTunes playlist. It's not very practical for constant usage, but might be useful if there's a big playlist or two that took you ages to fine-tune that you don't feel like adding line-by-line into mpd. It does this by searching for the song via name and then via track number (just in case there's another album in your collection with said number).

Needed Programs (on top of MPD):

  • mpc
  • awk
  • cat

I don't think there's a *nix in existence without the latter two ;)


  • Set your playlist's columns so that the first column is the song's name and the second column is the track number. (You can arrange any other columns as you like).
  • Highlight the entire playlist (Ctrl+A in Windows)
  • Copy it (Ctrl+C)
  • Paste it into a text file on the MPD computer. Say, playlist.txt. Add one blank line at the start (some strange bug with cat reads tabs wrong on the first line)
  • Run the script:
sh itunes2mpd playlist.txt

Obviously, you can avoid typing sh by chmod +x'ing it, and tossing it into a folder in your $PATH.


Source code Edit

mpc clear; 
cat $1 | awk '{FS = "\t" ;gsub(/"/,"\\\"",$1);sub(/ of.*/,"",$2); print "mpc findadd title \"" $1"\"" " track "  $2}' | sh ; 
mpc play

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.