Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- ИЗМЕНИТЬ ДАННЫЕ ДОСТУПА
- */
- $mail = 'ЛОГИН';
- $pass = 'ПАРОЛЬ';
- $otvet=connect("http://login.vk.com/?act=login&email=$mail&pass=$pass");
- If(!preg_match("/hash=([a-z0-9]{1,32})/",$otvet,$hash)){
- die("Login incorrect");
- }
- $otvet=connect("http://vk.com/login.php?act=slogin&hash=".$hash[1]);
- preg_match("/remixsid=(.*?);/",$otvet,$sid);
- $cookie = "remixchk=5; remixsid=$sid[1]";
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, 'http://vk.com/video5635006_163692379'); //получаем тестовое видео
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
- curl_setopt($ch, CURLOPT_COOKIE, $cookie);
- $result = curl_exec($ch);
- $data = iconv('cp1251', 'utf-8', $result);
- /**/
- preg_match_all('/\\"thumb\\\":\\\"(.*?)\\\",/',$data,$match); //вытягиваем превью
- $img = $match[1][0];
- var_dump($img); //получаем картинку
- curl_close($ch);
- function connect($link,$cookie=null,$post=null){
- $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_HEADER, 1);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
- if($cookie !== null)
- curl_setopt($ch, CURLOPT_COOKIE, $cookie);
- if($post !== null)
- {
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
- }
- $otvet = curl_exec($ch);
- curl_close($ch);
- return $otvet;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement