Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $headers = [];
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, 'https://i.instagram.com/api/v1/' . $url);
- curl_setopt($ch, CURLOPT_USERAGENT, 'Instagram 107.0.0.27.121 Android (11/1.3.1; 240; 768x1024; samsung; GT-I9100; GT-I9100; smdkc210; en_US)');
- curl_setopt($ch, CURLOPT_ENCODING, "gzip");
- curl_setopt($ch, CURLOPT_HEADER, true);
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies/'."{$cooki}-cookies.log"); // куда писать кукисы
- curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies/'."{$cooki}-cookies.log"); // откуда считывать кукисы
- curl_setopt($ch, CURLOPT_PROXY, $proxy);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_POST, true);
- if ($post_data) {
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
- }
- $resp = curl_exec($ch);
- $header_len = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
- $header = substr($resp, 0, $header_len);
- $body = substr($resp, $header_len);
- curl_close($ch);
- return [$header, $body];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement