#!/usr/bin/perl
# YOU MUST ISTALL "WWW::YouTube::Download" FIST
# HOW TO INSTALL "WWW::YouTube::Download"
# [win32] (active perl)
# start>run
# ppm install WWW::YouTube::Download
# [NIX]
# sudo cpan
# install WWW::YouTube::Download
use HTTP::Cookies;
use LWP::UserAgent;
use WWW::YouTube::Download;
my $client = WWW::YouTube::Download->new;
my $cookie_jar = HTTP::Cookies->new(autosave =>1, hide_cookie2=>1);
my $browser = LWP::UserAgent->new(
agent=>'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)',
timeout=>0,
max_redirect=>0,
cookie_jar=>$cookie_jar
);
my $video_id = $ARGV[0];
if(!$video_id){
print "[+] Input Youtube Link : ";
chomp($video_id=<stdin>);
}
$video_id =~s/.*youtu((\.be\/)|(be\.com\/watch\?v=))([^\&\s]+).*/$4/;
my $suffix = $client->get_suffix($video_id);
my $you_down = $browser->get("http://tinyurl.com/api-create.php?url=".$client->get_video_url($video_id))->content;
print "[+] VDO_ID $video_id\n";
print "[+] ($suffix) $you_down\n";
ที่มา : น่าจะ thd จำไม่ได้แล้ว