Sometimes people post a video to Twitter (no, I won’t call it X) and I want to show it to other people without benefitting the guy who bought the site, or I want to keep a copy that will outlive that site. How do you download those videos?
There’s a utility called yt-dlp (a fork of a prior utility called youtube-dl). You’ll need to install that. On my Mac I used the Homebrew package manager; on Windows I think you can directly download and install it.
Once it’s installed you’ll need to login to Twitter in a browser. For this example let’s assume you’ve done that in Chrome.
Assuming we want to download the video at https://x.com/NEBU_KURO/status/1740862661506846922/video/1 the command you’d use is
yt-dlp --cookies-from-browser chrome "https://x.com/NEBU_KURO/status/1740862661506846922/video/1”
Sometimes you’ll get a bunch of errors because yt-dlp will try to use the text of the tweet as the filename and the resulting filename will be too long. You can tell it to limit the length of the filename, e.g.
yt-dlp --cookies-from-browser chrome "https://x.com/NEBU_KURO/status/1740862661506846922/video/1” —-trim-filename 80
Will only use the first 80 characters of the tweet to name the file.
