Skip to content

BotWitter/twitter-castle-test-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twitter castle test (Python)

The API solution for generating valid Castle.io(castle_token) tokens for X (Twitter) automation https://castle.botwitter.com/

Python translation of https://github.com/BotWitter/twitter-castle-test

Setup

pip install -r requirements.txt
cp .env.example .env   # fill in HTTP_PROXY / CASTLE_API_KEY

Proxy formats

--proxy (or the HTTP(S)_PROXY env var) accepts any of these — the scheme defaults to http:// when omitted:

http://user:pass@host:port
https://user:pass@host:port
socks5://user:pass@host:port
host:port:user:pass
host:port

For rotating-session residential proxies (provider usernames containing -type- / -country- / -lifetime- markers), a fresh -session-XXX segment is injected per run (castle_verify.py) or per worker (castle_verify_mt.py) to force a new exit IP. Plain user:pass proxies are passed through untouched.

Run

# Single account
python cmd/castle_verify.py --proxy http://user:pass@host:port --debug eloncr

# Multi-thread harness
python cmd/castle_verify_mt.py --threads 200 --count 1000 --proxy host:port:user:pass

# Proxy can come from the environment instead of a flag
export HTTPS_PROXY=http://user:pass@host:port
python cmd/castle_verify.py eloncr

Run python cmd/castle_verify.py -h for the full flag list (country, browser, platform, etc.).

Layout

castle_verify/
  transaction/    # x-client-transaction-id
  crypto/         # XPFF AES-256-GCM
  config/         # browser info, headers, endpoints, proxy parsing
  httpclient/     # curl_cffi wrapper with the Chrome 147 profile
  profiles/       # local Chrome 147 ClientProfile
  castletoken/    # Castle token backend client
  jetfuel/        # JFAPI response parser
  flow/           # login orchestrator
cmd/
  castle_verify.py      # single-account login CLI
  castle_verify_mt.py   # multi-thread harness

About

Botwitter Castle token testing tool for X (Twitter) login

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages