• 21-06-2013, 16:58:24
    #1
    function datacek($url, $proxy)
    {
        $browser = $_SERVER['HTTP_USER_AGENT'];
        $oturum = curl_init();
        curl_setopt($oturum, CURLOPT_URL, $url);
        if (preg_match('|https\:|isU', $url)) { curl_setopt ($oturum, CURLOPT_SSL_VERIFYPEER, false); }
        if ($proxy) {
            curl_setopt($oturum, CURLOPT_HTTPPROXYTUNNEL, 0);
            curl_setopt($oturum, CURLOPT_PROXY, $proxy);
        }
        curl_setopt($oturum, CURLOPT_USERAGENT, $browser);
        curl_setopt($oturum, CURLOPT_HEADER, 0);
        curl_setopt($oturum, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($oturum, CURLOPT_CONNECTTIMEOUT, 33);
        $cekilendatalar = curl_exec($oturum);
        curl_close($oturum);
        return $cekilendatalar;
    }
    Bu tarz bi' şey buldum mesela işime nasıl yarayabilir?

    Örneğin redtube'daki videoları Türkiye'den girişte DNS kullanmadan izletmek istiyorum. yapmam gereken nedir?
  • 22-06-2013, 10:34:59
    #2
    Proxy Server yada Stream Server kurmadan maalesef birşey yapamazsınız...
  • 22-06-2013, 11:07:25
    #3
    tecnohalil adlı üyeden alıntı: mesajı görüntüle
    Proxy Server yada Stream Server kurmadan maalesef birşey yapamazsınız...
    Kötü oldu bu ya.
  • 22-06-2013, 11:35:32
    #4
    Reveloper
    tekerlekli sandalyeyle

    bu kötü esprinin üzerine benim kodlarımı veriyim sana

    function getirxx($url){
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $x = curl_exec($ch);
        curl_close($ch); 
        return $x;
    }
    
    
    function redtube($x){
    	if(preg_match('#redtube-#i',$x)){
    		$id			= str_replace(array('redtube-','mp4'),'',$x);
    		$filename 	= "redtube-{$id}.cache";
    		$cachefile 	= "redtube-flv/cache/".$filename;
    		$cachetime 	= 10 * 60;
    		if (file_exists($cachefile)) {
    			if(time() - $cachetime < filemtime($cachefile)){
    				$flv = file_get_contents($cachefile);
    			}else {
    				unlink($cachefile);
    			} 
    		}else{
    			$bak 	= getirxx("http://www.redtube.com.nyud.net/".$id);
    			preg_match("|<source src='(.*)' type='video/mp4'>|",$bak,$ver);
    			$flv	= trim($ver[1]);
    			$flv	= urldecode($flv);
    			$fp 	= fopen($cachefile, "w+");
    			fwrite($fp, $flv);
    			fclose($fp);
    		}
    
    		return $flv;
    	}else{
    		return $x;
    	}
    }
  • 22-06-2013, 12:16:08
    #5
    Burti adlı üyeden alıntı: mesajı görüntüle
    tekerlekli sandalyeyle

    bu kötü esprinin üzerine benim kodlarımı veriyim sana

    function getirxx($url){
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $x = curl_exec($ch);
        curl_close($ch); 
        return $x;
    }
    
    
    function redtube($x){
    	if(preg_match('#redtube-#i',$x)){
    		$id			= str_replace(array('redtube-','mp4'),'',$x);
    		$filename 	= "redtube-{$id}.cache";
    		$cachefile 	= "redtube-flv/cache/".$filename;
    		$cachetime 	= 10 * 60;
    		if (file_exists($cachefile)) {
    			if(time() - $cachetime < filemtime($cachefile)){
    				$flv = file_get_contents($cachefile);
    			}else {
    				unlink($cachefile);
    			} 
    		}else{
    			$bak 	= getirxx("http://www.redtube.com.nyud.net/".$id);
    			preg_match("|<source src='(.*)' type='video/mp4'>|",$bak,$ver);
    			$flv	= trim($ver[1]);
    			$flv	= urldecode($flv);
    			$fp 	= fopen($cachefile, "w+");
    			fwrite($fp, $flv);
    			fclose($fp);
    		}
    
    		return $flv;
    	}else{
    		return $x;
    	}
    }
    Çok işime yaradı dostum çok sağol.