Tutorial: How to integrate several epg guides in tvheadend

But you still can load as many xmltv files via socket as you want with external xmltv grabber. I assume you have .xml files you want to load or you have some source where you can download them from.

You only need to add cron job on device where tvh is running (that may be your box itself)

Great! write a little manual!

There is nothing else to write ā€¦ enable external xmltv socket in tvh, then write file content to that socket. Epg data will be automatically loaded to tvheadend database. Then you can map xmltv entries to channels in tvheadend settings (in case when xmltv channel name is not the same as your providerā€™s channel name so it canā€™t be auto handled).

I always preffer external grabber, as itā€™s more flexible and straightforward to configure. The only issue is you need to run it externally, but simple cronjob just does a job without any problem.

I too would like to see a small set of instructions as Iā€™m presently using @cubimol method. Iā€™m particularly interested in the part that describes the ā€œthen write file content to that socketā€. Please just a couple of minutes to help a noob and others that donā€™t understand your method.

TIA

Greg

I suspect that this is what is being referenced.

At the bottom of the initial page there is reference to external interfaces and the command to the socket netcat -u SOCKET_PATH

Yes, thank you. However it does not explain what needs to be done to configure the various XML Locations. eg: Love Your Garden

TIA

My command to write socket:

cat guide.xml | socat - UNIX-CONNECT:/home/hts/.hts/tvheadend/epggrab/xmltv.sock

You need to set your socket and guide paths

Thank you will try that. However I live in a region with several overlapping epg xmlā€™s that will contain duplicates. So if I cat each xml for each area into one xml, like guide.xml is that going to be an issue.

EDIT: I have no socat.

You need to have xmltv file. Either you can use webgrab++ or you can find it somewhere to download if available.

You can use tv_cat to join xmltv files into one single file, but in this case thatā€™s not neccesary. Just write your all files to socket.

So I can do:

cat guide1.xml | socat - UNIX-CONNECT:/home/hts/.hts/tvheadend/epggrab/xmltv.sock
cat guide2.xml | socat - UNIX-CONNECT:/home/hts/.hts/tvheadend/epggrab/xmltv.sock
cat guide3.xml | socat - UNIX-CONNECT:/home/hts/.hts/tvheadend/epggrab/xmltv.sock

Yes, you can. All data should appear in tvh. Overlapping data will be overwitten (the same channel/datetime)

Thanks. I suppose I can also do this:
cat guide*.xml | socat - UNIX-CONNECT:/home/hts/.hts/tvheadend/epggrab/xmltv.sock

Just have to workout why Iā€™m getting this error:

LibreELEC:~/.kodi/userdata # cat xmltv.xml | socat -UNIX-CONNECT:/storage/.kodi/userdata/addon_data/service.tvheadend42/epggrab/xmltc.sock
socat: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
LibreELEC:~/.kodi/userdata #

Why are you using LibreELEC?

Something is wrong with your socat installation. But you can also use netcat for this purpose

Not installed and Iā€™m having trouble trying to find how to install it.

Itā€™s just that I have a VM with LE on it that I do my testing before I make changes to my CE N2.

Well it looks like both socat and netcat are not included. Iā€™m running tvh on my Debian server, so I have no problems. I guess recommended way is to create binary addon, compile and install, similar as other programs addons have been created.

ā€œUglyā€ way you can try to take existing binary + dependecies and try to run it (which it seems you are trying to do)

I was wrong, nc is included in CoreElec. So you can use it to write socket

I tried:

cat xmltv.xml | nc -w 5 -U /path/to/xmltv.sock

and I get an error saying invalid -U option.

# nc --help
BusyBox v1.31.0 (2020-04-12 14:38:24 UTC) multi-call binary.

Usage: nc [OPTIONS] HOST PORT  - connect
nc [OPTIONS] -l -p PORT [HOST] [PORT]  - listen

        -e PROG Run PROG after connect (must be last)
        -l      Listen mode, for inbound connects
        -lk     With -e, provides persistent server
        -p PORT Local port
        -s ADDR Local address
        -w SEC  Timeout for connects and final net reads
        -i SEC  Delay interval for lines sent
        -n      Don't do DNS resolution
        -u      UDP mode
        -v      Verbose
        -o FILE Hex dump traffic
        -z      Zero-I/O mode (scanning)