| version 1.1, 2006/03/02 23:20:47 |
version 1.3, 2007/02/08 20:04:03 |
|
|
| #!/usr/bin/perl -w |
#!/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 |
# RemoveMP3Playlist.pl *** Removed MP3's from the playlist |
| # |
# |
|
|
| #my qw/ $removed $filename $list /; |
#my qw/ $removed $filename $list /; |
| ######################################################################## |
######################################################################## |
| # *** Variables *** |
# *** Variables *** |
| my $filename = $ENV{'QUERY_STRING'}; |
|
| my $list = '/var/www/mp3/playlist/playlist.lst'; |
|
| |
|
| |
|
| |
|
| ######################################################################## |
######################################################################## |
| # *** MAIN *** |
# *** 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); |
my @playlist = get_playlist($list); |
| $filename =~ s/%(..)/pack("c",hex($1))/ge; |
$filename =~ s/%(..)/pack("c",hex($1))/ge; |
| my $removed = 0; |
my $removed = 0; |
| my $oldfilename; |
my $oldfilename; |
| |
|
| print "Content-Type: text/html\n\n"; |
print "Content-Type: text/html\n\n"; |
| print "<html>\n<head>\n\t<meta HTTP-EQUIV='Pragma' CONTENT='no-cache'> <title>Added $filename</title>\n<body>\n\n"; |
print "<html>\n<head>\n\t<meta HTTP-EQUIV='Pragma' CONTENT='no-cache'> <title>Removed $filename</title>\n<body>\n\n"; |
| |
|
| # Print_Nav(); |
# Print_Nav(); |
| my $i; |
my $i; |