The error#
AccountsPool.login logs one of:
Failed to login '{username}': {status_code} - {body}
Failed to login '{username}': {exception}The first is an HttpStatusError. The second is any other exception. The method returns False. On success it logs Logged in to {username} successfully and returns True.
Inside the login steps, a missing MFA code raises:
MFA code is requiredThat is a ValueError from login_two_factor_auth_challenge. AccountsPool.login catches it and turns it into the Failed to login line.
What triggers it#
login or login_all ran a password account and the login flow raised. Cookie accounts are skipped by login_all. The filter is login_method == "password".
How to confirm#
The log contains Failed to login '. The bit after the colon is either an HTTP status and body, or the exception text. MFA code is required means the flow reached the two-factor step with no code configured.
Fixes#
Set the MFA code the login config expects before calling login. An HTTP status in the log is X rejecting the login request. The library does not retry inside AccountsPool.login. login_all moves on to the next username and counts failed. A checkpoint that X only shows in the official app is not solved by calling login again with the same password.
SocialScrape#
Profile is GET /v1/twitter/profile. One post is GET /v1/twitter/tweet. A profile's posts are GET /v1/twitter/profile/tweets. These read what X shows logged out.
Failed requests cost 0 credits. New accounts get 100 credits on signup, no card. Suspended accounts come back as removed, unknown ones as not_found.