Developer tools#Open source

Lux: A Go-based Cross-platform Command-line Video Downloader

Lux is a command-line video downloader written in Go that resolves real stream URLs across 45 sites including Bilibili, Douyin, and YouTube, with quality selection, subtitle downloads, batch playlist fetching, and resumable downloads.

Project facts

GitHub Ecosystem
Repositorygithub.com/iawia002/lux
License
MIT
Language
Go
Stars
31,698
Data checked
2026-09-25

Snapshot figures reflect the check date and may change over time.

Saving an online video to disk isn’t hard because of the “download” step itself — the real difficulty is that every platform structures its pages and stream URLs differently. Lux implements that resolution logic in Go: each site’s extraction logic is built as a self-contained extractor, paired with a general-purpose downloader, so a single command in a Windows, macOS, or Linux terminal gets you video, images, or audio. GitHubDaily recommended it back in January 2025.

Core features

  • Multi-site resolution: the README’s supported-sites list covers 45 sites, including Bilibili, YouTube, Douyin, Twitter, iQIYI, Tencent Video, Xiaohongshu (RedNote), TikTok, and Instagram, spanning video, image, and audio content.
  • Selectable quality: -i lists all available streams for a link (resolution and codec), and -f picks one of them (e.g. lux -f 248 <URL>).
  • Batch and playlist support: -p grabs an entire playlist, a single command can take multiple URLs, and -F reads links from a file, with -start/-end/-items to narrow the range.
  • Subtitle handling: -C downloads subtitles, and on YouTube you can pick a language with -C -items en,zh, or use -embed to mux subtitles into the video file (YouTube-only).
  • Resume and retry: interrupting with Ctrl+C leaves progress in a .download temp file, so rerunning the same command picks up where it left off; failed tasks retry automatically, with the retry cap set by -retry.
  • Multi-threading and aria2: -m enables multi-threading, -n adjusts the thread count (default 10); if you’d rather not use the built-in downloader, -aria2 and related flags hand the task off to aria2’s RPC interface.

Typical use cases

  • Bulk archiving: pull an entire Bilibili collection or YouTube playlist down at once, switching to -F with a text file of links when there are a lot of them.
  • Offline study material: use -i to check available quality tiers first, then -f to download a specific stream, adding or embedding subtitles with -C.
  • Short video and audio: save short videos from Douyin, Kuaishou, Xiaohongshu, and Weibo, or grab audio from Ximalaya and NetEase Cloud Music.

Quick start

Install FFmpeg first (it’s only used for final file muxing), then install Lux:

go install github.com/iawia002/lux@latest

On macOS you can just brew install lux; on Windows, use scoop install lux or choco install lux. Then download directly:

lux "<video-url>"

To pick a quality: first run lux -i <URL> to list all streams, then lux -f 248 <URL> to download the one you want.

Summary

Lux suits people comfortable with the terminal who need to save online content in bulk or via automation — archivists, developers writing scripts, and especially anyone using both domestic Chinese and international platforms side by side. The project is MIT-licensed and requires no API key. Two practical caveats: site availability fluctuates — Xigua and Toutiao require a cookie to download; Youku’s ccode parameter changes frequently and is often broken (the README lists it under Known Issues); Bilibili and Youku member-only content requires logging in to obtain a cookie first; and Mango TV runs into 403 errors with multi-threading, so the project recommends -n 1. Second, the release cadence is slow — the latest stable release, v0.24.1, shipped in May 2024, and while the repo is still maintained, the gap between releases has grown. Overall, its combination of multi-site resolution and a general-purpose downloader is fairly complete, making it a solid first choice for command-line video downloading.