the Andrew Bailey

Extract And Export Winamp Playlists

NOTE: This has been updated. Please see here. This post remains for historical and reference purposes only.

I use Winamp, and have for over 14 years. I have a few playlists that I want to extract out of there, and backup with the rest of my music. I discovered Winamp's media directory, in C:\Users_your Windows username_\AppData\Roaming\Winamp\Plugins\ml. Unfortunately, all the playlists (*.m3u8) files have unintelligible filenames. So I reached for my handy Python skills, and got to programming.

Inside the same directory, there is a playlists.xml file. It looks like this:

<playlists playlists="11">
    <playlist filename="plf1B2C.m3u8" title="jazz" id="{018A9BC3-75D7-43AD-9877-A6C23F113B5A}" songs="42" seconds="11088" />
    <playlist filename="plf7B4.m3u8" title="latin" id="{8E432110-3DBC-4EC9-B5AD-537D16503C2E}" songs="158" seconds="36138" />
    <playlist filename="plf2EC4.m3u8" title="misc" id="{1444FCB4-41EB-4B10-9A61-BB6B1D4126AC}" songs="1261" seconds="281469" />
    <playlist filename="plf2ED3.m3u8" title="orchestral" id="{7D5FEBB4-0081-4554-BCC3-0FFB8E66FDA3}" songs="906" seconds="201768" />
    <playlist filename="plf7D3.m3u8" title="piano" id="{D55A9FC7-BB8B-4FEC-9E1A-12B41457DC0C}" songs="1162" seconds="247974" />
    <playlist filename="plf7E3.m3u8" title="bob" id="{9735824A-2A9A-4088-B6E9-BAA9DBA7A036}" songs="33" seconds="7688" />
    <playlist filename="plf1B6B.m3u8" title="christmas" id="{06603ED3-FE05-44F5-9492-B804B2B84981}" songs="514" seconds="98413" />
</playlists>

Ok, so that seems to match up the filenames to the titles that Winamp displays for my playlists in the media library. Just got to go through that list, copy them to somewhere else, rename them, and do a little search and replace all to format the filenames in the playlists properly. And now for something in Python. (Download)

Change two variables around to your liking: outDir and stripFromEntries. outDir controls the output directory (where the processed playlists will end up), and stripFromEntries controls what gets removed from the beginning of every playlist entry, since Winamp likes to store complete filenames inside playlists. You might want to make both of those variables the same, since m3u playlists look for files starting where the playlist is located. Also, I find it's nice and convenient to keep your music and your playlists together. Do double backslashes, otherwise Python thinks you're using some special character.

If you do not have the Python runtime, get it. (if you don't know which one to get, get the Python 3.-something Windows x86 MSI one.) Feel free to run it, enjoy it, and mix it up. Just remember to close Winamp before you do, in order to force Winamp to save its playlists! Please leave a message if you appreciate!

Posted under Programming. 2 complaints.

Thank you so much for this! I will be using this to automate the process of syncing playlists in Winamp to Sonos.

Philip complained on .

You're welcome. Glad to be of help.

the Andrew Bailey complained on .

You can't complain about this anymore. It's perfect!