subzeroid / instagrapi

🔥 The fastest and powerful Python library for Instagram Private API 2024
https://hikerapi.com/p/bkXQlaVe
MIT License
4.21k stars 667 forks source link

[BUG] Error 400 when logging in #1770

Open TsunamiWind opened 8 months ago

TsunamiWind commented 8 months ago

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):

enakhi commented 8 months ago

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.

eloufirjawad commented 8 months ago

same here

425107265 commented 8 months ago

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 commented 8 months ago

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.

uccio99 commented 8 months ago

I have same problem

radityafs commented 8 months ago

any solution please, have same issue here

I-NRL commented 8 months ago

any solution please, have same issue here

Same🤔

BitDownMod commented 8 months ago

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

enakhi commented 8 months ago

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

marschr commented 8 months ago

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?

BitDownMod commented 8 months ago

it's more than 24 hours already

BitDownMod commented 8 months ago

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 commented 8 months ago

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

tinerci commented 8 months ago

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.

enakhi commented 8 months ago

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

mirubinstein commented 8 months ago

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

hailovigor commented 8 months ago

Same problem

Reloisback commented 8 months ago

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

tinerci commented 8 months ago

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 commented 8 months ago

🚨

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.

Reloisback commented 8 months ago

Much better to wait for admins to update :)

tinerci commented 8 months ago

Much better to wait for admins to update :)

administrators will not be able to solve this. :)

Reloisback commented 8 months ago

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

AlloryDante commented 8 months ago

Same error...

alenko commented 8 months ago

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

Reloisback commented 8 months ago

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.

uccio99 commented 7 months ago

any news?

gauravsingh06 commented 7 months ago

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.

marschr commented 7 months ago

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.

ofarukbicer commented 7 months ago

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.

gauravsingh06 commented 7 months ago

Till now, I have don't know how it's gonna get fixed without bruteforce. But I think you can bypass the cache with headers, but I don't know which header value need to be altered. I tried cache-control but it doesn't work. Devs of this libs know much better about headers, they might fix it.

ofarukbicer commented 7 months ago

My friend, most everyone is having the same problem as the friend who opened the issue, and this happened today. Instagram released a very nice update because I had a working system before, we will probably spend our days solving the new API. I hope the developers you mentioned can help.

enakhi commented 7 months ago

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.

Thanks, this worked for me. After exactly 20 requests, it worked. We could use this method until a better solution arrives.

uccio99 commented 7 months ago

It seems that the problem has re-entered automatically. Can anyone confirm?

marschr commented 7 months ago

Here's now working just fine. Very odd behavior from the ig server side.

Cedrick-J commented 7 months ago

Doing an Instagram password reset fixed this for me

darkzbaron commented 5 months ago

Same here