pgrimaud / instagram-user-feed

This is a scrapper to easily fetch any feed and interact with Instagram (like, follow, etc.) without OAuth for PHP.
MIT License
873 stars 136 forks source link

Client error: 'POST https://www.instagram.com/accounts/login/ajax/' #65

Closed coolskin2b closed 4 years ago

coolskin2b commented 4 years ago

Hello,

I just realized that I can no longer connect to Instagram.

I have this error message:

Uncaught GuzzleHttp \ Exception \ ClientException: Client error: 'POST https://www.instagram.com/accounts/login/ajax/' resulted in a '400 Bad Request' response: Bad request in ... vendor / guzzlehttp / guzzle / src / Exception / RequestException.php: 113. until yesterday it worked.

Do you have the same problem?

cordially

pgrimaud commented 4 years ago

Hello @coolskin2b

Yes, Instagram changed his login process. I'm working on a hotfix.

pgrimaud commented 4 years ago

Password encryption changed : https://github.com/unoemon/instagram-enc_passowrd-generator/blob/master/enc_passowrd-generator.js

rephlex187 commented 4 years ago

Got the same issue, how does Instagram encrypt the password using Username/Password only?

pgrimaud commented 4 years ago

It's a AES 256 GCM encryption. I found a solution in JavaScript here : https://pastebin.com/raw/nYL2W2bG

But I have trouble to implement it on PHP.

rephlex187 commented 4 years ago

Got it working without node-webcrypto-ossl since it requires native modules, let me try PHP

pgrimaud commented 4 years ago

@rephlex187 Did you succeeded with PHP?

pgrimaud commented 4 years ago

I fixed it with this workaround : https://github.com/pgrimaud/instagram-user-feed/commit/96ad4cf54d1ad331b337f325c73e664999a6d066

pgrimaud commented 4 years ago

Please upgrade to 5.6.2 : https://github.com/pgrimaud/instagram-user-feed/releases/tag/5.6.2 😄

LudovicFauchet commented 4 years ago

Hello, For me the hotfix doesn't work :(

: Uncaught GuzzleHttp\Exception\ClientException: Client error:POST https://www.instagram.com/accounts/login/ajax/resulted in a400 Bad Requestresponse: {"message": "checkpoint_required", "checkpoint_url": "/challenge/2471176/CfHcIxPw0D/", "lock": false, "status": "fail"}

pgrimaud commented 4 years ago

Hello @LudovicFauchet

The hotfix is working 😄

This is another problem, the 2FA authentication. (You can see the "checkpoint_required, on the Instagram response. It means : the login is working, but you must provide a manual action to confirm login).

I'm actually working on a new login authentication process, it should be release at the end of the week.

LudovicFauchet commented 4 years ago

@pgrimaud

Ok but it's tell me everytime i call the api on my server. I use the login way because it's say my server api is ban ^^

Cheers