instagram-php-scraper icon indicating copy to clipboard operation
instagram-php-scraper copied to clipboard

Fatal error - TwoStepVerificationInterface

Open remiamos opened this issue 2 years ago • 1 comments

Hi,

It seems that the scrapper doesn't work anymore. I use several accounts, proxies, etc. I always get:

Fatal error: Uncaught InstagramScraper\Exception\InstagramAuthException: $twoStepVerificator must be an instance of TwoStepVerificationInterface.

I need to enter the account manually and then I have to change may password.

Then this cycle returns when using the scraper...

Does anyone have the same issue?

Thanks!

remiamos avatar Oct 19 '22 17:10 remiamos

If you don't define the verificator explicitly on calling login, it tries to call it if checkpoint is required from Instagram:

https://github.com/postaddictme/instagram-php-scraper/blob/master/src/InstagramScraper/Instagram.php#L2238

if (isset($response->body->message) && $response->body->message == 'checkpoint_required') {
                $response = $this->verifyTwoStep($response, $cookies, $twoStepVerificator);
            }

IMHO this should be checked before calling.

paha77 avatar Mar 28 '23 04:03 paha77