yt-dlp Command Generator for X (Twitter)
Build a yt-dlp command for a video on X, with predictable file names and the options sensitive media requires.
Notes for X
Both x.com and twitter.com URLs work. What people call GIFs on X are really short MP4 videos, so they download like anything else; convert afterwards if you need an actual GIF.
Sensitive-media posts require a logged-in session with the corresponding setting enabled. The default template names files by author and post id, which keeps a folder of them navigable.
Frequently asked questions
› Why does an age-restricted post on X fail?
Sensitive-media posts require a logged-in session. Use --cookies-from-browser with an account that has the setting enabled.
› How do I download a GIF from X?
They are MP4 videos, not GIFs, and download like any other video. Convert afterwards if you need an actual GIF.
› Can I choose the video quality on X?
Yes. X publishes several renditions; cap the height with the quality dropdown or list them with -F first.