www.webdeveloper.com
Results 1 to 2 of 2

Thread: need help - improve php Youtube downloader to Ajax funcion

  1. #1
    Join Date
    Jul 2006
    Posts
    44

    Arrow need help - improve php Youtube downloader to Ajax funcion

    Hi
    fist you can call me stup but realy am i.. i realy good about php but not a things about ajax..

    i have small scipt of php for download youtube video and other popular video site..
    please check my demontra at http://www.mtvvui.com/videodownloader.php
    when you enter the url of video link it will return a link to flv file by
    Header("Location: http://www.youtube.com/ .....
    so vister can save file video on pc
    affter make it work i have see around and got some more idea which come from similar site.. they make small space on web call loader or loading, it checking the return video file then make a link on web site to the download url or show the error if the file not exit or script can make it work..

    im realy happy if some one can help me out... to add that little Ajax to this code

    my small php code is download here
    http://www.megaupload.com/?d=QPEY7POU
    pass open zip is: xaluan.com

    or it here
    PHP Code:
    ////////////////////////
    <?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($curlCURLOPT_HEADERfalse);
        
    curl_setopt($curlCURLOPT_VERBOSEfalse);
        
    curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);
        
    $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="copyright" content="Copyright (c) www.MTVvui.com 2007 - <?php echo date('Y'); ?>" />
            <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. <em>http://youtube.com/watch?v=av6fWfmugds</em></p>
            <!-- please keep this copyright as support to coder, it will update soon to have more function download from google, dailimotion or cliptv ... please visit sponsor www.mtvvui.com  --> 
            <p>Created by <a href="http://www.mtvvui.com/" title="top vietname entertai  video and music colection"> www.MTVvui.com best online for more entertainment</a></p>
        </body>
    </html>
    //////////////////

    thanks for any help

  2. #2
    Join Date
    Jul 2006
    Posts
    44

    resolved solved.. youtube google videodownloader script with ajax

    HI at last i work out the sript youtube google downloader..
    and now not only download video from youtube or google but include dozen of popular video web site.. dailymotion bliptv metacaffe.. and lot more..

    whit ajax now i can download the movie on fly without open new pages or reload pages.. it also come with seach function for any one need to confirm the video befor download..

    have look at: http://www.mtvvui.com/videodownloader.php ..
    ......
    and some guy asked me for purchased this script.. so i thinks it okey for any webmaster have good website..
    notice that only downloader with ajax function is for sell ( i not going sell all code on my mtvvui.com ) so you guy can come to that downloader page and have look.. it easy to intergated to any web paged with php ( no need data or PEAR ) by include(''....")
    i will send this out for 25$ each.. just email me[ binhaus at yahoo.com ]to require this, i will send you the link to download .. ( only accept paypal payment ) group buy is 20$ for 5 .. hope you guy use it nice on your web...
    kind regards

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles