Metadata-Version: 2.4
Name: m3u8-dl-tool
Version: 0.1.4
Summary: A command line m3u8 video downloader
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: pycryptodome
Dynamic: license-file

# M3u8DL

批量下载 m3u8 视频，支持过滤内容完全相同广告 TS 分片。

## 安装

```powershell
py -m pip install m3u8-dl-tool
```

## 快速开始
在终端中运行：
```powershell
m3u8dl
```
JSON 示例：
```json
[
    {
        "title": "第一集",
        "url": "https://example.com/video/index.m3u8"
    },
    {
        "title": "第二集",
        "url": "https://example.com/video/episode2.m3u8"
    }
]
```
查看命令帮助:m3u8dl -h 或 m3u8dl --help
```powershell
m3u8dl -h
```
## 命令行选项
| 选项 | 说明 |
| --- | --- |
| `--base-dir` | 配置文件和输出目录，默认使用当前终端目录 |
| `--json` | 指定视频列表 JSON 文件；默认是 `base-dir` 下的 `m3u8_url.json` |
| `--start-index` | 下载起始索引，从 0 开始，默认是 `0` |
| `--end-index` | 下载结束索引，不包含该索引；默认下载到列表末尾 |
| `--max-workers` | TS 分片并发下载线程数，默认是 `30` |
| `-h`, `--help` | 显示帮助信息 |

示例
```powershell
m3u8dl --base-dir "D:\Videos" --json "series.json" --start-index 0 --end-index 5 --max-workers 10
```
## 在 Python 程序中调用
```python
from M3u8DL import M3u8Downloader

app = M3u8Downloader(
    max_workers=10,
    base_dir=r"D:\Videos",
)

app.run()
```

依赖
安装包时会自动安装 Python 依赖：
- requests
- pycryptodome
