Files
projects/Dockers/iptv-filter/iptv-boxsets.sh
T
Bram 0d43176adf
Build and Push Docker Images / build-and-push (push) Successful in 1m50s
ip tv filter
2025-04-16 20:46:48 +02:00

18 lines
473 B
Bash
Executable File

#!/bin/bash
m3u_src="http://iptv.example.com/iptv.m3u"
m3u_file=/tmp/iptv-`date +%Y%m%d`.m3u
if [ ! -f "$m3u_file" ]; then
# Delete files downloaded over seven days ago.
find /tmp/iptv-* -mtime +7 -exec rm {} \;
# Download the m3u files.
curl -s $m3u_src --output $m3u_file
fi
echo "#EXTM3U"
grep -E "^#EXTINF.*group\-title=\"\|EN\| SERIES" -A 1 $m3u_file | sed "/^--$/d"
grep -E "^#EXTINF.*group\-title=\"\|EN.+MOVIES" -A 1 $m3u_file | sed "/^--$/d"
exit 0