Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-28-2004, 11:06 AM   #1
Registered: Sep 2003
Distribution: Gentoo, FreeBSD 5.1
Posts: 122

Rep: Reputation: 15
Program to create playlists of directories

Is there a program for Linux that can make playlist automatically from many directories at the same time? Or maybe a console program for that so I could write a script / execute it recursively to create playlists?

I want to make playlists for directories seperately not only one huge playlist containing all my music files.

Last edited by Mikessu; 06-28-2004 at 11:07 AM.
Old 06-28-2004, 12:36 PM   #2
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928

Which player are they meant to be for?

Old 06-28-2004, 07:17 PM   #3
Senior Member
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
This should do the trick. Pretty much any media player can deal with .m3u playlists. You just need to edit a few things.

import os, string

def create_m3u_playlist(music_dir, name):
    song_list = os.listdir(music_dir)
    # change "/home/music/" to where you want the .m3u files to be created
    f = open("/home/music/" + name + ".m3u" , "w")
    for i in song_list:
        f.write(music_dir + "/" + i + "\n")

# change "a","b" etc... to the directory names where you keep your music files.
directory = ["a","b","c"]
for name in directory :
    # change "/home/music/" to the path to your music directories ie: "music_dir + name"
    # should represent the full path to your directories.
    music_dir = "/home/music/" + name
    create_m3u_playlist(music_dir, name)
I edited this from a python script I wrote that indexes all of my music files into html pages and m3u playlists. Unfortunately my script is hardwired with file paths specific to my music directory structure, but anyone with a little python knowledge could hack it to work for them.

Last edited by bulliver; 06-28-2004 at 07:27 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to create directories satimis Linux From Scratch 8 07-02-2005 04:48 AM
Do we need to create the log and db directories by ourselves Niceman2005 Linux - Software 0 11-17-2004 09:08 PM
Can't create directories in /proc keripukki Linux - Software 3 09-03-2004 01:26 PM
Create several directories? AutOPSY Linux - Newbie 3 03-30-2004 07:51 PM
Need to sort mp3's and create playlists based on genre cav Linux - General 11 07-06-2003 10:04 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:34 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration