1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

[wth] Programmer for YouTube Download Script

Discussion in 'Programming' started by kiteguy123, Jan 3, 2009.

  1. #1
    As the title says.

    I want to hire someone to make a script that allows users to download videos from youtube. The script then needs to automatically convert the videos into mp4 format, suitable for putting on an ipod.

    I'd just need the code to be able to embed this, not actually the whole webpage.

    Please contact me with your price and some examples of previous work.

    Thanks.
     
    kiteguy123, Jan 3, 2009 IP
  2. Num Lock

    Num Lock Active Member

    Messages:
    1,802
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    80
    As Seller:
    100% - 49
    As Buyer:
    100% - 0
    #2
    function get_http_header($url){
    $uh = curl_init();
    curl_setopt($uh, CURLOPT_URL, $url);
    curl_setopt($uh, CURLOPT_HEADER, 1);
    curl_setopt($uh, CURLOPT_RETURNTRANSFER, 1);
    $res = curl_exec($uh);
    curl_close($uh);
    return $res;
    }
    
    function show_url($http_header){
    $arai = explode(”\n”,$http_header);
    foreach($arai as $ini){
    if(eregi(”location”,$ini)) $url = $ini;
    }
    list($sampah,$hasil) = explode(”Location:”,$url);
    return str_replace(”\n”,”",trim($hasil));
    }
    
    function download_youtube($url){
    if(ereg(’&',$url)){
    if (eregi(”watch\?v=(.*)&”, $url, $out)) {
    $video_id = $out[1];
    }
    }
    else{
    list($none,$video_id) = explode(’watch?v=’,$url);
    }
    $secret_link = substr(show_url(get_http_header(’http://youtube.com/v/’.trim($video_id))),11);
    $video_url = show_url(get_http_header(’http://youtube.com/get_video?’.$secret_link));
    list($dl_url,$sign) = explode(”&signature”,$video_url);
    return $dl_url;
    }
    
    // EXAMPLE:
    echo download_youtube(’http://www.youtube.com/watch?v=5uy7SAidyTM’);
    ?>
    PHP:
    Taken from: http://sandalian.com/php/youtube-downloader-is-working-.html

    All you have to do is add &fmt=18 which will make it a mp4 format, and make a script that will pass the file with the extention .mp4 when downloaded

    I'm giving you this because when you hire a coder he won't have to do much so you can pay him less.

    Cheers :)
     
    Num Lock, Jan 3, 2009 IP
    kiteguy123 likes this.