📺 The Problem with IPTV / IPTV 的问题

If you have a Home Lab, you probably watch IPTV (Internet Protocol Television). But maintaining those .m3u playlists is a headache:
如果你玩 Home Lab,你大概率会看 IPTV。但维护那些 .m3u 列表简直让人头大:

  1. Dead Links: Sources die every day.
  2. Validation: Checking 5,000 channels manually is impossible.
  3. Updates: Downloading new lists manually is tedious.
  4. Formatting: Every player (TiviMate, Plex, Emby) wants a slightly different format.
  5. 死链:源每天都在挂。
  6. 验证:手动检查 5000 个频道是不可能的。
  7. 更新:手动下载新列表很繁琐。
  8. 格式:每个播放器(TiviMate, Plex, Emby)要求的格式都略有不同。

I built IPTV-Manager to run on my Linux server (Debian/Ubuntu) and handle all of this automatically.
我编写了 IPTV-Manager,运行在我的 Linux 服务器上,全自动处理这一切。


⚡️ Key Features / 核心功能

1. Concurrent Downloading / 并发下载

It uses multi-threading to download sources from multiple URLs simultaneously. It’s fast, resilient, and automatically retries if a connection drops.
它使用多线程同时从多个 URL 下载源。速度快,韧性强,连接断开会自动重试。

2. Smart Encoding Detection / 智能编码检测

Ever opened a playlist and saw ???? or nonsense characters? That’s a UTF-8 vs. GBK/ISO-8859-1 issue.
IPTV-Manager uses chardet to automatically detect and convert any text encoding to standard UTF-8. No more garbled text.
是否曾打开播放列表却看到一堆乱码?那是编码问题。
IPTV-Manager 使用 chardet 自动检测并转换任何文本编码为标准的 UTF-8。告别乱码。

3. Automated Maintenance / 自动化维护

  • Backup: Keeps history versions (e.g., domestic_20240101.m3u) in case a new update is broken.
  • Cleanup: Automatically deletes backups older than 7 days to save disk space.
  • Logs: Detailed logs for every run, so you know exactly what happened.
  • 备份:保留历史版本,以防新更新的源不可用。
  • 清理:自动删除超过 7 天的备份以节省空间。
  • 日志:详细记录每次运行,让你对发生了什么一清二楚。

🚀 Easy Installation / 极速安装

I wrote a one-key installation script that handles everything: dependencies, directories, and even setting up cron jobs.
我写了一个一键安装脚本,搞定一切:依赖、目录,甚至 cron 定时任务。

One-Line Install / 一行命令安装

curl -fsSL https://raw.githubusercontent.com/yuanweize/IPTV-Manager/refs/heads/main/install.sh | bash

Interactive Menu / 交互式菜单

Once installed, just type iptv in your terminal to open the management console:
安装完成后,只需在终端输入 iptv 即可打开管理控制台:

============================================================
IPTV直播源管理系统
============================================================
1. [下载] 下载/更新直播源
2. [状态] 查看系统状态
3. [列表] 查看直播源列表
4. [配置] 配置管理
...

⚙️ Usage Scenarios & Advanced Config / 高级使用场景与配置

Scenario A: Plex / Emby / Jellyfin (Local)

This is the most common setup.
这是最常见的设置。

  1. Configure: Set download_path to a folder visible to Plex (e.g., /mnt/media/iptv).
  2. Automate: Add a cron job to update at 4 AM.
    0 4 * * * /usr/bin/python3 /opt/IPTV-Manager/main.py --update
  3. Plex Setup: Add a “Live TV & DVR” source in Plex, pointing to the local file path.

Scenario B: Serving via Nginx (Remote)

If you want to access your playlist from your TV or phone while away from home.
如果你想在户外通过电视或手机访问你的播放列表。

  1. Nginx Config:
    server {
    listen 8080;
    location /iptv {
    alias /opt/IPTV-Manager/data;
    autoindex off;
    }
    }
  2. TiviMate URL: Enter http://your-server-ip:8080/iptv/domestic.m3u.

Scenario C: Custom Filtering (Regex)

You can filter out unwanted channels (e.g., shopping channels) by editing config.json:
你可以通过编辑 config.json 过滤掉不需要的频道(例如购物频道):

"filters": [
"购物",
"重播",
"CCTV-Test"
]

🔗 Download / 下载

Make your Home Lab smarter today.
让你的 Home Lab 今天就变聪明。

👉 GitHub Project: IPTV-Manager


GitHub Stars