version 1.2, 2006/08/12 01:14:53 |
version 1.3, 2007/02/08 20:04:03 |
|
|
#!/usr/bin/perl -w |
#!/usr/bin/perl -w |
# $RedRiver$ |
# $RedRiver: addmp3playlist.pl,v 1.2 2006/08/12 00:14:53 andrew Exp $ |
######################################################################## |
######################################################################## |
# addmp3playlist.pl *** Adds MP3's to the playlist |
# addmp3playlist.pl *** Adds MP3's to the playlist |
# |
# |
|
|
######################################################################## |
######################################################################## |
# *** Variables *** |
# *** Variables *** |
my $DestDir = '/home/mp3/Sorted'; |
my $DestDir = '/home/mp3/Sorted'; |
my $filename = $ENV{'QUERY_STRING'}; |
|
my $playlist = '/var/www/mp3/playlist/playlist.lst'; |
|
|
|
|
|
|
|
|
|
######################################################################## |
######################################################################## |
if (! -d $DestDir) { mkdir $DestDir, 0777 } |
if (! -d $DestDir) { mkdir $DestDir, 0777 } |
|
|
|
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 $playlist = '/var/www/mp3/playlist/' . $prefix . $playlist; |
|
|
print "Content-Type: text/html\n\n"; |
print "Content-Type: text/html\n\n"; |
|
|
$filename =~ s/%(..)/pack("c",hex($1))/ge; |
|
|
|
if ($filename) { |
if ($filename) { |
print "<html>\n<head>\n\t<meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>"; |
print "<html>\n<head>\n\t<meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>"; |