Главная PHP - скрипты для вконтакте Скачиваем все картинки из альбома (Группа+Пользователь)


Скачиваем все картинки из альбома (Группа+Пользователь)

Не знаете как запустить PHP - скрипт? Прочтите эту статью

<?

set_time_limit(0);
error_reporting(E_ERROR | E_PARSE);

function go($link){

$mail=' Этот e-mail адрес защищен от спам-ботов, для его просмотра у Вас должен быть включен Javascript ';
$pass='pass';
$id='22671298';

$cookie='remixmid='.$id.'; remixemail='.$mail.'; remixpass='.md5($pass).'; remixlang=3; remixchk=5; remixap=1; '.$cookie_hash;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_GET, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);

$otvet = curl_exec($ch);
curl_close($ch);
return $otvet;
}

$os='win'; //если ваша Операционная система windows
//$os='nix'; //если другая

//$album_id='album7269_39591153'; //если скачиваем у человека, то выглядит так
$album_id='album-707889_6491024'; //если скачиваем из группы, то выглядит так

$otvet=go('http://vkontakte.ru/'.$album_id);

$begin = '"summary">';
$begin = strpos($otvet, $begin) + strlen($begin);
$end = ' ';
$end = strpos($otvet, $end, $begin);
$all_foto = substr($otvet, $begin, $end - $begin);

print "\nfoto to save==".$all_foto."\n\n";

$begin = '<a href="/photo';
$begin = strpos($otvet, $begin) + strlen($begin);
$end = '"';
$end = strpos($otvet, $end, $begin);
$foto_id = substr($otvet, $begin, $end - $begin);

$otvet=go('http://vkontakte.ru/photo'.$foto_id);
$count=substr_count($otvet,'.jpg", "http:\/\/');

$end=0;
for($i=0;$i<$count;$i++){

$otvet=substr($otvet,$end);

$begin = '.jpg", "http:\/\/';
$begin = strpos($otvet, $begin) + strlen($begin);
$end = '"';
$end = strpos($otvet, $end, $begin);
$foto_url = substr($otvet, $begin, $end - $begin);

$foto_url=str_replace('\\','',$foto_url);

$foto=file_get_contents('http://'.$foto_url);
// print $foto;
$name=explode('/',$foto_url);

$dir=dirname($_SERVER['PHP_SELF']);
if ($os=='win'){
$slash='\\';
}else{
$slash='/';
}

mkdir($dir.$slash.'foto');

$output = fopen($dir.$slash.'foto'.$slash.$name[2].'-'.$name[3], "wb");
fwrite($output, $foto);
fclose($output);

print $i."\n";
}

print "\n\n----------\n(c) Le][\n";

?>

 


Вы можете сохранить статью в закладки:


загрузка...

 

Вы можете войти через:

Добавить комментарий


Важные новости

загрузка...

Поиск

Комментарии

  • [o_0][o_0]wormi xx.ucoz[o_0]/ - Новый накрутчик пр... More...
  • Можно отправить подарок другу или любимому человек... More...
  • :-* More...
  • фак,я не знаю что мне делать ,коое тут такая тема,... More...
  • :lol: :lol: :lol: More...

Статистика

Rambler's Top100
загрузка...