#!/usr/bin/perl # # This software may be used and distributed according to the terms # of the GNU Public License, incorporated herein by reference # # MyNapster WebClient copyright 2000 # info@mynapster.com # # You are welcome to modify and distribute this code use CGI qw(:standard); use lib "/home/mynapste/www/cgi-bin"; use napster; use DBI; use strict; $SIG{'HUP'} = \&puke; $SIG{'INT'} = \&puke; $SIG{'KILL'} = \&puke; $SIG{'PIPE'} = \&puke; $SIG{'ALRM'} = \&puke; alarm 600; my $size = url_param('size'); my $song = CGI::unescape(url_param('song')); my $nap_ip = url_param('nap_ip'); my $nap_port = url_param('nap_port'); my $nick = url_param('nick'); my $cookie_nick = cookie('nick'); my $cookie_pass = cookie('pass'); my $res; my $mynapster = Napster->new($cookie_nick, $cookie_pass); my ($ip, $port) = $mynapster->connect($nap_ip, $nap_port); if ($ip == -1) { $res = -666; } else { $res = $mynapster->get_song($song, $nick, $size); }; if ($res < 0) { print header; print p, h3("Could not download a file, reason : $res"); print end_html; } sub puke { die; }