pgrimaud/instagram-user-feed

Login error

bugbaal opened this issue · 8 comments

Version(s) affected:
6.16.4

Description
Login error

How to reproduce
$client = new Client
([
'proxy' =>
[
"http" => "my_proxy"
],
]);
$cachePool = new FilesystemAdapter('instagram', 0, DIR . '/cache/' );
$api = new Api($cachePool, $client);
$api->login( $insta_username, $insta_password );

The login generate an Instagram Exception:
"Unable to extract JSON data"

Any help is appreciated.
Thanks

I noticed that the problem is in the Login class (Login.php) row: 75
the preg_match returns nothing:
preg_match('/<script type="text\/javascript">window._sharedData\s?=(.+);</script>/', $html, $matches);
So, it goes in the exception in the row 75
I hope this can help.

PHP Fatal error: Uncaught TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, null given in /var/www/mon/vendor/pgrimaud/instagram-user-feed/src/Instagram/Auth/Login.php:116

PHP Fatal error: Uncaught TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, null given in /var/www/mon/vendor/pgrimaud/instagram-user-feed/src/Instagram/Auth/Login.php:116

I get the same error "First parameter must either be an object or the name of an existing class". $response is returning null, the $query doesn't seem to contain a compatible payload anymore.

After some var_dump found that cookies are not set :

object(GuzzleHttp\Cookie\CookieJar)#40 (2) {
  ["cookies":"GuzzleHttp\Cookie\CookieJar":private]=>
  array(0) {
  }
  ["strictMode":"GuzzleHttp\Cookie\CookieJar":private]=>
  bool(false)
}