trevorhobenshield / twitter-api-client

Implementation of X/Twitter v1, v2, and GraphQL APIs
https://pypi.org/project/twitter-api-client
MIT License
1.56k stars 207 forks source link

Session gets invalidated frequently last time #224

Open msvprogs opened 3 months ago

msvprogs commented 3 months ago

Hello, Does someone experience the same phenomenon? During last weeks, I get '32 - Could not authenticate you' errors frequently on various requests (liking, DM, search). I don't do anything that could be identified as abusive behavior (DM spamming, a lot of subsequent random likes, exceeding endpoint rate limits). Could this be due to missing request headers X-Client-UUID and x-client-transaction-id ? There's an explanation on generating the latter header: https://antibot.blog/twitter-header-part-3/ But the author claims that presence of this header doesn't affect the trustfulness of API requests. I don't know if it's still valid, that was in February 2024. Maybe there's another reason for frequent session invalidations.

Phineas1500 commented 2 months ago

yeah, i use the twitter.search feature, and after running my code for a couple minutes i get a 200 unauthorized error. if i keep my code running with those errors, i eventually get logged out of twitter on my browser. ive heard that after enough logouts, twitter suspends your account. i think we need a way to properly send the x-client-transaction-id header.