instagrapi icon indicating copy to clipboard operation
instagrapi copied to clipboard

[BUG] Error 400 when logging in

Open TsunamiWind opened this issue 1 year ago • 39 comments

Try Instagrapi SaaS with a free trial https://hikerapi.com/p/5GBWznd3

Describe the bug When attempting to log-in a error code 400 is given.

To Reproduce

cl = Client()
cl.login("", "")   

Traceback

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/instagrapi/mixins/private.py", line 359, in _send_private_request
    response.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://i.instagram.com/api/v1/accounts/login/

Traceback (most recent call last):
  File "/home/bot.py", line 13, in <module>
    cl.login("", "")       
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/instagrapi/mixins/auth.py", line 441, in login
    logged = self.private_request("accounts/login/", data, login=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/instagrapi/mixins/private.py", line 541, in private_request
    raise e
  File "/usr/local/lib/python3.11/dist-packages/instagrapi/mixins/private.py", line 526, in private_request
    self._send_private_request(endpoint, **kwargs)
  File "/usr/local/lib/python3.11/dist-packages/instagrapi/mixins/private.py", line 448, in _send_private_request
    raise UnknownError(**last_json)
instagrapi.exceptions.UnknownError: We couldn't find an account with the username ########. Check the username you entered and try again.

Expected behavior The login process to successfully occur

Desktop (please complete the following information):

  • OS: Ubuntu 21.04
  • Python version 3.8.3
  • instagrapi version (latest)

TsunamiWind avatar Jan 24 '24 11:01 TsunamiWind

UnknownError We couldn't find an account with the username rezavishkaa. Check the username you entered and try again.

Recently, I am getting this error.

enakhi avatar Jan 24 '24 13:01 enakhi

same here

eloufirjawad avatar Jan 24 '24 14:01 eloufirjawad

UnknownError We couldn't find an account with the username rezavishkaa. Check the username you entered and try again.

Recently, I am getting this error.

I also encountered this problem.Any idea how to solve it?

425107265 avatar Jan 24 '24 14:01 425107265

It's not just this api that has this same error. I tested another api in Typescript and the exact same error occurs. I noticed that in my case it only happens on newer profiles, but this error does not occur when logging in via the browser. Old profiles apparently do not have this error.

I am using the Instagram library. When calling the login method, it will prompt We couldn't find an account with the username xxxxxxx. Check the username you entered and try again. This is especially serious today.

425107265 avatar Jan 24 '24 15:01 425107265

I have same problem

uccio99 avatar Jan 24 '24 15:01 uccio99

any solution please, have same issue here

radityafs avatar Jan 24 '24 16:01 radityafs

any solution please, have same issue here

Same🤔

I-NRL avatar Jan 24 '24 16:01 I-NRL

The same for me: "We couldn't find an account with the username. Check the username you entered and try again."

BitDownMod avatar Jan 24 '24 16:01 BitDownMod

I checked the instagram app,this error shows even on the Instagram app image that's interesting if I give wrong username the error will change image

enakhi avatar Jan 24 '24 17:01 enakhi

I've seen this error in the past when trying to log in to my account in the app, just like the screenshots above, with nothing related to the libraries. Seems like sometimes the database sharding on the ig server side doesn't properly update. Doesn't seem to be on our end =( I'd wait for a few hours. Is this for fresh logins only? Has anyone tried with existing cookies/session?

marschr avatar Jan 24 '24 17:01 marschr

it's more than 24 hours already

BitDownMod avatar Jan 24 '24 18:01 BitDownMod

I have 11 year old account and it working fine with instagrapi. I tested just a few seconds ago, but not with 3 yo account.

BitDownMod avatar Jan 24 '24 18:01 BitDownMod

Old account is fine with fresh login and with existing session. New account doesn't work.

BitDownMod avatar Jan 24 '24 18:01 BitDownMod

UnknownError We couldn't find an account with the username rezavishkaa. Check the username you entered and try again.

Recently, I am getting this error.

I've seen this error in the past when trying to log in to my account in the app, just like the screenshots above, with nothing related to the libraries. Seems like sometimes the database sharding on the ig server side doesn't properly update. Doesn't seem to be on our end =( I'd wait for a few hours. Is this for fresh logins only? Has anyone tried with existing cookies/session?

Old account is fine with fresh login and with existing session. New account doesn't work.

UnknownError We couldn't find an account with the username rezavishkaa. Check the username you entered and try again.

Recently, I am getting this error.

Friends, Instagram no longer uses old versions of accounts/login. There is a new login method. Now I am logging in with the new method. Instagram is no longer functional. Those who want to buy my method should contact @phpkertenkele on telegram.

tinerci avatar Jan 24 '24 18:01 tinerci

@adw0rd do you have any idea to solve this problem?

enakhi avatar Jan 25 '24 01:01 enakhi

Seeing this as well - suddenly regressed yesterday. No account or code change.

mirubinstein avatar Jan 25 '24 02:01 mirubinstein

Same problem

hailovigor avatar Jan 25 '24 05:01 hailovigor

🚨

PyaScrapz avatar Jan 25 '24 06:01 PyaScrapz

Nobody knows if they're working on it or not, they don't say anything

Reloisback avatar Jan 25 '24 06:01 Reloisback

Nobody knows if they're working on it or not, they don't say anything

I have a new login method, it works without any problems, we can test it. Those who want to buy can reach @phpkertenkele on telegram.

tinerci avatar Jan 25 '24 06:01 tinerci

🚨

I have a new login method, it works without any problems, we can test it. Those who want to buy can reach @phpkertenkele on telegram.

tinerci avatar Jan 25 '24 06:01 tinerci

Much better to wait for admins to update :)

