• 15-08-2010, 22:54:09
    #1
    <?php ob_start();
    function get_data($url) 
    { 
            $ch = curl_init(); 
            $timeout = 10; 
              
            curl_setopt($ch,CURLOPT_URL,$url); 
            curl_setopt($ch,CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3'); 
            curl_setopt($ch,CURLOPT_HEADER,1); 
            curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); 
            curl_setopt($ch,CURLOPT_REFERER,"http://www.google.com/"); 
            curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); 
            $data = curl_exec($ch); 
            curl_close($ch); 
            return $data; 
    } 
    ini_set("max_execution_time",""); 
    
    $url = $_GET['v']; 
    $v = $url; 
    
    $file=get_data("http://www.youtube.com/watch?v=".$v); 
    $adres1 = explode('fmt_url_map=',$file); 
    $adres1 = explode('&',$adres1[1]); 
    $adres1 = urldecode($adres1[0]); 
    $flvadres = end(explode("|", $adres1)); 
    
    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_URL, $flvadres); 
    curl_setopt($ch, CURLOPT_HEADER, 0); 
    curl_setopt($ch, CURLOPT_NOBODY, 0); 
    curl_setopt($ch, CURLOPT_REFERER, "http://www.google.com/"); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 
    curl_setopt($ch, CURLOPT_WRITEFUNCTION,"progress_function"); 
    $data = curl_exec($ch); 
    $i = 0; 
    function progress_function($ch,$str) {   
          global $i,$_GET; 
        if($i == 0) 
        { 
            $info = curl_getinfo($ch); 
            header('Content-type: video/x-flv'); 
            header("Content-Disposition: attachment; filename=\"divxklip-" . $_GET['v'] . ".flv\""); 
            header("Content-Length: " . $info['download_content_length']); 
            $i = 1; 
        } 
        echo $str;   
        return strlen($str); 
    } 
    curl_close($ch); 
    
    ?>

    ekranda hata yazıları cıkyıordu başına <?php ob_start(); bunu koydm hata kalktı fakat videoyu abartısz 3dk sonra veriyor çok bekliyor sebebi nedir sizce????
  • 15-08-2010, 23:06:56
    #2
    php güncelledinmi?

    5.3 de bu sorunu yaşayabilirsin, 5.2.14 kur.
  • 15-08-2010, 23:11:43
    #3
    5.2.14 bunu kurunca oldu sorun zaten ?? ne ettysem çözemedim
  • 15-08-2010, 23:15:55
    #4
    Misafir adlı üyeden alıntı: mesajı görüntüle
    5.2.14 bunu kurunca oldu sorun zaten ?? ne ettysem çözemedim
    eminmisin? bende bir daha kontrol et, ben 5.2.14 te sorunsuz kullanıyorum, 5.3 te bu yazdığın sorunu yaşadım.
  • 15-08-2010, 23:26:22
    #5
    olabilr peki bunu 5,3 uyarlanamaz mı
  • 17-08-2010, 01:34:35
    #6
    5.2.14 php sürümü fakat videoyu vermıyor bazen acık unutoyrm 2.3dk sonra veriyor php fonksiyonlarından hangisi on of olmalıdır sizce ne engel oluyor olabilir