[软件服务] Lux 是一个用 Go 语言编写的快速且简单的视频下载库和命令行工具
date
May 29, 2024
slug
newsoftware-lux-video-downloader
status
Published
summary
新软件-
tags
software
service
type
Post
URL
Summary
- ‣
安装过程
brew install lux
lux "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
# just display info
lux -i "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
# Download anything else
lux "https://img9.bcyimg.com/drawer/15294/post/1799t/1f5a87801a0711e898b12b640777720f.jpg"
# The -p option downloads an entire playlist instead of a single video.
lux -i -p "https://www.bilibili.com/bangumi/play/ep198061"
# 多文件
lux -i "https://www.bilibili.com/video/av21877586" "https://www.bilibili.com/video/av21990740"
# -F option to read URLs from file
lux -F ~/Desktop/u.txt
# Auto retry
# lux will auto retry when the download failed, you can specify the retry times by -retry option (default is 100).
HTTP_PROXY="http://127.0.0.1:1087/" lux -i "https://www.youtube.com/watch?v=Gnbch2osEeo"
# Use --multi-thread or -m multiple threads to download single video.
# Use --thread or -n option to set the number of download threads(default is 10).
# You can just use av or ep number to download bilibili's video
lux -i ep198381 av21877586
# The -o option sets the path, and -O option sets the name of the downloaded file
lux -o ../ -O "hello" "https://example.com"
The -d option outputs network request messages:
known problems - 优酷,西瓜头条
西瓜/头条视频
西瓜/头条视频必须带 Cookie 才能下载成功,西瓜和头条可共用西瓜视频的 Cookie,Cookie 的有效期可能较短,下载失败就更新 Cookie 尝试:
$ lux -c "msToken=yoEh0-qLUq4obZ8Sfxsem_CxCo9R3NM6ViTrWaRcM1...; ttwid=1%7C..." "https://m.toutiao.com/is/iYbTfJ79/"
优酷
优酷的
ccode
经常变化导致 lux 不可用,如果你知道有新的可用的 ccode
,可以直接使用 lux -ccode ...
而不用等待 lux 更新(当然,也欢迎你给我们提一个 Pull request 来更新默认的 ccode
)最好是每次下载都附带登录过的 Cookie 以避免部分
ccode
的问题