=================================================================== RCS file: /cvs/mp3/bin/removemp3playlist.pl,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- mp3/bin/removemp3playlist.pl 2006/03/02 23:20:47 1.1.1.1 +++ mp3/bin/removemp3playlist.pl 2007/02/08 20:04:03 1.3 @@ -1,4 +1,5 @@ #!/usr/bin/perl -w +# $RedRiver: removemp3playlist.pl,v 1.2 2006/08/12 00:14:53 andrew Exp $ ######################################################################## # RemoveMP3Playlist.pl *** Removed MP3's from the playlist # @@ -12,22 +13,39 @@ #my qw/ $removed $filename $list /; ######################################################################## # *** Variables *** -my $filename = $ENV{'QUERY_STRING'}; -my $list = '/var/www/mp3/playlist/playlist.lst'; ######################################################################## # *** MAIN *** ######################################################################## +my ($prefix, $filename, $playlist) = split /\&/, $ENV{'QUERY_STRING'}; +if ($filename) { + $filename =~ s/%(..)/pack("c",hex($1))/ge; +} else { + $filename =''; +} +if ($playlist) { + $playlist =~ s/%(..)/pack("c",hex($1))/ge; +} else { + $playlist ='playlist.lst'; +} +if ($prefix) { + $prefix =~ s/%(..)/pack("c",hex($1))/ge; +} else { + $prefix =''; +} + +my $list = '/var/www/mp3/playlist/' . $prefix . $playlist; + my @playlist = get_playlist($list); $filename =~ s/%(..)/pack("c",hex($1))/ge; my $removed = 0; my $oldfilename; print "Content-Type: text/html\n\n"; -print "\n
\n\t