xToRage is a Python tool that turns a local file into one or more PNG images, then can optionally upload those images through the X Commerce image flow.
| Mode | What it does | Capacity per image |
|---|---|---|
stealth |
Encodes data into the least-significant bit of a normal cover image. The user can provide the cover image. | 134,896 bytes |
max |
Encodes data into nearly transparent PNG pixels for the largest confirmed payload. | 2,429,896 bytes |
In stealth mode, pass your own image with --cover-image. If omitted, xToRage uses the bundled placeholder image.
pip install -r requirements.txtOptional editable install:
pip install -e .Show available modes:
python -m xtorage.cli modesCheck how many images a file needs:
python -m xtorage.cli plan ./file.bin --mode stealth
python -m xtorage.cli plan ./file.bin --mode maxEncode with the default max mode:
python -m xtorage.cli encode ./file.bin --mode max --out-dir ./out/file-binEncode with stealth mode and your own cover image:
python -m xtorage.cli encode ./file.bin \
--mode stealth \
--cover-image ./cover.png \
--out-dir ./out/file-binDecode back:
python -m xtorage.cli decode ./out/file-bin/manifest.json --out ./decoded-file.binPrepare an account file based on:
examples/account.example.json
Then serve the generated output directory from a public URL and run:
python -m xtorage.cli upload ./file.bin \
--mode max \
--out-dir ./out/file-bin \
--public-base-url https://example-tunnel.ngrok-free.app/out/file-bin \
--account ./account.json \
--output ./upload-result.jsonLater, retrieve the file from the rehosted Commerce image URLs stored in upload-result.json:
python -m xtorage.cli retrieve ./upload-result.json --out ./retrieved-file.binFor stealth with a cover image:
python -m xtorage.cli upload ./file.bin \
--mode stealth \
--cover-image ./cover.png \
--out-dir ./out/file-bin \
--public-base-url https://example-tunnel.ngrok-free.app/out/file-bin \
--account ./account.json \
--output ./upload-result.jsonRequired fields:
owner_idbearercookies.auth_tokencookies.ct0cookies.twid
You can also avoid writing account cookies to disk:
export XTORAGE_ACCOUNT_JSON='[...]'
export XTORAGE_BEARER='<x.com web bearer token>'
python -m xtorage.cli upload ./file.bin \
--mode max \
--out-dir ./out/file-bin \
--public-base-url https://example-tunnel.ngrok-free.app/out/file-bin \
--account - \
--output ./upload-result.jsonstealthrequires a cover image of at least600x600; larger images are center-cropped.maxdoes not use a cover image.- Every chunk has integrity metadata. Decode fails if a chunk is corrupted or converted to JPEG.
upload-result.jsonstores the public rehost URLs needed byretrieve; it does not need account cookies for retrieval.