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 04-13-2004, 08:19 PM   #1
Registered: Jul 2003
Location: oregon coast
Distribution: Fedora Core 3
Posts: 280

Rep: Reputation: 30
A Program/script making a html playlist?

My .m3u file is littered with tags like
#EXTINF:-1,Skinny Puppy - Candle
/home/trinity/Music/Skinny Puppy - Candle.mp3
#EXTINF:-1,Skinny Puppy - Inquistion
/home/trinity/Music/Skinny Puppy - Inquistion.mp3
#EXTINF:-1,Skinny Puppy - Tormentor (Time 4.32)
/home/trinity/Music/Skinny Puppy - Tormentor (Time 4.32).mp3
#EXTINF:-1,Techno - VNV Nation - Futureperfect - Beloved
/home/trinity/Music/Techno - VNV Nation - Futureperfect - Beloved.mp3
#EXTINF:-1,The Cruxshadows - Bloodline
/home/trinity/Music/The Cruxshadows - Bloodline.mp3
so I need a program or something that can make an html playlist for my site based upon what I use in XMMS or something....... I'd be greatful for any suggestion. I've got a friend on aim who doesn't know how to do it either and he knows more about linux than I.

Old 04-13-2004, 08:25 PM   #2
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
What do you mean exactly? You want to have links to the mp3s? Or you want to have it run on your computer when you click on it?
Old 04-13-2004, 08:29 PM   #3
Registered: Jul 2003
Location: oregon coast
Distribution: Fedora Core 3
Posts: 280

Original Poster
Rep: Reputation: 30
Just a text file showing something like
Blahblah - The blah song.mp3
Second Band - Secondsong.mp3
Third Group - Thirdsong.mp3
So I can show what my playlist is on my site. Nothing with links or need to download.

Old 04-13-2004, 08:58 PM   #4
Senior Member
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55

`echo '<HTML><BODY bgcolor=black text=white>' >> playlist.html`;
`echo '<center><h1><u><b>XMMS Playlist</b></u></h1></center>' >> playlist.html`;

foreach $file (`ls /music -R *.mp3`){
        if( $file =~ /mp3$/i ){
     `echo \"$file <br>\" >> playlist.html`;

`echo '</BODY></HTML>' >> playlist.html`;
This is a VERY simple perl script. Pretty crude too, but it does the job. This will search your hard disk, starting at the directory /music (change this to your parent music directory) and will output an HTML page called playlist.html with just a title and then every filename listed underneath.

Copy and paste my code into a text file, save it, then do:
chmod +x filename
perl ./filename
to run it. Obviously you need perl installed.
Warning though, if you run this twice it will list all the songs twice, so if you need to run it again, delete the playlist.html file.

Oh yeah, if all your mp3s are in one folder then you can delete the -R from the 'foreach' line, and have the /music bit as your folder.
Old 04-13-2004, 09:29 PM   #5
Registered: Jul 2003
Location: oregon coast
Distribution: Fedora Core 3
Posts: 280

Original Poster
Rep: Reputation: 30
very, very cool, Komakino Thanks for the script. It works great.



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
Ices config - script for playlist section acc92 Linux - Software 1 05-11-2005 02:53 AM
Is there a Playlist HTML Generator in XMMS like Winamp? vharishankar Linux - Software 2 04-03-2005 09:51 PM
mplayer playlist or script help gotcha Linux - Software 0 09-02-2004 08:08 AM
Possible to produce a HTML playlist in XMMS? Aioth Linux - Newbie 1 06-14-2004 02:41 PM
Automating a playlist using shell script... DesiLILO Linux - Newbie 4 04-02-2004 11:03 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:38 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration