• 10-07-2014, 20:11:04
    #1
    Merhaba hocalar

    bir botum var yabancı bir siten truck ilanlarını çeken.

    sanırım şöyle bir sorun var türkiyede bulunan bir hostumda rahatça çekebiliyorum.

    fakat almanya lokasyonlu hostingimden çekemiyorum.diğer sitelerde çekiliyor.

    farklı bir almanya lokasyonlu sunucuda çekebiliyorum.

    bu hatayı veriyor:



    Kodlarım da bunlar :

    function veriCagir($siteURL){
    
    $ch = curl_init();
    
    curl_setopt($ch, CURLOPT_URL, $siteURL);
    
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"); 
    
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Cookie: PHPSESSID=abcdefghijklm'));
    
    $gelVeri = curl_exec($ch);
    
    curl_close($ch);
    
    return $gelVeri;
    
    }
  • 10-07-2014, 21:35:38
    #2
    Porxy ile baglanmayı dener misin?
  • 10-07-2014, 21:54:32
    #3
    Erden35 adlı üyeden alıntı: mesajı görüntüle
    Porxy ile baglanmayı dener misin?
    Timeout hatası veriyor hocam çok uzun sürüyor
  • 10-07-2014, 23:39:11
    #4
    Developer
    function veriCagir($siteURL){
     
    $ch = curl_init();
     
    curl_setopt($ch, CURLOPT_URL, $siteURL);
     
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"); 
     
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
    curl_setopt($ch, CURLOPT_FAILONERROR, 0);
     
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Cookie: PHPSESSID=abcdefghijklm'));
     
    $gelVeri = curl_exec($ch);
     
    curl_close($ch);
     
    return $gelVeri;
     
    }
    bu şekilde dener misiniz ?
  • 10-07-2014, 23:55:12
    #5
    brown adlı üyeden alıntı: mesajı görüntüle
    function veriCagir($siteURL){
     
    $ch = curl_init();
     
    curl_setopt($ch, CURLOPT_URL, $siteURL);
     
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"); 
     
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
    curl_setopt($ch, CURLOPT_FAILONERROR, 0);
     
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Cookie: PHPSESSID=abcdefghijklm'));
     
    $gelVeri = curl_exec($ch);
     
    curl_close($ch);
     
    return $gelVeri;
     
    }
    bu şekilde dener misiniz ?
    malesef hocam yine aynı hata.ben hostingden kaynaklanır diyorum ama hostingci çözüm bulamıyor ilginç.
  • 11-07-2014, 00:36:27
    #6
    Kimlik doğrulama veya yönetimden onay bekliyor.
    IP ban yemiş olabilirsin. Proxy kullanmayı denemelisin.
  • 11-07-2014, 01:54:31
    #7
    CURL ile IP adresi set edilemiyor. Bu muhtemelen kullandığınız sunucunun IP'sinin ban yediği ile ilgili görünüyor. Başka sunucularda (yani IP adreslerinde) çalışıyorsa bu anlama gelir.

    Şu kodu bir deneyin. Bazı yerlerde çalışmış
    curl_setopt( $ch, CURLOPT_HTTPHEADER, array("REMOTE_ADDR: $ip", "HTTP_X_FORWARDED_FOR: $ip"));
    Kaynak: http://stackoverflow.com/questions/1...url-ip-address
  • 11-07-2014, 09:33:52
    #8
    mtl adlı üyeden alıntı: mesajı görüntüle
    CURL ile IP adresi set edilemiyor. Bu muhtemelen kullandığınız sunucunun IP'sinin ban yediği ile ilgili görünüyor. Başka sunucularda (yani IP adreslerinde) çalışıyorsa bu anlama gelir.

    Şu kodu bir deneyin. Bazı yerlerde çalışmış
    curl_setopt( $ch, CURLOPT_HTTPHEADER, array("REMOTE_ADDR: $ip", "HTTP_X_FORWARDED_FOR: $ip"));
    Kaynak: http://stackoverflow.com/questions/1...url-ip-address
    Malesef hocam, ümitlenmiştim bu kodla ama çalışmadı

    dediğiniz gibi büyük ihtimal ip blok var.

    edit : bu şekilde yaptım ben ama ?

    function veriCagir($siteURL){
    	$ip = "88.198.58.7";
    	$ch = curl_init();
    	/*
    	curl_setopt($ch, CURLOPT_URL, $siteURL);
    	curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"); 
    	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    	curl_setopt($ch, CURLOPT_HTTPHEADER, array('Cookie: PHPSESSID=abcdefghijklm'));
    	*/
    	
    	curl_setopt($ch, CURLOPT_URL, $siteURL);
    	curl_setopt($ch, CURLOPT_USERAGENT, 'Googlebot/2.1 (+http://www.google.com/bot.html)');
    	curl_setopt( $ch, CURLOPT_HTTPHEADER, array("REMOTE_ADDR: $ip", "HTTP_X_FORWARDED_FOR: $ip"));  
    	curl_setopt($ch, CURLOPT_HEADER, 1);
    	@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
    	curl_setopt($ch, CURLOPT_REFERER, 'http://www.google.com');
    	curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
    	curl_setopt($ch, CURLOPT_AUTOREFERER, true);
    	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    	curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    	$gelVeri = curl_exec($ch);
    	curl_close($ch);
    
    	return $gelVeri;
    }