/install jyt-m3u8-downloader
\r \r
M3U8 Video Downloader\r
\r
Overview\r
\r Download videos from M3U8/HLS streaming URLs by parsing playlists, downloading TS segments with multi-threading,\r handling encrypted streams (AES-128), and merging all segments into a single MP4 file using ffmpeg.\r \r
Prerequisites\r
\r Before executing, ensure the following are available:\r \r
- Python 3 with
requestslibrary installed:pip install requests\r - ffmpeg installed and added to system PATH (required for merging TS segments into MP4)\r
- Network access to the M3U8 URL\r \r
Workflow\r
\r
1. Understand the User's Request\r
\r Extract from the user:\r
- M3U8 URL: The streaming playlist URL (required)\r
- Output filename: Name for the saved MP4 file (required, without extension)\r
- Base64 key (optional): For encrypted streams that require a manually provided AES-128 decryption key\r \r
2. Prepare the Environment\r
\r
- Copy
scripts/M3u8Download.pyto the working directory\r - Ensure
requestsis installed in the Python environment\r - Verify
ffmpegis accessible from the command line:ffmpeg -version\r \r
3. Execute the Download\r
\r
Use the M3u8Download class from scripts/M3u8Download.py:\r
\r
from M3u8Download import M3u8Download\r
\r
M3u8Download(\r
m3u8_url="\x3Cuser_provided_url>",\r
file_path="\x3Coutput_name>", # Without extension; TS temp dir and final MP4 use this name\r
max_workers=64, # Concurrent download threads\r
num_retries=10, # Retry count on download failure\r
base64_key=None # Optional: base64-encoded AES-128 key for encrypted streams\r
)\r
```\r
\r
#### Key Parameters\r
\r
| Parameter | Description |\r
|-----------|-------------|\r
| `m3u8_url` | M3U8 playlist URL or local file path |\r
| `file_path` | Base name for temp folder and output MP4 file |\r
| `max_workers` | Max concurrent download threads (default: 64) |\r
| `num_retries` | Download retry count on failure (default: 10) |\r
| `base64_key` | Optional base64-encoded decryption key for AES-128 encrypted streams |\r
\r
### 4. What Happens During Download\r
\r
1. **Parse M3U8**: Fetches and parses the M3U8 playlist. If it is a master playlist (contains `EXT-X-STREAM-INF`), automatically follows the redirect to the media playlist.\r
2. **Download key**: If the playlist specifies `EXT-X-KEY`, the encryption key is downloaded (or uses the provided `base64_key`).\r
3. **Download segments**: All TS segments are downloaded concurrently with progress bar display.\r
4. **Merge**: ffmpeg merges all TS segments into a single MP4 file.\r
5. **Cleanup**: After verifying the MP4 file size matches the total TS size (within 10% tolerance), temporary TS files, key file, and M3U8 file are deleted automatically.\r
\r
### 5. Handle Errors\r
\r
- If ffmpeg is not found, inform the user to install it and add to PATH.\r
- If download fails due to network issues, the retry mechanism will attempt `num_retries` times.\r
- If the MP4 output size does not match the TS total size, temporary files are preserved for manual inspection.\r
- For encrypted streams without a provided key, the script attempts auto-download; if that fails, ask the user for the `base64_key`.\r
\r
## Scripts\r
\r
### `scripts/M3u8Download.py`\r
\r
Main download script containing the `M3u8Download` class. This is the primary script to use for all M3U8 download operations.\r
\r
## Notes\r
\r
- The script supports both URL-based and local file-based M3U8 inputs.\r
- Chinese filenames and paths are supported.\r
- On Windows, `os.startfile()` is used to open the output directory after download completes.\r
- Do NOT modify the source code in `scripts/` - use it as-is.\r
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install jyt-m3u8-downloader - 安装完成后,直接呼叫该 Skill 的名称或使用
/jyt-m3u8-downloader触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
m3u8 video downloader 是什么?
This skill should be used when the user wants to download videos from M3U8 streaming URLs. It handles parsing M3U8 playlists (including nested multi-bitrate... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 98 次。
如何安装 m3u8 video downloader?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install jyt-m3u8-downloader」即可一键安装,无需额外配置。
m3u8 video downloader 是免费的吗?
是的,m3u8 video downloader 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
m3u8 video downloader 支持哪些平台?
m3u8 video downloader 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 m3u8 video downloader?
由 unixsam(@jyt2018)开发并维护,当前版本 v1.0.0。