Subj : Tool wanted To : Frank Reid From : Angus Mcleod Date : Thu Dec 02 2004 09:45 pm Re: Tool wanted By: Frank Reid to Angus Mcleod on Thu Dec 02 2004 19:01:00 > You parsing output for web presentation or something? My music-delivery system here is based on a collection of .ogg files living on the same machine that is used to play them. Therefore, the file /music/Saint\ Etienne/Foxbase\ Alpha/playlist.m3u contains entries looking like this: #EXTM3U #EXTINF:42,This is Radio Etienne This is Radio Etienne.ogg #EXTINF:269,Only love can break your heart Only love can break your heart.ogg #EXTINF:119,Wilson Wilson.ogg #EXTINF:283,Carnt sleep Carnt sleep.ogg and so forth. This playlist is built up by a shell-script that i) encodes the .WAV files ripped from the disk, ii) updates my MySQL database with filename info, and iii) builds the playlist file. I want to move the .ogg files onto a dedicated music server. This music server will then allow the music to be played from any machine on the LAN by serving the files over my 100 Mbit LAN. The server will make the /music area available as an NFS share, but I also want to serve the .ogg files out using HTTP. XMMS can use URL's instead of filenames in a playlist. Notice the spaces in the filenames, which are illegal in a URL. Some file names contain other characters that are also not legal in URL's. So I needed to write a program to convert all existing playlists to contain valid encoded URLs like this: #EXTM3U #EXTINF:42,This is Radio Etienne http://music/Saint%20Etienne/Foxbase%20Alpha/This%20is%20Radio%20Et #EXTINF:269,Only love can break your heart http://music/Saint%20Etienne/Foxbase%20Alpha/Only%20love%20can%20br #EXTINF:119,Wilson http://music/Saint%20Etienne/Foxbase%20Alpha/Wilson.ogg #EXTINF:283,Carnt sleep http://music/Saint%20Etienne/Foxbase%20Alpha/Carnt%20sleep.ogg (truncated on right to fit). Here, I'm using a server (hostname "music") to run Apache and serve the .ogg files out of DOCUMENT_ROOT/artist/album. The problem is the shell-script that builds the playlist in the first place (each time I rip a new CD). That shell-script has the name of the track (like "Carnt sleep") and uses that plus ".ogg" as the output filename. It then used that filename when creating the playlist. But from now on, playlists are to use URLs instead of pure filenames so I need to encode the URL. --- þ Synchronet þ Linus is a regular at The ANJO BBS. No, Linus Brathwaite! .