Reloisback avatar Jan 25 '24 06:01 Reloisback

Much better to wait for admins to update :)

administrators will not be able to solve this. :)

tinerci avatar Jan 25 '24 06:01 tinerci

Can't the person who wrote this library solve this? Funny

Reloisback avatar Jan 25 '24 06:01 Reloisback

Same error...

AlloryDante avatar Jan 25 '24 07:01 AlloryDante

Much better to wait for admins to update :)

administrators will not be able to solve this. :)

lol, common. Stop spreading false news. And yes they will. I will send them solution

alenko avatar Jan 25 '24 08:01 alenko

Much better to wait for admins to update :)

administrators will not be able to solve this. :)

lol, common. Stop spreading false news. And yes they will. I will send them solution

Thank you, is it possible to share this in the Telegram group or here? Since we can't contact anyone, we can at least use it until it's updated.

Reloisback avatar Jan 25 '24 08:01 Reloisback

any news?

uccio99 avatar Jan 25 '24 16:01 uccio99

Much better to wait for admins to update :)

administrators will not be able to solve this. :)

why?

PyaScrapz avatar Jan 25 '24 17:01 PyaScrapz

telegram-cloud-photo-size-5-6167809028785289738-y

Hey Everyone GoodNews!

I got the fix, I have tried this 5 accounts. It worked.

You have noticed that when you try to login the same account on instagram app you face the error right?

So I thought it’s an issue from instagram ends. Yesterday someone told in github.

I was randomly trying different method but nothing worked, I tried changing headers but didn’t work.

I tried bruteforcing the login function. My account got logged in after exact 20 request on each of the 5 accounts. I think instagram servers are not getting updated properly but when request 20 times it updates it

Please someone try and let me know. I was constantly working from 24 hours to figure the bug.

gauravsingh06 avatar Jan 25 '24 20:01 gauravsingh06

I tried bruteforcing the login function. My account got logged in after exact 20 request on each of the 5 accounts. I think instagram servers are not getting updated properly but when request 20 times it updates it

That somewhat makes sense, back in the day when I tried to login to reactivate a deactivated account I've only got it working after trying a lot of times. Now, how does that relates to the library and the login flow I wish I'd know.

marschr avatar Jan 25 '24 21:01 marschr

Hi guys,

I'm having the same problems

I think Instagram released a new API,

/api/v1/accounts/login/ OFF only login with phone number and email address works

new API endpoint /api/v1/bloks/apps/com.bloks.www.bloks.caa.login.async.send_login_request/

I will work on this, if I find it, I will leave a note here. If anyone finds it before me, can you please let me know, thank you.

ofarukbicer avatar Jan 25 '24 21:01 ofarukbicer