加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
iptv.sh 1.16 KB
一键复制 编辑 原始数据 按行查看 历史
zhuxinfu88 提交于 2024-10-05 18:23 . Add files via upload
#!/bin/sh
# Directory for m3u files
M3U_DIR=m3u
# Create m3u directory if it doesn't exist
mkdir -p "$M3U_DIR"
rm "$M3U_DIR/ipv6.m3u"
wget https://raw.githubusercontent.com/fanmingming/live/main/tv/m3u/ipv6.m3u -O "$M3U_DIR/ipv6.m3u"
# 央视源
rm "$M3U_DIR/CCTV.m3u"
wget https://raw.githubusercontent.com/fanmingming/live/main/tv/m3u/ipv6.m3u -O "$M3U_DIR/CCTV.m3u"
sed -i -n '/央视频道/,+1p' "$M3U_DIR/CCTV.m3u"
sed -i '1i #EXTM3U' "$M3U_DIR/CCTV.m3u"
sed -i '/^\s*$/d' "$M3U_DIR/CCTV.m3u"
# 卫视源
rm "$M3U_DIR/CNTV.m3u"
for keyword in "卫视频道" "数字频道"; do
wget https://raw.githubusercontent.com/fanmingming/live/main/tv/m3u/ipv6.m3u -O "$M3U_DIR/temp.m3u"
sed -i -n "/$keyword/,+1p" "$M3U_DIR/temp.m3u"
cat "$M3U_DIR/temp.m3u" >> "$M3U_DIR/CNTV.m3u"
rm -f "$M3U_DIR/temp.m3u"
done
sed -i '1i #EXTM3U' "$M3U_DIR/CNTV.m3u"
sed -i '/^\s*$/d' "$M3U_DIR/CNTV.m3u"
# 整合源
rm "$M3U_DIR/IPTV.m3u"
cat "$M3U_DIR/CCTV.m3u" "$M3U_DIR/CNTV.m3u" > "$M3U_DIR/IPTV.m3u"
sed -i '/#EXTM3U/d' "$M3U_DIR/IPTV.m3u"
sed -i '1i #EXTM3U' "$M3U_DIR/IPTV.m3u"
sed -i '/^\s*$/d' "$M3U_DIR/IPTV.m3u"
# 节目源
# rm EPG.xml
# wget https://epg.112114.xyz/pp.xml -O EPG.xml
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化