Perl-Tube
April 28, 2008 - 8:22 pm
-
#!/usr/bin/perl -w
-
use WWW::Mechanize;
-
my $mech = WWW::Mechanize->new(); #creates a new object
-
($t = $mech->get("http://www.youtube.com/v/$_")->request->uri) =~ s/.*&t=(.+)/$1/; #code to give the right url for the video
-
$mech->get("http://www.youtube.com/get_video?video_id=$_&t=$t", ":content_file" => "$_.flv" ); # code for download the video
