Youtube downloader

premiumsource

Senior Member
Joined
Apr 20, 2008
Messages
843
Reaction score
1,186
OK guys I need some help here. I have Any Video Converter Professional to download vids but there is only like 10% of the videos I can download, and usually terrible ones too. What do you do in order to download any video from youtube? Any help is appreciated. Thanks.
 
Needs: Perl , LWP.

perl script.pl http://youtube.com/watch?v=vCsQLQ00hvs

it will download and save to Title .FLV ...
If you want it in a different format, you have to handle it yourself :D

Code:
#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;
use LWP::UserAgent;

print "starting first page retrievaln";
my $urlin  = shift || "http://youtube.com/watch?v=vCsQLQ00hvs";
my $content = get( $urlin  ) or die "argh : $!n";
print "done first page retrieval : $urlinn";

my $infile     = ($content =~ m{<title>([^<]+)</title>})[0] . '.flv';
my ($video_id) = ($content =~ /watch_fullscreen?(?:.*?)video_id=([^&]+)/);
my ($t_id)     = ($content =~ /watch_fullscreen?(?:.*?)t=([^&]+)/);

my $get_url = "http://www.youtube.com/get_video?video_id=$video_id&t=$t_id";

print "gettin video file : $infilen";

$| = 1;
open(IN,"> $infile") or die "$_n";
my $ua = LWP::UserAgent->new();
my $received_size = 0;
my $url = $get_url;
print "Fetching $urln";
my $request_time = time;
my $last_update = 0;
my $response = $ua->get($url,
                        ':content_cb'     => &callback,
                        ':read_size_hint' => 8192,
                       );
print "n";
close IN;


sub callback {
  my ($data, $response, $protocol) = @_;

  my $total_size = $response->header('Content-Length') || 0;
  $received_size += length $data;
  print IN $data;
  my $time_now = time;
  return unless $time_now > $last_update or $received_size == $total_size;
  $last_update = $time_now;
  print "rReceived $received_size bytes";
  printf " (%i%%)", (100/$total_size)*$received_size if $total_size;
  printf " %6.1f/bps", $received_size/(($time_now-$request_time)||1)
  if $received_size;
}
 
Last edited:
you can try my software, tubetilla.com
downloads and converts youtube vids

or you can use vixy.net, tubegrip.com, keepvid.com, etc
 
OK, thanks to everyone that tried to help. tubegrip worked the best for what I wanted to accomplish.
 
vixy.net kick but , they have a free desktop software to download and convert youtube video it the fastest I have ever seen
 
Back
Top