This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
FROM php:7.2-apache
|
||||
|
||||
COPY . /var/www/html
|
||||
COPY vhost.conf /etc/apache2/sites-available/000-default.conf
|
||||
|
||||
EXPOSE 80
|
||||
RUN chown -R www-data:www-data /var/www/html && a2enmod rewrite
|
||||
@@ -0,0 +1,21 @@
|
||||
# IPTV M3U filter
|
||||
|
||||
A simple web server that will download an M3U file, at most once a day, and filter that file down to selected groups.
|
||||
|
||||
## Docker
|
||||
|
||||
To build and run the docker image use:
|
||||
|
||||
docker build -t iptv-filter .
|
||||
docker run -itd --name iptv-filter -p 81:80 iptv-filter
|
||||
|
||||
You can connect to the container with:
|
||||
|
||||
docker exec -it iptv-filter /bin/bash
|
||||
|
||||
## Docker - Raspberry Pi
|
||||
|
||||
To build the image on a Raspberry Pi, use:
|
||||
|
||||
docker build -f Dockerfile.rpi -t iptv-filter .
|
||||
docker run -itd --name iptv-filter -p 81:80 iptv-filter
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
exec('/var/www/html/iptv-boxsets.sh > /tmp/iptv-boxsets.m3u');
|
||||
|
||||
header("Content-Description: File Transfer");
|
||||
header("Content-Type: application/octet-stream");
|
||||
header("Content-Disposition: attachment; filename=\"iptv-boxsets.m3u\"");
|
||||
readfile("/tmp/iptv-boxsets.m3u");
|
||||
?>
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/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
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
exec('/var/www/html/iptv-tv.sh > /tmp/iptv-tv.m3u');
|
||||
|
||||
header("Content-Description: File Transfer");
|
||||
header("Content-Type: application/octet-stream");
|
||||
header("Content-Disposition: attachment; filename=\"iptv-tv.m3u\"");
|
||||
readfile("/tmp/iptv-tv.m3u");
|
||||
?>
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/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=\"IRE' -A 1 $m3u_file | sed "/^--$/d"
|
||||
grep -E '^#EXTINF.*group\-title=\"UK\|' -A 1 $m3u_file | sed "/^--$/d"
|
||||
grep -E '^#EXTINF.*group\-title=\"USA' -A 1 $m3u_file | sed "/^--$/d"
|
||||
grep -E '^#EXTINF.*group\-title=\"CA' -A 1 $m3u_file | sed "/^--$/d"
|
||||
grep -E '^#EXTINF.*group\-title=\"SP' -A 1 $m3u_file | sed "/^--$/d"
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1 @@
|
||||
latest
|
||||
@@ -0,0 +1,9 @@
|
||||
<VirtualHost *:80>
|
||||
DocumentRoot /var/www/html
|
||||
|
||||
<Directory "/var/www/html">
|
||||
AllowOverride all
|
||||
Require all granted
|
||||
DirectoryIndex iptv-tv.php
|
||||
</Directory>
|
||||
</VirtualHost>
|
||||
Reference in New Issue
Block a user