N_m3u8DL-CLI README

The project's README from github.com/nilaoda/N_m3u8DL-CLI. As one markdown file: README.md.


███╗   ██╗        ███╗   ███╗██████╗ ██╗   ██╗ █████╗ ██████╗ ██╗       ██████╗██╗     ██╗
████╗  ██║        ████╗ ████║╚════██╗██║   ██║██╔══██╗██╔══██╗██║      ██╔════╝██║     ██║
██╔██╗ ██║        ██╔████╔██║ █████╔╝██║   ██║╚█████╔╝██║  ██║██║█████╗██║     ██║     ██║
██║╚██╗██║        ██║╚██╔╝██║ ╚═══██╗██║   ██║██╔══██╗██║  ██║██║╚════╝██║     ██║     ██║
██║ ╚████║███████╗██║ ╚═╝ ██║██████╔╝╚██████╔╝╚█████╔╝██████╔╝███████╗ ╚██████╗███████╗██║
╚═╝  ╚═══╝╚══════╝╚═╝     ╚═╝╚═════╝  ╚═════╝  ╚════╝ ╚═════╝ ╚══════╝  ╚═════╝╚══════╝╚═╝
                                                                                          

img img img img img

ENGLISH VERSION

下载使用

关于开源

本项目已于2019年10月9日开源,采用MIT许可证,各取所需。

关于跨平台

N_m3u8DL-CLI

一个简单易用的m3u8下载器,下载地址:https://github.com/nilaoda/N_m3u8DL-CLI/releases

支持下载m3u8链接或文件为mp4或ts格式,并提供丰富的命令行选项。

运行截图

命令行选项

N_m3u8DL-CLI

USAGE:

  N_m3u8DL-CLI <URL|JSON|FILE> [OPTIONS]

OPTIONS:

  --workDir                  设定程序工作目录
  --saveName                 设定存储文件名(不包括后缀)
  --baseUrl                  设定Baseurl
  --headers                  设定请求头,格式 key:value 使用|分割不同的key&value
  --maxThreads               (Default: 32) 设定程序的最大线程数
  --minThreads               (Default: 16) 设定程序的最小线程数
  --retryCount               (Default: 15) 设定程序的重试次数
  --timeOut                  (Default: 10) 设定程序网络请求的超时时间(单位为秒)
  --muxSetJson               使用外部json文件定义混流选项
  --useKeyFile               使用外部16字节文件定义AES-128解密KEY
  --useKeyBase64             使用Base64字符串定义AES-128解密KEY
  --useKeyIV                 使用HEX字符串定义AES-128解密IV
  --downloadRange            仅下载视频的一部分分片或长度
  --liveRecDur               直播录制时,达到此长度自动退出软件(HH:MM:SS)
  --stopSpeed                当速度低于此值时,重试(单位为KB/s)
  --maxSpeed                 设置下载速度上限(单位为KB/s)
  --proxyAddress             设置HTTP/SOCKS5代理, 如 http://127.0.0.1:8080
  --enableDelAfterDone       开启下载后删除临时文件夹的功能
  --enableMuxFastStart       开启混流mp4的FastStart特性
  --enableBinaryMerge        开启二进制合并分片
  --enableParseOnly          开启仅解析模式(程序只进行到meta.json)
  --enableAudioOnly          合并时仅封装音频轨道
  --disableDateInfo          关闭混流中的日期写入
  --disableIntegrityCheck    不检测分片数量是否完整
  --noMerge                  禁用自动合并
  --noProxy                  不自动使用系统代理
  --registerUrlProtocol      注册m3u8dl链接协议
  --unregisterUrlProtocol    取消注册m3u8dl链接协议
  --enableChaCha20           enableChaCha20
  --chaCha20KeyBase64        ChaCha20KeyBase64
  --chaCha20NonceBase64      ChaCha20NonceBase64
  --help                     Display this help screen.
  --version                  Display version information.

关于m3u8dl://协议

新增命令行参数:

--registerUrlProtocol          注册m3u8dl链接协议
--unregisterUrlProtocol     取消注册m3u8dl链接协议

URI格式:

m3u8dl://<base64编码的客户端命令行文本>

URI示例:

m3u8dl://Imh0dHBzOi8vZXhhbXBsZS5jb20vYWJjLm0zdTgiIC0td29ya0RpciAiJVVTRVJQUk9GSUxFJVxEb3dubG9hZHNcbTN1OGRsIiAtLXNhdmVOYW1lICJhYmMiIC0tZW5hYmxlRGVsQWZ0ZXJEb25lIC0tZGlzYWJsZURhdGVJbmZvIC0tbm9Qcm94eQ==

URI解码结果:

"https://example.com/abc.m3u8" --workDir "%USERPROFILE%\Downloads\m3u8dl" --saveName "abc" --enableDelAfterDone --disableDateInfo --noProxy

用户文档

https://nilaoda.github.io/N_m3u8DL-CLI/

聊聊

https://discord.gg/SSGwKrjC44

赞赏

Wow

N_m3u8DL-CLI (nilaoda/N_m3u8DL-CLI)

video-streaming
Searching Database…

What is this?It's a free, open-source command-line downloader for m3u8/HLS/DASH video streams, written in C# on .NET Framework. Give it an m3u8 link or a local file and it saves the video as mp4 or ts.
Is it just a command-line thing, or does it have a GUI?It's a pure CLI tool, but you don't have to memorize flags: SimpleG is a small helper GUI that generates the common parameters, and web pages can also launch it directly via the m3u8dl:// protocol.
How do I get it running?Download a build from the GitHub Releases page (auto-built test builds are published too) and run the exe from a terminal, passing your m3u8 URL — everything is controlled through command-line options.
Do I need ffmpeg or anything else installed?Nothing extra is required to download. For merging segments you can use plain binary concat, or ffmpeg if you have it — only the ffmpeg merge mode needs it installed.
Are there streams it can't download or decrypt?Yes — it explicitly does not decrypt Youku videos or Balloon Cloud (气球云) videos, so streams protected by those systems won't download.
Does it work on Mac or Linux too?No — it's built on .NET Framework, runs on Windows only, and the project is in maintenance mode. For Linux or macOS the author points to the successor N_m3u8DL-RE, which supports Win/Linux/Mac.
Can it handle encrypted streams?Yes — segments encrypted with AES-128-CBC are decrypted automatically during the download, so you get a playable file with no extra steps.
Can it record live streams?Yes, live stream recording is supported in beta. It also understands Master Lists and can download just a chosen time range or specific segments from an m3u8.
Does it support resuming interrupted downloads?Yes — downloads are multi-threaded with resume support and rate limiting. You can also set custom HTTP headers and a specific HTTP proxy; it auto-uses the system proxy by default unless you disable that.
Why is this project in maintenance mode?The author restarted from scratch as N_m3u8DL-RE, dropping the legacy .NET Framework base. That successor runs on Windows, Linux and Mac and receives the richer new features, while this CLI stays Windows-only.
Creator
nilaoda
Size
6.2 MB
Stars
16.1K
Age
7y
Commits · 90 Days