Curl OR file_get_contents请求:返回Captcha验证

时间:2014-11-03 09:14:08

标签: php iframe curl

我正在复制一首歌(IFRAME代码)从其他网站(如Youtube)进入我的网站,(其法律要复制iframe代码)

使用get file_get_contents($url); 或CURL

  

250网址file_get_contents无效后,返回验证码

     

和网址(从250到500)网址CURL无效:返回空

500 urls后两者都无效,

我要做的是验证我不是一个抢劫。

我的file_get_contents代码是:

function getf($url){
    $ctx = stream_context_create(array(
            'http' => array('timeout' => 50))
    );
    $html = file_get_contents($url, 0,$ctx);
    return $html;
}

OR CURL CODE ,,,

function curlm($url){
        $toSet[CURLOPT_CONNECTTIMEOUT] = 20; // Time to wait for connection
        $toSet[CURLOPT_TIMEOUT] = 50; // Time to wait for whole operation
        $toSet[CURLOPT_RETURNTRANSFER] = true; // Return transfer instead of printing
        $toSet[CURLOPT_FAILONERROR] = true;
        //
        $toSet[CURLOPT_USERAGENT] = $_SERVER['HTTP_USER_AGENT'];
        //
        // Show SSL without verifying
        $toSet[CURLOPT_SSL_VERIFYPEER] = false;
        $toSet[CURLOPT_SSL_VERIFYHOST] = false;
        //
        // Start curl
        $curl = curl_init($url);
        //
        // Load options
        curl_setopt_array($curl, $toSet);
        //
        // Fetch page
        $return = curl_exec($curl);

        // Check for curl errors
        if ( $error = curl_error($curl) )
            echo 'ERROR: ',$error;

        curl_close($curl);
        return $return;
}

我需要完整的HTML代码,如果您知道获取无限URL的完整HTML的任何其他方式,请告诉我

OR

  

替代从其他服务器获取HTML的get_file_contentCurl

OR

请在任何一个函数或两者中提供解决方案,这些解决方案可以在数百万个URL上工作而不返回Captcha verfication

1小时后再次开始工作......但我想继续文件内容

  

如果我清理缓存或使用代理,仍然是get_file_content返回:验证验证和卷曲返回为空,

     

我确定响应服务器阻止我的域名服务器IP 1小时;

0 个答案:

没有答案
相关问题