#!/usr/bin/perl -w use LWP::UserAgent; $ua = LWP::UserAgent->new; $ua->agent('Mozilla/5.0'); my $req = HTTP::Request->new(GET => 'http://sight.com/action.php?id=u1 +VInM4D'); $req->content_type('audio/x-mpeg'); # Pass request to the user agent and get a response back my $res = $ua->request($req); # Check the outcome of the response if ($res->is_success) { open FH, ">file.mp3"; print FH $res->content; close FH; }
In reply to Re^2: using LWP to download and save an mp3
by j3f
in thread using LWP to download and save an mp3
by j3f
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |