For starters let me give credit to the resources I used to transcribe this project into JS.
- https://github.com/fa0311/twitter-tid-deobf-fork
- https://github.com/iSarabjitDhiman/TweeterPy/tree/master (TID written in Python)
- https://github.com/fa0311/antibot_blog_archives (Articles on reversing the header gen)
-
npm install -
Make sure in the src/main.js file to add your headers like
X-csrf-tokenandcookieheaders so that it can fetch the home page to get thex-loading-animSVG's to get the loading data. -
Make sure to set your
api/endpointto where you are requesting along with the method type ie POST or GET etc. Your file data should be the response.body of a request to the home page https://x.com/home.
const file = response.body;
const client = await new ClientTransaction(file).init();
const transactionId = client.generateTransactionId('METHOD', '/api/endpoint');npm run start