Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- # YOU MUST INSTALL "WWW::YouTube::Download" FIRST
- # 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/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36',
- timeout=>8,
- 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";
- <stdin>;
Add Comment
Please, Sign In to add comment