The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 19, 2019, 12:03:09 AM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: [Youtube][FLV Downloader]  (Read 3180 times)
basura
Rookie
**
Offline Offline

Posts: 13


View Profile
« on: June 15, 2007, 02:55:04 AM »

The code to download FLV video from Youtube....

<?php
// Being submitted...
if($_GET['youtube']) {
    // It has so run function "youtube_test" and redirect to that.
    $download = youtube_test($_GET['youtube']);
    header("Location: $download");
}
// Find the matches in the result
function youtube_test ($url) {
    $page = youtube_grap_page($url);
    if ($page === false) {
        // YouTube won't load...
        die("No connection to Youtube could be established.");
    }
    preg_match('/watch_fullscreen\?video_id=(.*?)&l=(.*?)+&t=(.*?)&/', $page, $match);
    $match1 = "http://www.youtube.com/get_video?video_id=";
    if(!$match[1]) {
        // Video doesn't exist...
        die("The video file does not exist on YouTube.");
    }
    $match1 .= $match[1];
    $match1 .= "&t=";
    $match1 .= $match[3];
    return $match1;
}
// Grab the YouTube page
function youtube_grap_page ($url) {
    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_HEADER, false);
    curl_setopt($curl, CURLOPT_VERBOSE, false);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    $output = curl_exec($curl);
    // Check for errors
    if (curl_errno($curl)) {
        trigger_error('CURL error: "' . curl_error($curl) . '"', E_USER_WARNING);
        $output = false;
    }
    curl_close($curl);
    return $output;
} ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb">
    <head profile="http://gmpg.org/xfn/11">
        <title>YouTube Downloader FLV Movie</title>
        <meta http-equiv="cache-control" content="no-cache" />
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <meta http-equiv="pragma" content="no-cache" />
        <meta name="author" content="MTVvui.com" />
        <meta name="description" content="Download youtube movie at flv to you pc." />
        <meta name="distribution" content="global" />
        <meta name="keywords" content="download, video, youtube, flash flv" />
        <meta name="last-modified" content="<?php echo date('l, dS F Y H:i:s T'); ?>" />
        <meta name="robots" content="index, follow" />
        <meta name="revisit-after" content="7 days" />
    </head>
   
    <body>
        <form action="<?php $_SERVER['PHP_SELF'] ?>" method="get">
            Enter YouTube Video: <input name="youtube" type="text" /> <input type="submit" value="Download FLV

files!" />
        </form>
        <p>e.g. http://youtube.com/watch?v=av6asdasfd</p>
    </body>
</html>

Logged

No links in signatures please
basura
Rookie
**
Offline Offline

Posts: 13


View Profile
« Reply #1 on: June 15, 2007, 03:08:24 AM »

You can get this same code into:

YourGrabber 0.20:
http://sourceforge.net/project/showfiles.php?group_id=178664


Wink

Logged

No links in signatures please
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #2 on: June 15, 2007, 07:07:25 AM »

Nice Bas - been wanting to do that actually. Great find, thanks!

/p
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
JasonD
Expert
****
Offline Offline

Posts: 100


View Profile
« Reply #3 on: July 12, 2007, 01:58:29 PM »

Do any of you guys have a PHP YouTube upload function to hand ?
Logged
JasonD
Expert
****
Offline Offline

Posts: 100


View Profile
« Reply #4 on: July 12, 2007, 02:27:20 PM »

Answered my own question.

http://www.phpclasses.org/browse/file/19568.html
Logged
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!