Парсер инстаграмм
Пытаюсь спарсить инстаграмм,но не работал с протоколом ssl, нужно как-то подключиться, чтобы парсить любые акки без апи.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_COOKIEJAR, «1.txt»);
curl_setopt($ch, CURLOPT_COOKIEFILE, «1.txt»);
$result = curl_exec($ch);
но меня загоняет в бесконечный редирект 301
переменная csrftoken= меняется,если не ставить куки джар
что делать?
HTTP/1.1 301 Moved Permanently Strict-Transport-Security: max-age=86400 Content-Language: en Expires: Sat, 01 Jan 2000 00:00:00 GMT Vary: Accept-Language Location: https://www.instagram.com/moiakk/ Pragma: no-cache Cache-Control: private, no-cache, no-store, must-revalidate Date: Tue, 21 Jun 2016 15:06:06 GMT Content-Type: text/html; charset=utf-8 Connection: keep-alive Content-Length: 0 HTTP/1.1 200 OK Strict-Transport-Security: max-age=86400 Content-Language: en Expires: Sat, 01 Jan 2000 00:00:00 GMT Vary: Cookie, Accept-Language, Accept-Encoding Pragma: no-cache Cache-Control: private, no-cache, no-store, must-revalidate Date: Tue, 21 Jun 2016 15:06:06 GMT X-Frame-Options: SAMEORIGIN Content-Type: text/html Set-Cookie: csrftoken=pdgKIsRZQizsSXiJ0h5Bollh3RMLVODP; expires=Tue, 20-Jun-2017 15:06:06 GMT; Max-Age=31449600; Path=/ Set-Cookie: s_network=; expires=Tue, 21-Jun-2016 16:06:06 GMT; Max-Age=3600; Path=/ Connection: keep-alive Content-Length: 28450