Closed badpenguin closed 4 years ago
same issue here
ok sorry .... found so many bug similar to mine, so i'll close it for now
@badpenguin Maybe can help you.
I create my script
$cache = new Psr16Adapter('Files');
$instagram = \InstagramScraper\Instagram::withCredentials('jayson.tec', '******', $cache);
$instagram->login(false, true); // will use cached session if you want to force login $instagram->login(true)
$instagram->saveSession(); //DO NOT forget this in order to save the session, otherwise have no sense
sleep(2); // Delay to mimic user
$username = 'jayson.tec';
$followers = [];
$account = $instagram->getAccount($username);
And I run the command from terminal
php /Users/jaysonsantos/projects/instagran/test.php
First time ask for verification code.
But even after put verification code, after a few request ask the verification code again.
I change the userAgent, I'm using an mac computer, now is working
private $userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36';
@jaysongyn thanks i see i can enter the code received via email... this will not work in a crontab too :-( I used setUserAgent() after creating instance with withCredentials().
Anyway two big problems: 1) cache does not work and session are not reused - it ask me everytime the password
$adapter = new Psr16Adapter('Files', new ConfigurationOption(array(
'path' => $cacheDir
)));
$this->scraper = Instagram::withCredentials( configGet('instagram_username'), configGet('instagram_password'), $adapter);
$this->scraper->setUserAgent('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/83.0.4103.44 Chrome/83.0.4103.44 Safari/537.36');
2) running "getMediasByTag()" decoding does not work :-(
src/InstagramScraper/Instagram.php:941 Response decoding failed. Returned data corrupted or this library outdated. Please report issue
@badpenguin here has an example how you can verify by email
https://github.com/postaddictme/instagram-php-scraper/tree/master/examples/twoStepAutoVerification
My session is working after I change user agent. The fist time I type the code manually because session is one year.
@badpenguin here has an example how you can verify by email
https://github.com/postaddictme/instagram-php-scraper/tree/master/examples/twoStepAutoVerification
My session is working after I change user agent. The fist time I type the code manually because session is one year.
Thank you. Does not work for me. Probably I've to create a new account.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Its 7 days maybe that i cannot login anymore. The response is 400 with checkpoint_required. I already tried to say them "it was me" but without luck. Any suggestions on what to do?
Exception is in src/InstagramScraper/Instagram.php:1527 Something went wrong. Please report issue.
This is the response: