# Download X Video

> Download video from X/Twitter posts using yt-dlp. Use when the user wants to "download this X video", "save this tweet video", "grab video from Twitter", or provides an x.com/twitter.com status URL with a video. Handles HLS streams and uses --print after_move:filepath for reliable path detection.

- Skill: `swyxio/download-x-video` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add swyxio/download-x-video`
- Raw SKILL.md: https://api.skillmd.com/api/skills/swyxio/download-x-video/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: swyxio (https://skillmd.com/u/swyxio)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/swyxio/download-x-video

---


# Download X/Twitter Video

Download video from X/Twitter posts via yt-dlp.

## Prerequisites

- `yt-dlp`: `brew install yt-dlp`

## Usage

```bash
python3 scripts/download_x_video.py "https://x.com/user/status/123/video/1" [/output/dir]
```

Prints the downloaded file path to stdout.

## How It Works

- Uses yt-dlp with `--print after_move:filepath` for reliable path detection
- Handles Twitter's HLS streaming format (fragmented MP4)
- Output template: `x_video_<tweet_id>.<ext>` in the specified directory

## Troubleshooting

### yt-dlp auth errors

If Twitter requires login, yt-dlp may need cookies:

```bash
yt-dlp --cookies-from-browser chrome "https://x.com/..."
```

