AI 生成: 一个自动采集IPTV频道(央视、卫视、地方台)并生成M3U播放列表的Python工具,支持每日定时更新。

This commit is contained in:
admin
2026-09-28 22:18:45 +08:00
commit ecfc269b49
4 changed files with 357 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
"""配置文件"""
# 采集源列表(公开的IPTV源)
# 每个源应返回M3U或TXT格式的频道列表
SOURCES = [
# 示例源,实际使用时请替换为可用的公开源
"https://raw.githubusercontent.com/iptv-org/iptv/master/streams/cn.m3u",
"https://raw.githubusercontent.com/iptv-org/iptv/master/streams/cn_sichuan.m3u",
"https://raw.githubusercontent.com/iptv-org/iptv/master/streams/cn_guangdong.m3u",
]
# 输出文件路径
OUTPUT_FILE = "output/iptv.m3u"
# 请求超时时间(秒)
REQUEST_TIMEOUT = 15
# 用户代理
USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
# 频道分组关键词映射
GROUP_KEYWORDS = {
"央视": ["CCTV", "央视", "CCTV-"],
"卫视": ["卫视", "TVS", "星空", "凤凰"],
"地方台": ["地方", "市", "县", "区", "广东", "四川", "湖南", "浙江", "江苏", "山东", "河南"],
}
# 默认分组
DEFAULT_GROUP = "其他"