postaddictme / instagram-php-scraper

Get account information, photos, videos, stories and comments.
https://packagist.org/packages/raiym/instagram-php-scraper
MIT License
3.09k stars 800 forks source link

Login error #446

Closed zaivst closed 5 years ago

zaivst commented 5 years ago

When I use $instagram->login(); I`m got an extension "Something went wrong. Please report issue." without any additional information. Im try to login both with and without proxy but no result.

eyusifli commented 5 years ago

+1

jmarchalonis commented 5 years ago
$challenge_url = 'https://www.instagram.com' . $response->body->checkpoint_url;
$response = Request::post( $challenge_url , $headers, [ 'choice' => true ] );

I was playing around with this issue. If you interrupt the response on line 1287 of Instagram.php, you will see that the response body contains a challenge. To get the url, you look at $response->body->checkpoint_url. The choice is either true or false; "This was me | This wasn't me".

If you send a post confirming your response, you get to the next page which will send a code to your email. The problem is getting beyond this part. You have to physically get the code yourself and submit it. I have seen another scrapper do the process, then show a form and ask for the code. After you manually submit that form, it saves the session like normal. While this could be a solution, it doesn't work for automated systems with cron-jobs. It seems that instagram doesn't want anybody having access to their platform via web.

hamlet96 commented 5 years ago

@raiym please tell us how to use CLI method p.s. I got same error

fsjdg commented 5 years ago

I got same error. What i realized is that instagram now is asking for 6 code number ( randomly ), even if two factor authentication is disabled. So i went to instagram.php file, line 1288 and removed from the if statement the $support_two_step_verification variable. You will skip this error but still you need to figure it out how to get the code and finish the login process, which doesn't seem too hard.

aleksei-s-popov commented 5 years ago

I made a way to automate two step verification with email as example in https://github.com/postaddictme/instagram-php-scraper/pull/457

jmarchalonis commented 5 years ago

I made a way to automate two step verification with email as example in #457

I see what you did there. Clever. I am assuming it only works with IMAP mail services... which is most email providers today anyway.

aleksei-s-popov commented 5 years ago

Login with email via IMAP is just an example of two step verification interface implementation. So you can implement any other method...

stale[bot] commented 5 years ago

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.

nicmare commented 4 years ago

I made a way to automate two step verification with email as example in #457

does not work entirely. there is no exception class. whole class named different. unknown constants... do you linked to the correct class?