Files
iptv-source-collector/README.md
T

87 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# IPTV 直播源自动采集检测去重
一个实用的 IPTV 直播源工具,自动从多个公开源采集直播源,检测可用性,去重后生成干净的 M3U 播放列表。
## 功能特性
- **自动采集**:从多个公开 IPTV 源采集直播源
- **并发检测**:多线程并发检测直播源可用性
- **智能去重**:基于 URL 和频道名称去重
- **分类整理**:自动按频道类型分类
- **M3U 输出**:生成标准 M3U 播放列表
- **Web 界面**:提供简单的 Web 界面查看结果
## 目录结构
```
iptv-source-collector/
├── README.md
├── requirements.txt
├── config.py # 配置文件
├── collector.py # 采集模块
├── checker.py # 检测模块
├── deduplicator.py # 去重模块
├── main.py # 主程序入口
├── app.py # Flask Web 应用
├── templates/
│ └── index.html # Web 界面
└── output/ # 输出目录(自动创建)
```
## 安装依赖
```bash
pip install -r requirements.txt
```
## 使用方法
### 命令行模式
```bash
# 完整流程:采集 -> 检测 -> 去重 -> 输出
python main.py
# 只采集不检测(快速获取所有源)
python main.py --no-check
# 指定输出文件
python main.py --output my_playlist.m3u
# 设置并发数
python main.py --threads 50
```
### Web 界面模式
```bash
python app.py
```
然后访问 http://127.0.0.1:5000 查看结果。
## 配置说明
编辑 `config.py` 可以自定义:
- `SOURCE_URLS`:采集源地址列表
- `CHECK_TIMEOUT`:检测超时时间(秒)
- `MAX_WORKERS`:并发线程数
- `MIN_SPEED`:最低下载速度要求(KB/s)
## 输出格式
生成的 M3U 文件格式:
```
#EXTM3U
#EXTINF:-1 tvg-name="CCTV-1" group-title="央视",CCTV-1
http://example.com/cctv1.m3u8
```
## 注意事项
- 本工具仅供学习和研究使用
- 请遵守相关法律法规,不要用于非法用途
- 采集源均来自公开网络,如有侵权请联系删除