Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login error #359

Open
bugbaal opened this issue Sep 12, 2023 · 8 comments
Open

Login error #359

bugbaal opened this issue Sep 12, 2023 · 8 comments
Assignees
Labels
need-investigations Need investigations to classify

Comments

@bugbaal
Copy link

bugbaal commented Sep 12, 2023

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

@bugbaal bugbaal added the need-investigations Need investigations to classify label Sep 12, 2023
@bugbaal
Copy link
Author

bugbaal commented Sep 28, 2023

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.

@sasha2002
Copy link

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

@kabadabra
Copy link

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.

@sasha2002
Copy link

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)
}

@n1crack
Copy link
Contributor

n1crack commented Dec 27, 2023

@sasha2002
Copy link

sasha2002 commented Feb 1, 2024

@n1crack No it's not working, same error, as i see now csrf is extracted.
Maybe this is because we have username as email ?

Another things, #PWD_INSTAGRAM_BROWSER:**10**:$TIME$:$BASE64_STRING$ have 10 not 0 as in code
I'm unable to decode this base64 string
and $response = json_decode((string) $query->getBody()); is null because getBody return HTML

@gregorysouzasilva
Copy link

Same error message: "First parameter must either be an object or the name of an existing class". However just in production. Local works fine. Prob blocking the IP of my server.

@Amir1372GT
Copy link

Amir1372GT commented May 30, 2024

I got the same err

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

Please tell us, how can we fix this? @pgrimaud

EDIT:
I think it has sth to do with Instagram
Because I "var_dump((string) $query->getBody());" before $response = json_decode((string) $query->getBody());
and it showed the Instagram preload page.

As humans when entering Instagram.com, we will wait for a few seconds until Instagram web shows us its fully loaded page But this robot doesn't. I think this may be the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-investigations Need investigations to classify
Projects
None yet
Development

No branches or pull requests

7 participants