Tutorial: How to integrate several epg guides in tvheadend

Then you can’t write to Unix socket, because CoreElec’s nc version does not support that.

You can try here: https://forum.libreelec.tv/thread/209-socat-problem/ somebody mentioned linked socat version worked

According to here you can also use curl, however that throws a timed out error. Some say, it’s ‘normal’ but no records are being added to TvH EPG Grabber Channels in the TvH Server GUI.

~/.kodi/userdata # curl -d @xmltv.xml -X POST -m 5 --unix-socket /storage/.kodi/userdata/addon_data/service.tvheadend42/epggrab/xmltv.sock http://google.com
curl: (28) Operation timed out after 5001 milliseconds with 0 bytes received
~/.kodi/userdata #

Make sure your socket path is correct and grabber is enabled.

Got another version of socat, and now it’s working fine.

Thanks for your input.

Greg

That could be useful for others, you can post how did you manage to install socat

I’ve been using curl for around a year and it’s working fine.

Hello,

Was trying to follow above guide line to import my xml file to tvheadend, but failed

I am using WebGrab++ to get the xml first and try to use @giaur500 method to import the file to /storage/.kodi/userdata/addon_data/service.tvheadend42/epggrab/xmltv.sock by using socat or nu or curl , socat and nu was not included in my coreelec. Only curl included, and when i am trying to input the xml by curl with below command got the error.

LibreELEC:~ # curl -o /storage/.kodi/userdata/addon_data/service.tvheadend42/epggrab/xmltv.sock http://xxxxxxxxx/xmltv.xml
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0Warning: Failed to create the file
Warning: /storage/.kodi/userdata/addon_data/service.tvheadend42/epggrab/xmltv.s
Warning: ock: No such device or address
100 312 100 312 0 0 14857 0 --:–:-- --:–:-- --:–:-- 14857
curl: (23) Failed writing body (0 != 312)
LibreELEC:~ #

Would like to ask if anyone know why this is happening? and if i use WinSCP to login to coreelec directly and replace the xmltv.sock, is it going to work the same ?

Also i am not sure how the EXTERNAL : XMLTV works, dont know how to triggers this, is it the grabber will grab the xml once i enable it ? or if the xmltv.sock file once renewed, it will auto update the epg immediately ? is there any other setting need to be done ? does it need to disable the OTG setting in TV adaptor tab and empty the EPG module id under MUXES tab ?

Because i tried replace the xmltv.sock directly with a .xml file, and reboot the coreelec, it wont import the xml, but i can see the xmltv.sock will turn to 0 byte after i reboot the system.

i did change the channel id in the .sock file to match the currect channel, eg :
< programme start=“20210122060000 +0800” stop=“20210122070000 +0800” channel=“31dee8946e416198ae0d9d31a046fa94”>
XXXXXX</title
/programme>

Sorry so many questions… Thank you all !

I don’t understand where the problem is. If you have the EPG file in XMLTV format, you just have to go to the tvheadend addon settings and enter it. Then you just have to open the tvheadend service settings and enable the EPG Grabber Name named Internal XMLTV: tv_grab_file.

thank you for your reply !
"go to the tvheadend addon settings and enter it "
do you mean the directory
“/storage/.kodi/userdata/addon_data/service.tvheadend42/epggrab/xmltv.sock” ?
if would be great if you can help me with that , appreciate it ! :slight_smile: :slight_smile:


and should be normal if it showing below path at the Path gray input box ?
/storage/.kodi/userdata/addon_data/service.tvheadend42/epggrab/xmltv.sock

if i have the epg.xml file, can i just rename the file to xmltv.sock , and replace the file xmltv.sock at /storage/.kodi/userdata/addon_data/service.tvheadend42/epggrab/ to get the epg match to the channel ? is it how to get this EPG grabber up and running ?

thank you … :slight_smile: :smiley:

NO!

"go to the tvheadend addon settings and enter it " is:
Go to System-Addons-My_addons-Services-Tvheadend_server-Configure-XMLTV

Thank you !! It totally helps me ! But i still cannot get the xml import it after i enter the file path or try the web option in the addon config under coreelec, is there any setting i need to do further inside the tvheadend server web interface ? like do i need to turn off the “configuration - DVB input - TV adapters - Over-the-air EPG” check box ? or anything else ?
thank you again !

Sorry, I can’t help you, I have been using the technique described in the first post of the topic with six different EPG sources (internal grabbers) for almost two years and I have no problem. Nor do I use Over-the-air grabbers because they do not solve any problem for me and they are using (abusing) the tuners.

You can try to change line 13 of the internal grabber (first post) and replace the wget command with the cat command.

I advice to write to socket, maybe addon tries to do the same, look at logs to see what happens. I don’t use Tvheadend for iptv anymore, because simple iptv addon allows to access archive so it’s betteer. For dvb-t, I am happy with over the air epg.

I can’t help you with curl, sorry.

I would recommend this method too as this is what I’m using with TvH. I’m writing 3 different XML files to the socket. I did find however during my testing that only socat would work and I had to find a different version to the one in CE to get it to work. Now it works like a charm.

Thank you guys, after i set the path at the addon setting, now i am able to get the epg from the xml file, was totally forgot there are some setting need to be set at the coreelec addon. Thank you again ! :smiley: :smiley: :smiley:

A strange thing happens to me with EPG and IPTV.
Everything works perfectly in the channels I use, but unfortunately in the “extra text” field I get a boring “index_temp3.” in channels that do not have any extra text taken from the EPG.
Does it happen to someone else too?
In the image the first two at the top for example.

EDIT: well, I only found out now that it is the very source of the EPG that is wrong.

@cubimol, thanks for the tutorial. This worked perfectly for me.

If anyone is looking for New Zealand XMLTV EPG data, the freeview link on the page https://nzxmltv.com/ works for me using the above. I am using the TVHeadend server addon on LibreELEC running on a Raspberry Pi 3.

Can someone please confirm if this script is still working, I have tried everything but my tv_grab_uk not showing up in the tvheadend backend.

Any help would be appreciated .

The EPG automatic download scripts continue to work without problems, the most common mistake that someone can make is not assigning the execution attributes to the script and not knowing the tvheadend binary directory where to copy the scripts. To see the errors activate debug on the web of the tvheadend service.

(I have been using it for many years with docker linuxserver/tvheadend service version 4.3 last update 2023/03/05)