diff --git a/src/InstagramScraper/Instagram.php b/src/InstagramScraper/Instagram.php index d1059aaf..b0318b4a 100644 --- a/src/InstagramScraper/Instagram.php +++ b/src/InstagramScraper/Instagram.php @@ -252,6 +252,10 @@ private function generateHeaders($session, $gisToken = null) $headers['x-instagram-gis'] = $gisToken; } } + + if (empty($headers['x-csrftoken'])) { + $headers['x-csrftoken'] = md5(uniqid()); // this can be whatever, insta doesn't like an empty value + } return $headers; }