Kodi Community Forum

Full Version: XMLTV ingetration [solved]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

I could need some help integrating xmltv within tvheadend.
I would disable OTA (EIT) because of continious counter errors, when OTA is triggered. Respectively I will only use OTA for channels which are not integrated within my XMLTV provider.

So would I did so far:

I installed xmltv-utils so that I'm able to use tv_grab_eu_egon.
Afterwards I run this command with --configure and placed the necessary url and channels.. URL --> root-url=http://xmltv.xmltv.se/channels.xml.gz
I think this is working so far without any problems. I'm trigger the update with a separate Cronjob:

*/30    *    *    *    *    /usr/bin/tv_grab_eu_egon --quiet --config-file ~/.xmltv/tv_grab_eu_egon.conf --output ~/.xmltv/tv_grab_file.xmltv
This cron is triggered from the user hts.
Additionally I activated the Internal Modul: "Internal XMLTV: German speaking area (Egon zappt)"

Extra arguments: --config-file /home/hts/.xmltv/tv_grab_eu_egon.conf --output /home/hts/.xmltv/xmltv.file

For any mapped channel, I've added EPG Source from XMLTV and activated the source under EPG Grabber Channels.

The problem I have is, that I don't get the EPG in kodi displayed (or e.g. Android TVHeadend Clients..)
I just had the EPG from OTA Grabber.

Did I forgot something or may I did something wrong?

May this is the problem?

May  8 13:20:18 kodi tvheadend[1890]: /usr/bin/tv_grab_eu_egon: no output detected
May  8 13:20:18 kodi tvheadend[1890]: /usr/bin/tv_grab_eu_egon: grab returned no data

The file (--output) is filled with data:

[email protected]:/home/hts/.xmltv# head -10 tv_grab_file.xmltv
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE tv SYSTEM "xmltv.dtd">
  <channel id="13thstreet.de">
    <display-name lang="sv">13th Street Germany</display-name>

    <icon src="http://logos.xmltv.se/13thstreet.de.png"/>
  <channel id="2.eurosport.de">
    <display-name lang="sv">Eurosport 2 Germany</display-name>
[email protected]:/home/hts/.xmltv# wc -l tv_grab_file.xmltv
232684 tv_grab_file.xmltv

I would appreciate any kind of help.
When I set up tvheadend on my Pi, I use the regular tv_grab_file, but I also need to change permissions to the file, then direct it to my xmltv.xml file created by zap2xml. The only time I'm stuck without the epg, is if I forget to change permissions on the file, and forget to reboot after changing permissions. Not sure if this the issue here.
Also tried with tv_grab_file with 777 permissions. Seems to make no difference.
Syslog says:

May  8 20:21:58 kodi tvheadend[1921]: epggrab: module /usr/sbin/tv_grab_file created
May  8 20:21:58 kodi tvheadend[1921]: xmltv: external socket enabled
May  8 20:21:58 kodi tvheadend[1921]: epgdb: gzip format detected, inflating (ratio 9.9%)
May  8 20:21:58 kodi tvheadend[1921]: epgdb: loaded v2
May  8 20:21:58 kodi tvheadend[1921]: epgdb:   config     1
May  8 20:21:58 kodi tvheadend[1921]: epgdb:   channels   0
May  8 20:21:58 kodi tvheadend[1921]: epgdb:   brands     0
May  8 20:21:58 kodi tvheadend[1921]: epgdb:   seasons    0
May  8 20:21:58 kodi tvheadend[1921]: epgdb:   episodes   186
May  8 20:21:58 kodi tvheadend[1921]: epgdb:   broadcasts 185
May  8 20:21:58 kodi tvheadend[1921]: START: HTS Tvheadend version 4.1-1491~g6c3d114 started, running as PID:1921 UID:108 GID:44, CWD:/ CNF:/home/hts/.hts/tvheadend
I just set up a new install on Raspbian today, and just went through a similar issue.. I couldn't select epg grabber source for each individual channel. I wound up having to run zap2xml again to create a fresh xmltv.xml. I started with a fresh xmltv.xml to begin with, so not sure why.
Finally made it.
If someone runs into the same or similar problem, this is the way how I solved it.

Actually I'm using tv_grab_eu_egon to fetch my epg data.

On Apt based system do the following:

apt-get install xmltv-util socat

After that:

su - hts

tv_grab_eu_egon --configure # Here I'm using the following URL: http://xmltv.xmltv.se/channels.xml.gz
                            # Now select your channels you would like to fetch EPG data for

When you're done, you should have a folder under /home/hts/.xmltv and beneath a file tv_grab_eu_egon.conf.
Now we could fetch our data:

su - hts
/usr/bin/tv_grab_eu_egon --quiet --config-file ~/.xmltv/tv_grab_eu_egon.conf --output ~/.xmltv/tv_grab_file.xmltv

Check if the file ~/.xmltv/tv_grab_file.xmltv (as user hts!) is created and filled with data.
If everything worked so far, we could go ahead with TVHeadend.
Because the fact, that I would like to control when data is pushed to TVHeadend, I activated the EPGGrabber Module "External: XMLTV"

!!! Note that I've got "Internal: XMLV Germany speaking area (Egon zappt)" disabled

After enabling and saving it, we should have a socket file: /home/hts/.hts/tvheadend/epggrab/xmltv.sock (will need that for socat later).
Additionally we have to map the EPG Source to the channels. You can do that in channel menu under Configuration (EPG Source). You may want to enable "Automatically map EPG Source" which should do this work for you (in optimal case).
Also make sure that you have no data in "Reuse EPG from. Reuse EPG from another Channel". I think one of my problem was, that there were channels mapped in the run.
Note: If one of your channels is not listed within the XMLTV source, disable "Automatically map EPG Source". Therefore TVHeadend will use OTA Trigger if enabled.

Now we can push our EPG data to the socket using socat:

wget https://raw.githubusercontent.com/Rigolo/tv-grab-file/master/tv_grab_file -O /usr/sbin/tv_grab_file

chmod +x /usr/sbin/tv_grab_file

su - hts
/usr/sbin/tv_grab_file | socat - UNIX-CONNECT:/home/hts/.hts/tvheadend/epggrab/xmltv.sock

In /var/log/syslog you should see similar messages:

May  9 15:10:47 kodi tvheadend[1996]: xmltv: parse took 0 seconds
May  9 15:10:47 kodi tvheadend[1996]: xmltv:   channels   tot=  160 new=    0 mod=    0
May  9 15:10:47 kodi tvheadend[1996]: xmltv:   brands     tot=    0 new=    0 mod=    0
May  9 15:10:47 kodi tvheadend[1996]: xmltv:   seasons    tot=    0 new=    0 mod=    0
May  9 15:10:47 kodi tvheadend[1996]: xmltv:   episodes   tot= 5173 new= 2280 mod= 3412
May  9 15:10:47 kodi tvheadend[1996]: xmltv:   broadcasts tot= 5173 new=  960 mod= 4041

To do this automatically, I've put two lines into crontab of the user hts:

su - hts
crontab -e

*/30    *   *   *   *   /usr/bin/tv_grab_eu_egon --quiet --config-file ~/.xmltv/tv_grab_eu_egon.conf --output ~/.xmltv/tv_grab_file.xmltv
31,1    *   *   *   *   /usr/sbin/tv_grab_file | socat - UNIX-CONNECT:/home/hts/.hts/tvheadend/epggrab/xmltv.sock

That's all. Now you should have tons of EPG data.