Danie1 / threads-api

Unofficial Python API for Meta's Threads App
https://pypi.org/project/threads-api/
MIT License
121 stars 16 forks source link

Post API no longer working, "ChallengeChoice.EMAIL" and "You've Been Logged Out" #62

Open oliveirabruno01 opened 1 year ago

oliveirabruno01 commented 1 year ago

Since today morning I can't post using this API anymore. It requests an email challenge, but after I enter the required code it raises this error:

[ERROR]  Request Failed, got back: [{'message': 'login_required', 'error_title': "You've Been Logged Out", 'error_body': 'Please log back in.', 'logout_reason': 8, 'status': 'fail'}]

Also, sometimes it's triggering a security alert on instagram/threads.net, and I need to change the password (already changed it sometimes but still not working).

Update: sometimes it raises this error instead:

Exception: Request Failed, got back: [{'message': 'Please wait a few minutes before you try again.', 'status': 'fail'}]
PDGIII commented 1 year ago

I'm getting flagged all the time and can't seem to figure out 2FA also.

Danie1 commented 1 year ago

Hey, it seems to be an issue in the way you are logging in and not the Post API. I highly recommend that once you are logged in you always use the cached token. I am still using the same token from a week ago.

Regarding customization for the login (email challenge, sms, 2FA, ... etc): By customizing the http client you will be able to specify additional arguments to the Instagrapi API.

Note that you can override the whole authentication mechanism this way to fit your needs.

You are welcome to open a PR with your custom http client for others to use. 😃