01-24-2021, 05:04 PM
Hi folks,
I feel your pain in getting TV Headend working with EPG updates. I've been battling this for a loooooong time and finally have been successful.
The approach I describe here is slightly different to the one above and uses the standard TVHeadend External XMLTV EPG grabber listed in the TVHeadEnd grabber page. The XMLTV EPG data is downloaded using a script, the script collects the EPG data and sends it to the TVHeadend Linux socket named xmltv.sock that is provided by the standard "External: XMLTV" grabber.
The EPG update script is executed every day based on a scheduled task running on the same system as TVHeadend is running on. (Linux Sockets can only send and receive data between programs running on the same system).
You've most likely been successful with the first part, ensuring the services in the M3U have been mapped in TVH:
With the IP Channels mapped now configure the EPG Grabber as follows:
Note that my installation was on a Synology running DSM6.0, I didn't need to change permissions for the script to be executable - your Linux installation may require that (I'm not a Linux expert).
After the first setup of the grabber, two manual executions of the script are required:
I feel your pain in getting TV Headend working with EPG updates. I've been battling this for a loooooong time and finally have been successful.
The approach I describe here is slightly different to the one above and uses the standard TVHeadend External XMLTV EPG grabber listed in the TVHeadEnd grabber page. The XMLTV EPG data is downloaded using a script, the script collects the EPG data and sends it to the TVHeadend Linux socket named xmltv.sock that is provided by the standard "External: XMLTV" grabber.
The EPG update script is executed every day based on a scheduled task running on the same system as TVHeadend is running on. (Linux Sockets can only send and receive data between programs running on the same system).
You've most likely been successful with the first part, ensuring the services in the M3U have been mapped in TVH:
- Create the IPTV Network and give it a friendly name such as “UK IPTV”
- Check the “Create Bouquet” option so that you can automatically map the offered services to channels via selection of the bouquet.
-
Set the number of input streams based on your available bandwidth (I have 4 streams i.e: 1 watching, 3 recording).
- As soon as “Create” is clicked, the services offered will be scanned. They can be rescanned by clicking the Force Scan button if necessary.
- Wait until #Muxes = #Services
- If you are using the bouquet to map the services to channels, in the Configuration > Channel > EPG > Bouquet’s dialog, enable the bouquet for the network you created to automatically map the services to channels
With the IP Channels mapped now configure the EPG Grabber as follows:
- In the Tvheadend admin interface: Configuration > Channel / EPG / EPG Grabber Modules menu, enable the “External: XMLTV” grabber. This will be used to receive XMLTV EPG data via a script - All other grabbers that are not used can be disabled.
- In the EPG Grabbers dialog, note the path to xmltv.sock listed in the External: XMLTV" grabber settings (it will be grey and not possible to change it)
- Create the script file based on the code below replacing...{your-egg-best-filename} with the filename EPG-best have provided to you and...replacing {your path to xmltv.sock} with the path you noted from your installation of TVHeadend.
- Save the script as epgbest_to_xmlsock
- Create a Scheduled Task to execute the script every day at 03:00
Code:
#!/bin/sh -v
URL="https://epg.best/{your-epg-best-filename}.xml.gz"
XML=$(mktemp -u)
SOCKET="/{your path to xmltv.sock}/xmltv.sock"
curl -so $XML $URL
if gzip -t $XML; then
zcat $XML | socat -dd stdin UNIX-CONNECT:$SOCKET
fi
rm $XML
Note that my installation was on a Synology running DSM6.0, I didn't need to change permissions for the script to be executable - your Linux installation may require that (I'm not a Linux expert).
After the first setup of the grabber, two manual executions of the script are required:
- The first run will collect channels and populate the EPG Grabber Channels dialog.
- The second run will collect broadcasts associated with the channels and populate the Electronic Program Guide.