| 
 TVheadend EPG - AAJarvis -  03-31-2020
 
 Hi,
 
 I've recently started using TVheadend, I'm a complete noob (with tvheadend, I'm pretty good with linux) and not sure how to get IPTV-EPG working.
 
 
 I cant get the EPG Grabber working for my playlist. Looks like you need a script and a cron job.
 
 Does anyone have TVheadend set up and working and can help me?
 
 Thanks
 
 Alex
 
 
 RE: TVheadend EPG - Wally73 -  04-02-2020
 
 https://www.google.com/search?q=tvheadend+external+xmltv+grabber
 
 
 RE: TVheadend EPG - jeremyrem -  04-08-2020
 
 Easiest way to do it
 
 create a file in /usr/bin/ called tv_grab_iptv-epg
 
 
 
 Code: nano /usr/bin/tv_grab_iptv-epg
Paste this script and edit <url> with your EPG url
 
 
 Code: #!/bin/bashdflag=
 vflag=
 cflag=
 if (( $# < 1 ))
 then
 # <url> = your full EPG url https://iptv-epg.com/#########.xml
 wget -q -O - <url>
 exit 0
 fi
 
 for arg
 do
 delim=""
 case "$arg" in
 #translate --gnu-long-options to -g (short options)
 --description) args="${args}-d ";;
 --version) args="${args}-v ";;
 --capabilities) args="${args}-c ";;
 #pass through anything else
 *) [[ "${arg:0:1}" == "-" ]] || delim="\""
 args="${args}${delim}${arg}${delim} ";;
 esac
 done
 
 #Reset the positional parameters to the short options                                                                                                                                                                                        eval set -- $args                                                                                                                                                                                                                                                                                                                                                                                                                                                                         while getopts "dvc" option
 do
 case $option in
 d)  dflag=1;;
 v)  vflag=1;;
 c)  cflag=1;;
 \?) printf "unknown option: -%s\n" $OPTARG
 printf "Usage: %s: [--description] [--version] [--capabilities] \n" $(basename $0)
 exit 2
 ;;
 esac >&2
 done
 
 if [ "$dflag" ]
 then
 printf "tv_grab_iptv-epg is a simple grabber that just reads the EPG provided by iptv-epg.com\n"
 fi
 if [ "$vflag" ]
 then
 printf "0.1\n"
 fi
 if [ "$cflag" ]
 then
 printf "baseline\n"
 fi
 
 exit 0
This can also be done for any additional EPG urls/sources you have.
 
 Restart TVHeadEnd and find/enable the module
 
 ![[Image: nme0k127.png]](https://img.jremi.com/selif/nme0k127.png)  
 
 RE: TVheadend EPG - solomalee -  01-24-2021
 
 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:
 
 
 Note that channels will not be visible in the Configuration > Channel / EPG > Channels dialog until mapping has been done!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:
 Hope others find this useful.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.
 
 
 
 |