Youtube Grabber (almost)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Youtube Grabber (almost)

    Ok, well, it's not complete as such, but all it needs is the code to copy the video or force download headers, etc... It gets the video url, etc, just needs the last step coding, n I'm over it for now, lol...

    PHP Code:
    <HTML>
    <HEAD>
     <TITLE>YouTube Grabber</TITLE>
    </HEAD>
    <BODY>
    <?php
    function fwrite_stream($fp$string) {
        for (
    $written 0$written strlen($string); $written += $fwrite) {
            
    $fwrite fwrite($fpsubstr($string$written));
            if (
    $fwrite === false) {
                return 
    $written;
            }
        }
        return 
    $written;
    }

    if (isset(
    $_GET['furl']))
    {
    //this bit needs fixing...
    //
    $url $_GET['furl'];
    $tit $_GET['tit'];
    $file $tit;
     
    //not working...
    $current file_get_contents($url);

    $fp fopen($file'w');

    fwrite_stream($fp$current);
    fclose($fp);
    }
    if (isset(
    $_GET['vid']))
    {
    $vid $_GET['vid'];
    }
    else
    {
    $vid "8V8FIEDGo2k";
    }
    $data file_get_contents("http://gdata.youtube.com/feeds/mobile/videos/$vid");
    preg_match_all("/<media:content url='(.*)'/i"$data$a);
    preg_match_all("/<title type='text'>(.*)/i"$data$title);
    $count count($a[1]);
    $titles count($title[1]);
    echo 
    "<b>Number of Urls</b> = " .$count."<p>";
    for (
    $row 0$row $count $row++)
    {
    $data1 $a[1]["$row"];
    $url str_replace("' type='video/3gpp' medium='video' isDefault='true' expression='full'"""$data1);
    $url str_replace(" yt:format='1'/>"""$url);
    $url explode(" "$url);
    $url $url[0];
    $tit $title[1]["0"];
    $tit1 str_replace("</title>"""$tit);
    $tit explode("<con"$tit1);
    $tit1 $tit[0];
    $tit str_replace(" ""_"$tit1);
    $tit str_replace(":"""$tit);
    $tit str_replace("'"""$tit);
    $tit str_replace("("""$tit);
    $tit str_replace(")"""$tit);
    $tit str_replace('"'""$tit);
    echo 
    "Title: ".$tit1."<br/><img src=\"http://img.youtube.com/vi/".$vid."/default.jpg\" /><br>";
    echo 
    "<a href=\"$url\">Click To Watch</a><br/><a href=\"?furl=$url&tit=$tit.3gp\">Click To Download</a> - Not Working<hr>";
    }

    echo 
    "Enter Youtube Video ID:<br/>ie:http://www.youtube.com/watch?v=<b><i>8V8FIEDGo2k</i></b><br/>The highlighted bit in the url above...<br/>";
    echo 
    "<form action='index.php' method='GET'><input type='text' name='vid'><br/><input type='submit' value='Get Video'><br/></form>";
    ?>
    </BODY>
    </HTML>
    hope someone can finish this code n make a dwnload.php file or whatever, then you got a youtube grabber running straight off youtube
    C3 Themes: http://c3themes.wen.ru/index.html
    Find Files: http://mystarter.tk/?goto=X-search

    #2
    you know that youtube will change api and stuff again and again all grabers wont work ,again..

    Comment


      #3
      yeah, i know... but so far i got the rtsp link, so just trying to figure out how to download the the file... keeps loading it as streaming video on my phone, lol...
      C3 Themes: http://c3themes.wen.ru/index.html
      Find Files: http://mystarter.tk/?goto=X-search

      Comment


        #4
        this method won't work again now youtube working on youtube 2.0 & 3.0, old v 1.0 is getting shut

        Comment


          #5
          hello,
          whether it can be used for you?



          http://wapmu.tk/yt/

          I really want it, is there anything here that would like to share (if it works)

          Comment


            #6
            that's a pretty neat site mate, is it yours?

            this script here
            Last edited by pmbguy; 13.11.13, 10:00. Reason: adding link
            C3 Themes: http://c3themes.wen.ru/index.html
            Find Files: http://mystarter.tk/?goto=X-search

            Comment


              #7
              thanks

              no, I found it on google

              Comment

              Working...
              X