Привет, есть скрипт:
curl:
$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, 'site.ru/images.jpg');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_NOBODY, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent2);
curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__) . '/cookie/'.$baseid.'.txt');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
if(session_name()==false){
curl_setopt($ch, CURLOPT_COOKIE, session_name() . '=' . session_id());
}
curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__) . '/cookie/'.$baseid.'.txt');
curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8","Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4","Accept-Encoding: gzip, deflate","Cache-Control: no-cache","Connection: Keep-Alive"));
curl_setopt($ch, CURLOPT_ENCODING, 1);
$html=curl_exec($ch);
curl_close($ch);
if(!$html){
usleep(mt_rand(100000,200000));
goto curl;
}
$size=getimagesize(substr($html, (strlen($html)-strlen(substr($html, strpos($html, "\r\n\r\n"))))+4));