Skip to content

feat(media): video upload on post, reply, and quote - #96

Closed
jollyroger1480 wants to merge 1 commit into
jackwener:mainfrom
jollyroger1480:feat/video-upload
Closed

jollyroger1480 wants to merge 1 commit into
jackwener:mainfrom
jollyroger1480:feat/video-upload

Conversation

@jollyroger1480

Copy link
Copy Markdown
Contributor

What

Video upload support for the CLI. This is the request in #13.

client.py — upload_media is now format-aware (no signature change):

  • Video (any video/* mime): INIT with media_category=tweet_video → 4 MB chunked APPEND → FINALIZE → STATUS polling until async processing succeeds (300 s timeout, explicit failed-state error). 512 MB cap (X's hard limit).
  • Images: behavior unchanged, now sends the explicit tweet_image category.
  • Reuses the existing cookie/Bearer auth, _build_headers and curl_cffi session — zero new dependencies.

cli.py — --video / -V on post, reply and quote (max 1 video; mutually exclusive with --image, per X's one-media-type rule). Help text documents the free-tier duration cap.

Live-tested

  • Real end-to-end post: 11.1 MB vertical mp4, 3 APPEND segments, async processing (~15 s), attached to a successful tweet.
  • Image-path regression test (upload + INIT/FINALIZE round trip).
  • Free (non-Premium) accounts are additionally capped by X itself at 2:20 duration and 280 chars — those surface as CreateTweet errors 324 / 186, not upload errors. Premium lifts both.

Relation to #62

#62 already proposes video upload on post, plus long-form CreateNoteTweet. This branch does not add long-form. It does add --video on reply and quote, and the upload path above was used for a real post.

Closes #13.

…ATUS poll, --video flag

client.py: upload_media auto-detects video files (INIT with
media_category=tweet_video, 4 MB chunked APPEND, FINALIZE, STATUS
polling with 300s timeout and failed-state detection). Image path
unchanged except explicit tweet_image category. 512 MB cap per X.

cli.py: --video/-V on post, reply and quote (max 1 video, mutually
exclusive with --image per X media rules).

Live-tested end to end: 11.1 MB / 3-segment vertical mp4 upload with
async processing, attached to a successful post; image path
regression-tested. Free (non-Premium) accounts are additionally
capped by X at 2:20 duration and 280 chars — those errors surface at
CreateTweet (324 / 186), not during upload.

Closes jackwener#13. Video half of jackwener#62.
@jollyroger1480

Copy link
Copy Markdown
Contributor Author

Closing this pull request.

@jollyroger1480
jollyroger1480 deleted the feat/video-upload branch November 30, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: support video media upload when posting

1 participant