Could not authenticate

The session expired or X rejected it.

The error#

Two branches share the log line Session expired or banned: and then raise HandledError.

The first matches an error that starts with:

(32) Could not authenticate you

The account is closed with inactive=True and the error text is stored.

The second is HTTP 403 when the error text is OK (no errors array). The account is closed as inactive with msg=None.

Missing authentication cookies is a third, earlier check. It logs that sentence and deactivates the account before the request is sent.

What triggers it#

Code 32 in the GraphQL errors, or a 403 with an empty error list. Both mean this account's session is not accepted. They are not the code-326 access-control string.

How to confirm#

The log says Session expired or banned: and either (32) Could not authenticate you or a 403 with OK as the error summary. Missing authentication cookies happens before any HTTP call.

Fixes#

Password accounts can go through login again. AccountsPool.login catches HttpStatusError and other exceptions, logs Failed to login '{username}': ..., and returns false. It does not raise. Cookie accounts are not relogged. The source says they wait for another add_cookie.

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.

Questions

Does a failed re-login raise?

AccountsPool.login logs the failure and returns False.

What if SocialScrape cannot read the post?

upstream_error or upstream_blocked, both free. A missing post is not_found.