Converting MPD (or any .m3u) playlist to iTunes format 0 ▲ yequari.com 2 hours ago · Tech · hide · 0 comments This is hyperspecific to my use case but maybe others will find this useful. I have several iPods that I sync from a Windows VM on my main Linux PC. My music library lives on the Linux host, managed with beets and mpd . Mpd playlists are standard .m3u files, i.e. a list of file paths, which iTunes can import, but the file paths are Linux file paths and are relative. I needed a way to convert each line from a relative Linux file path to an absolute Windows file path. My music library /home/yequari/Music is mapped to Z:\ in the Windows VM, so for me it was just a matter of converting the Linux path to a Windows path and prepending the Z:\ root drive to it (e.g. Sleep/Dopesmoker/Dopesmoker.mp3 becomes Z:\Sleep\Dopesmoker\Dopesmoker.mp3 ). There’s probably some sed magic that could do this pretty easily, but I wrote a Python script to do it instead. import ntpath import argparse def main(args: argparse.Namespace): infile = args.f outfile = args.o prefix = args.prefix for line in infile: #… No comments yet. Log in to reply on the Fediverse. Comments will appear here.