Use lux -f stream "URL" to download a specific stream listed in the output of -i option.
Download anything else
If Lux is provided the URL of a specific resource, then it will be downloaded directly:
$ lux "https://img9.bcyimg.com/drawer/15294/post/1799t/1f5a87801a0711e898b12b640777720f.jpg"
lux doesn't support this URL right now, but it will try to download it directly
Site: Universal
Title: 1f5a87801a0711e898b12b640777720f
Type: image/jpeg
Stream:
[default] -------------------
Size: 1.00 MiB (1051042 Bytes)
# download with: lux -f default "URL"
1.00 MiB / 1.00 MiB [===================================] 100.00% 1.21 MiB/s 0s
Download playlist
The -p option downloads an entire playlist instead of a single video.
$ lux -i -p "https://www.bilibili.com/bangumi/play/ep198061"
Site: 哔哩哔哩 bilibili.com
Title: Doctor X 第四季:第一集
Type: video
Streams: # All available quality
[default] -------------------
Quality: 高清 1080P
Size: 845.66 MiB (886738354 Bytes)
# download with: lux -f default "URL"
Site: 哔哩哔哩 bilibili.com
Title: Doctor X 第四季:第二集
Type: video
Streams: # All available quality
[default] -------------------
Quality: 高清 1080P
Size: 930.71 MiB (975919195 Bytes)
# download with: lux -f default "URL"
......
You can use the -start, -end or -items option to specify the download range of the list:
-start
Playlist video to start at (default 1)
-end
Playlist video to end at
-items
Playlist video items to download. Separated by commas like: 1,5,6,8-10
For bilibili playlists only:
-eto
File name of each bilibili episode doesn't include the playlist title
You can use the -start, -end or -items option to specify the download range of the list:
-start
File line to start at (default 1)
-end
File line to end at
-items
File lines to download. Separated by commas like: 1,5,6,8-10
Resume a download
Ctrl+C interrupts a download.
A temporary .download file is kept in the output directory. If lux is ran with the same arguments, then the download progress will resume from the last session.
Auto retry
lux will auto retry when the download failed, you can specify the retry times by -retry option (default is 100).
Cookies
Cookies can be provided to lux with the -c option if they are required for accessing the video.
Cookies can be the following format or Netscape Cookie format:
name=value; name2=value2; ...
Cookies can be a string or a text file, supply cookies in one of the two following ways.
-i Information only
-F string
URLs file path
-d Debug mode
-j Print extracted data
-s Minimum outputs
-v Show version
Download:
-f string
Select specific stream to download
-p Download playlist
-n int
The number of download thread (only works for multiple-parts video) (default 10)
-c string
Cookie
-r string
Use specified Referrer
-cs int
HTTP chunk size for downloading (in MB) (default 1)
Network:
-retry int
How many times to retry when the download failed (default 10)
Playlist:
-start int
Playlist video to start at (default 1)
-end int
Playlist video to end at
-items string
Playlist video items to download. Separated by commas like: 1,5,6,8-10
Filesystem:
-o string
Specify the output path
-O string
Specify the output file name
Subtitle:
-C Download subtitles
-C -items en,zh
Download specific languages (YouTube only)
-C -items en,zh -embed
Embed subtitles into the video (YouTube only)
Lux
Let there be Lux!
👾 Lux is a fast and simple video downloader built with Go.
go installInstallation
Prerequisites
The following dependencies are required and must be installed separately.
Install via
go installTo install Lux, use
go install, or download the binary file from Releases page.Homebrew (macOS only)
For macOS users, you can install
luxvia:Arch Linux
For Arch Users AUR package is available.
Void Linux
For Void linux users, you can install
luxvia:Scoop on Windows
Chocolatey on Windows
Cask on Windows/macOS/Linux
Getting Started
Usage:
Download a video
The
-ioption displays all available quality of video without downloading.Use
lux -f stream "URL"to download a specific stream listed in the output of-ioption.Download anything else
If Lux is provided the URL of a specific resource, then it will be downloaded directly:
Download playlist
The
-poption downloads an entire playlist instead of a single video.You can use the
-start,-endor-itemsoption to specify the download range of the list:For bilibili playlists only:
Multiple inputs
You can also download multiple URLs at once:
These URLs will be downloaded one by one.
You can also use the
-Foption to read URLs from file:You can use the
-start,-endor-itemsoption to specify the download range of the list:Resume a download
Ctrl+C interrupts a download.
A temporary
.downloadfile is kept in the output directory. Ifluxis ran with the same arguments, then the download progress will resume from the last session.Auto retry
lux will auto retry when the download failed, you can specify the retry times by
-retryoption (default is 100).Cookies
Cookies can be provided to
luxwith the-coption if they are required for accessing the video.Cookies can be the following format or Netscape Cookie format:
Cookies can be a string or a text file, supply cookies in one of the two following ways.
As a string:
As a text file:
Proxy
You can set the HTTP/SOCKS5 proxy using environment variables:
Multi-Thread
Use
--multi-threador-mmultiple threads to download single video.Use
--threador-noption to set the number of download threads(default is 10).Short link
bilibili
You can just use
avorepnumber to download bilibili’s video:Use specified Referrer
A Referrer can be used for the request with the
-roption:Specify the output path and name
The
-ooption sets the path, and-Ooption sets the name of the downloaded file:Debug Mode
The
-doption outputs network request messages:Reuse extracted data
The
-joption will print the extracted data in JSON format.Options
Download:
Network:
Playlist:
Filesystem:
Subtitle:
Youku:
aria2:
Supported Sites
Known issues
优酷
优酷的
ccode经常变化导致 lux 不可用,如果你知道有新的可用的ccode,可以直接使用lux -ccode ...而不用等待 lux 更新(当然,也欢迎你给我们提一个 Pull request 来更新默认的ccode)最好是每次下载都附带登录过的 Cookie 以避免部分
ccode的问题西瓜/头条视频
西瓜/头条视频必须带 Cookie 才能下载成功,西瓜和头条可共用西瓜视频的 Cookie,Cookie 的有效期可能较短,下载失败就更新 Cookie 尝试:
Contributing
Lux is an open source project and built on the top of open-source projects. Check out the Contributing Guide to get started.
Authors
Code with ❤️ by iawia002 and lovely contributors
Similar projects
License
MIT
Copyright (c) 2018-present, iawia002