YouTube Flv Grabber Script

I created a youtube grabber base on rayzz (youtube clone script) a PHP script allow you to save any video you find on YouTube.com directly to your PC in FLV format. Check out my script below:


<?php
function GrabVideo($url)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERAGENT, ‘Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2′);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$page = curl_exec($ch);
if (!curl_errno($ch))
curl_close($ch);
else
$page = false;
return $page;
}

if (isset($_GET['url'])){
$url=$_GET['url'];
$url=trim($url);

if (strstr($_GET['url'],”youtube.com”)){
$youtube_page =GrabVideo($_GET['url']);
preg_match(’/watch_fullscreen\?fs=(.*?)&vq=(.*?)&video_id=(.*?)&l=(.*?)&sk=(.*?)&fmt_map=(.*?)&t=(.*?)&hl=(.*?)&plid=(.*?)&/’, $youtube_page, $matches);
if ($matches && isset($matches[1]) && isset($matches[3])) {
Header(”Location: http://www.youtube.com/get_video?video_id=$matches[3]&l=$matches[4]&t=$matches[7]“);
}
}
}
?>

Form Code:

<form method="get" action="" name="form">
<input type="text" id="url" name="url" /><br>
<input type="submit" class="submit" value="Grab Video" />
</form>

How to use:
1. Copy and paste youtube url into the input field. example http://www.youtube.com/watch?v=QFrqKYwmhMc
2. Click Grab Video button and download panel will popup and save as get_video.flv or any filename but should have an extension of .flv
3. Download your Flv player here and enjoy!

Download my script here: Youtube Flv Grabber Script or you may also try our all in one youtube grabber or downloader. Click Here.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • Furl
  • Reddit
  • Smarking
  • StumbleUpon
  • Technorati
  • TwitThis
  • YahooMyWeb
  • Simpy
  • Propeller
  • Fark
  • LinkedIn
  • Live
  • Mixx

4 Comments »

  1. Good post.

    Comment by Tolla — October 28, 2008 @ 5:59 pm

  2. This is great,
    Thank you for creating this site. At least I don’t have to install any application in my restricted laptop :)

    Comment by abraham — January 24, 2009 @ 9:08 am

  3. Thanks i use this script its work fine :) but its need some fix :)

    Comment by nullsoft — June 23, 2009 @ 11:05 am

  4. http://softloads.in/programming/ultimate-youtube-grabber-script/

    This one looks much better with 3 format download.

    Comment by Akshay — August 7, 2009 @ 9:05 am

RSS feed for comments on this post. TrackBack URL

Leave a comment