m3utree.py

This utility creates a tree of M3U files (MP3 playlist files) to parallel a tree of MP3 files. Each directory gets an .m3u file named for the directory that includes all of the .mp3 files in the directory and all of its subdirectories.

For example, suppose your MP3 directory has subdirectories for each artist, which have subdirectories for each album, which have .mp3 files for the album’s tracks. Then after running this utility, you will have a .m3u file that includes every track at the root, an .m3u file in each artist directory that includes all that artist’s tracks, and an .m3u file in each album directory that includes all the tracks on the album.

Requirements:

Run m3utree.py in the root of your mp3 tree. It will create m3u files at each subdirectory.

Download: m3utree.py

Changes

7 January 2004: The mp3.py module occasionally fails when trying to read the length of an MP3 file, so I’ve protected against exceptions when calling it.

9 January 2004: Now it doesn’t write the #EXTINF line if it has no information to add there.

13 January 2004: Yet better handling of the #EXTINF line when information is missing, Unicode data is printed without fail.

Comments

Add a comment:

Ignore this:
Leave this empty:
Name is required. Either email or web are required. Email won't be displayed and I won't spam you. Your web site won't be indexed by search engines.
Don't put anything here:
Leave this empty:
Comment text is Markdown.