instauto: KeyError: 'logged_in_user' (Potentially caused by Challenge)

from instauto import ApiClient
client = ApiClient(user_name=username, password=password)
client.login()

trace:

---------------------------------------------------------------------------
.../python3.8/site-packages/instauto/api/actions/authentication.py in login(self)
     62         # does the actual login
     63         resp = self._request('accounts/login/', Method.POST, data=data2, signed=True)
---> 64         self.state.logged_in_account_data = LoggedInAccountData(**resp.json()['logged_in_user'])
     65 
     66     def _build_initial_headers(self) -> Dict[str, str]:

KeyError: 'logged_in_user'

This might be due to a challenge request (where Instagram asks for a phone/email text message code verification). Could you add this feature to handle that?

Some tips for this: https://github.com/dilame/instagram-private-api/issues/1068#issuecomment-593190908

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 22 (12 by maintainers)

Most upvoted comments

No problem, totally understandable. I tried that, but that only resulted in the “was this you?” checkpoint.

I’ll figure something out. If you watch this issue, you’ll be notified when it is implemented.