NOTE! This site uses cookies and similar technologies.

If you not change browser settings, you agree to it.

I understand

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: TVHeadend EPG via XML File

TVHeadend EPG via XML File 2 years 4 months ago #1

  • rjbathgate
  • rjbathgate's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 13
  • Karma: 0
Hi

I'm in New Zealand, on DVB/T (Freeview) and the OTA EPG for the channels is limited to +2 hours, so I am trying to set it up via XML.

I have a XML file source and I'll create a script to grab the latest version every 12 hours, and as a test I have saved the current XML to /storage/downloads/freeview.xml

And then given it CHMOD 777.

Then within Kodi / Addons / TVHeadend / Configure, I have set XMLTV to "FILE" and the file location 'storage/downloads/freeview.xml'

However it makes no difference!

My plan was to use this XML file, and update it via cron as per www.geekzone.co.nz/forums.asp?forumid=126&topicid=90470

I've also since found this XMLTV Grabber PY script for NZ (nice.net.nz/tv_grab_nz-py/) but have no idea where to start to set it up. My XML file idea sems alot simplier but just isn't working as I expect.

Any hints on how to either get the XML from FILE working, or how to use this PY XMLTV grabber script would be most appreciated.

Many thanks in advance
The administrator has disabled public write access.

TVHeadend EPG via XML File 2 years 4 months ago #2

  • nickr
  • nickr's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1165
  • Thank you received: 132
  • Karma: -262
Hello fellow kiwi. You would get the same result either way as tv_grab_nz-py downloads the same data.

I use mythtv but have dabbled with tvheadend. I assume there must be some place to configure the xmltvid's to channels. Have you done that? The xmltvid's look like tv1.freeviewnz.tv
The administrator has disabled public write access.

TVHeadend EPG via XML File 2 years 4 months ago #3

  • rjbathgate
  • rjbathgate's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 13
  • Karma: 0
nickr wrote:
Hello fellow kiwi. You would get the same result either way as tv_grab_nz-py downloads the same data.

I use mythtv but have dabbled with tvheadend. I assume there must be some place to configure the xmltvid's to channels. Have you done that? The xmltvid's look like tv1.freeviewnz.tv

Thanks for the reply.

I did have the channel names as generic like TV ONE. I've changed them to the likes of tv1.freeview.nz / tv2.freeview.nz but still no change. Although it might require the update to re-run / reboot. Will have to try that later.

Re the tv_grab_nz-py process - how would I set that up, and would I need to set up the file source still, like I have with my test download freeview.xml version? the PY script looks like it does alot more than simply extract the XML from the GZ and dump it in a XML format somewhere so wondering if the PY does something a little more, which I am missing with my manual XML method?

Thanks
The administrator has disabled public write access.

TVHeadend EPG via XML File 2 years 4 months ago #4

  • rjbathgate
  • rjbathgate's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 13
  • Karma: 0
Hi

After setting the channel names to match the XML name nodes (e.g. tv1.freeview.nz) there's still no change - it's not reading the XMl file I've given it.

Am I missing a step to tell TVHeadend to red my XML? I've set it up in Kodi / Addons / TVheadend / Configure / EPG to use FILE and given it the file path, and said file is owned by root, but has 777 permissions.

Thanks
The administrator has disabled public write access.

TVHeadend EPG via XML File 2 years 4 months ago #5

  • nickr
  • nickr's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1165
  • Thank you received: 132
  • Karma: -262
Accroding to the Help page on my tvheadend, the xmltv id should be specified in the EPG Grab Source field
The administrator has disabled public write access.

TVHeadend EPG via XML File 2 years 4 months ago #6

  • rjbathgate
  • rjbathgate's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 13
  • Karma: 0
nickr wrote:
Accroding to the Help page on my tvheadend, the xmltv id should be specified in the EPG Grab Source field

Thanks for the reply.

Might be a version issue - I'm running v3.9.2765

Configuration > Channel / EPG

For each channel there is a field "EPG Source" but when you edit this, this is a dropdown menu only (with no options populated) and you cannot manually enter a value.

So this EPG Source dropdown obviously comes from a list elsewhere.... not sure where!

:-s

Thanks
The administrator has disabled public write access.

TVHeadend EPG via XML File 2 years 4 months ago #7

  • nickr
  • nickr's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1165
  • Thank you received: 132
  • Karma: -262
I am working on it now.

Better than my real job!
The administrator has disabled public write access.
The following user(s) said Thank You: rjbathgate

TVHeadend EPG via XML File 2 years 4 months ago #8

  • nickr
  • nickr's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1165
  • Thank you received: 132
  • Karma: -262
I did it, I'll write it up tonight. with purty pics.
The administrator has disabled public write access.

TVHeadend EPG via XML File 2 years 4 months ago #9

  • rjbathgate
  • rjbathgate's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 13
  • Karma: 0
awesome thanks.
Better than my real job!

Hope you don't work for me....!
The administrator has disabled public write access.

TVHeadend EPG via XML File 2 years 4 months ago #10

  • nickr
  • nickr's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1165
  • Thank you received: 132
  • Karma: -262
I work for myself, which means I will catch up at some stage...

OK no pics at this time, but I found this worked:

1. I am on openelec for rpi2 5.0.8.
2. I installed the tvheadend server from Unofficial Addons|Services.
3. I downloaded tv_grab_nz-py from nice.net.nz/tv_grab_nz-py/ and saved it to my openelec rpi. I left it in the home directory (ie /storage/). It should probably go somewhere else, but this is not meant to be the canonical. The script is python and xmltv compliant, but doesn't need the xmltv package installed, it is standalone.
4. You need to configure the grabber. Unfortunately there is a bug in the script that makes it bomb out over the macron in Maori TV (ie when spelled correctly!). This only affects configuration. However it is very easy to make a config file. Download mine and save it to /storage/.xmltv/tv_grab_nz-py.conf. Here it is www.dropbox.com/s/73qk22092a3ei71/tv_grab_nz-py.conf?dl=0
5. The file is very simple. If there are channels you don't want, either delete the line or substitute the = for a ! in the offending line. My file has all channels on freeview included, you probably won't want them all.
6. Now go to the config for the tvheadend server addon and specify epg via script. Navigate and choose tv_grab_nz-py from where ever you saved it. Hit OK to save the config.
[WIP will complete later]
More now, and a pic!!

7. Now I will assume you have some channels detected by tvheadend already. Now we have to set up tvheadend to use tv_grab_nz-py. Take a look at this screenshot of the tvheadend browser config:



Where I drew that untidy red bit is where you need to choose the xmltvgrabber. I assume it appears there because of step 6. You may need to reboot a couple of times before it appears there. It also pays about this time to activate the logs panel on the tvh web page. Click on the little double up arrow at the bottom left of the web page. You'll see runs of tv_grab_nz-py and the results.

8. Now go to the channels panel and you should be able to choose a channel from the selection offered by the xml grabber, from the dropdown box, see this pic.



9. You should now have EPG in the tvh web broswer - see this piccy (PS I have the log window open in this shot, although there is nothing showing in it at present):

Last Edit: 2 years 4 months ago by nickr.
The administrator has disabled public write access.
The following user(s) said Thank You: rjbathgate

TVHeadend EPG via XML File 2 years 4 months ago #11

  • rjbathgate
  • rjbathgate's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 13
  • Karma: 0
Hi

Many thanks for this very detailed help :-)

I have run into a problem at 6)...

Config > Channel / EPG > EPG Grabber - Internal Grabber: Module = disabled
www.awesomescreenshot.com/image/246187/bbd97eac67f4e21d25ee38efda907f6d

No options within dropdown to enable it... It's always been disabled (and I have restarted etc).

Within the logs, there's just a few references to DVT-T frequency error and the onlyreference to EPG is:

2015-05-21 12:26:05.721 subscription: 0005: "epggrab" unsubscribing

The py script is in /storage/ with 777 permissions (owned by root).

Within /usr/bin there is no reference to tv_find_grabbers or tv_grabb_file, as referenced tvheadend.org/boards/12/topics/9372 -- not sure if this is a problem?

Within External Interfaces I have XMLTV (/storage/.kodi/userdata/addon_data/service.multimedia.tvheadend/epggrab/xmltv.sock) and PyEPG (/storage/.kodi/userdata/addon_data/service.multimedia.tvheadend/epggrab/pyepg.sock) both enabled.

Within that tvheadend.org post referenced above, it also mentions to check for phython and bash; both these are installed (by default with OpenELEC it seems)

Oh, one thought:
Now go to the config for the tvheadend server addon and specify epg via script.
Does this need to be done via the Kodi interface of the addon? Rather than through the tvheadend config? It's currently set to from XML file (when I was trying with the harcoded freeview.xml).

If that's why it's disabled.... I can't test that until I'm back in front of the TV as I'm just working on a remote connection to the device over IP at the moment. So i'll give that a go in a few days unless there's something else in the meantime I'm missing?

Many thanks again
The administrator has disabled public write access.

TVHeadend EPG via XML File 2 years 4 months ago #12

  • rjbathgate
  • rjbathgate's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 13
  • Karma: 0
Re:
Now go to the config for the tvheadend server addon and specify epg via script.

I have found the settings via console (/storage/.kodi/userdata/addon_data/service.multimedia.tvheadend/settings.xml)

<settings>
<setting id="NUM_ADAPTERS" value="1" />
<setting id="PRELOAD_CAPMT_CA" value="false" />
<setting id="REMOVE_MODULES" value="" />
<setting id="WAIT_FOR_FEINIT" value="false" />
<setting id="WAIT_FOR_NET" value="false" />
<setting id="WAIT_FOR_NET_TIME" value="1" />
<setting id="XMLTV_LOCATION_FILE" value="/storage/downloads/freeview.xml" />
<setting id="XMLTV_LOCATION_SCRIPT" value="/storage/tv_grab_nz-py" />
<setting id="XMLTV_LOCATION_WEB" value="http://" />
<setting id="XMLTV_TYPE" value="SCRIPT" />
</settings>

As you can see, it's set to type = script, and the script location is right.

Yet "Internal grabber: Module" is still disabled.

What owner and group is your /storage/tv_grab_nz-py file? 777 should suffice even if owned by root... in theory...

Oh and also re your custom .conf file, where does that come in to play, or does the py script automatically look for that?

Thanks

---

I also tried running the py script manually in console:

/usr/bin/env python tv_grab_nz-py
CRITICAL - Not configured! Perhaps you meant to run with --config-file or --configure?

/usr/bin/env python tv_grab_nz-py --configure

INFO - Downloading data from epg.org.nz...
INFO - Done
INFO - Parsing channel data...
INFO - Done (38 channels)

Please select the channels you wish to use for
this source by pressing y or n when prompted:


Use channel Al Jazeera (aljazeera.freeviewnz.tv)? [y/N]y
Use channel BaseFM (basefm.freeviewnz.tv)? [y/N]y
Use channel C4 (c4.freeviewnz.tv)? [y/N]y
Use channel Canterbury Television (canterbury-tv.freeviewnz.tv)? [y/N]y
Use channel Channel North Television (channel-north-tv.freeviewnz.tv)? [y/N]y
Use channel ChineseTV8 (chinese-tv8.freeviewnz.tv)? [y/N]y
Use channel ChoiceTV (choice.freeviewnz.tv)? [y/N]y
Use channel CUE (cue.freeviewnz.tv)? [y/N]y
Use channel Dunedin Television (dunedin-tv.freeviewnz.tv)? [y/N]y
Use channel Firstlight (firstlight.freeviewnz.tv)? [y/N]y
Use channel FOUR (four.freeviewnz.tv)? [y/N]y
Use channel FOUR Plus 1 (four-plus1.freeviewnz.tv)? [y/N]y
Use channel Info-Rotorua (info-rotorua.freeviewnz.tv)? [y/N]y
Traceback (most recent call last):
File "tv_grab_nz-py", line 226, in <module>
use = raw_input('Use channel %s (%s)? [y/N]' % (channel[1], channel[0]))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0101' in position 13: ordinal not in range(128)


So.... it started working (and then perhaps errors at the Moari tv as you mention.)

So...

/usr/bin/env python tv_grab_nz-py --config-file tv_grab_nz-py.conf

Adding in the config file it seemed to successfully run all the way through, returning all the XML of the file.

But it's made no difference in terms of the TVHeadend EPG - internal grabber module still disabled, and still no options within EPG Source under each channel

:-(
Last Edit: 2 years 4 months ago by rjbathgate.
The administrator has disabled public write access.

TVHeadend EPG via XML File 2 years 4 months ago #13

  • nickr
  • nickr's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1165
  • Thank you received: 132
  • Karma: -262
rjbathgate wrote:
Hi

Many thanks for this very detailed help :-)

I have run into a problem at 6)...

Config > Channel / EPG > EPG Grabber - Internal Grabber: Module = disabled
www.awesomescreenshot.com/image/246187/bbd97eac67f4e21d25ee38efda907f6d

No options within dropdown to enable it... It's always been disabled (and I have restarted etc).
Probably because your tv_grab_py-nz is unconfigured and fails. See later

Within the logs, there's just a few references to DVT-T frequency error and the onlyreference to EPG is:

2015-05-21 12:26:05.721 subscription: 0005: "epggrab" unsubscribing

The py script is in /storage/ with 777 permissions (owned by root).

Within /usr/bin there is no reference to tv_find_grabbers or tv_grabb_file, as referenced tvheadend.org/boards/12/topics/9372 -- not sure if this is a problem?
you won't find them in /usr/bin/. Because openelec uses a readonly file system for everything except /storage/ any binaries added by an addon are in the addon directory itself somewhere, ie /storage/.kodi/addons/addon.name/

Within External Interfaces I have XMLTV (/storage/.kodi/userdata/addon_data/service.multimedia.tvheadend/epggrab/xmltv.sock) and PyEPG (/storage/.kodi/userdata/addon_data/service.multimedia.tvheadend/epggrab/pyepg.sock) both enabled.
ignore those

Within that tvheadend.org post referenced above, it also mentions to check for phython and bash; both these are installed (by default with OpenELEC it seems)

Oh, one thought:
Now go to the config for the tvheadend server addon and specify epg via script.
Does this need to be done via the Kodi interface of the addon? Rather than through the tvheadend config? It's currently set to from XML file (when I was trying with the harcoded freeview.xml).
yes from within the kodi addon interface

If that's why it's disabled.... I can't test that until I'm back in front of the TV as I'm just working on a remote connection to the device over IP at the moment. So i'll give that a go in a few days unless there's something else in the meantime I'm missing?

Many thanks again
Last Edit: 2 years 4 months ago by nickr.
The administrator has disabled public write access.

TVHeadend EPG via XML File 2 years 4 months ago #14

  • nickr
  • nickr's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1165
  • Thank you received: 132
  • Karma: -262
rjbathgate wrote:
Re:
Now go to the config for the tvheadend server addon and specify epg via script.

I have found the settings via console (/storage/.kodi/userdata/addon_data/service.multimedia.tvheadend/settings.xml)

<settings>
<setting id="NUM_ADAPTERS" value="1" />
<setting id="PRELOAD_CAPMT_CA" value="false" />
<setting id="REMOVE_MODULES" value="" />
<setting id="WAIT_FOR_FEINIT" value="false" />
<setting id="WAIT_FOR_NET" value="false" />
<setting id="WAIT_FOR_NET_TIME" value="1" />
<setting id="XMLTV_LOCATION_FILE" value="/storage/downloads/freeview.xml" />
<setting id="XMLTV_LOCATION_SCRIPT" value="/storage/tv_grab_nz-py" />
<setting id="XMLTV_LOCATION_WEB" value="http://" />
<setting id="XMLTV_TYPE" value="SCRIPT" />
</settings>

As you can see, it's set to type = script, and the script location is right.

Yet "Internal grabber: Module" is still disabled.

What owner and group is your /storage/tv_grab_nz-py file? 777 should suffice even if owned by root... in theory...

Oh and also re your custom .conf file, where does that come in to play, or does the py script automatically look for that?

Thanks

---

I also tried running the py script manually in console:

/usr/bin/env python tv_grab_nz-py
CRITICAL - Not configured! Perhaps you meant to run with --config-file or --configure?

/usr/bin/env python tv_grab_nz-py --configure

INFO - Downloading data from epg.org.nz...
INFO - Done
INFO - Parsing channel data...
INFO - Done (38 channels)

Please select the channels you wish to use for
this source by pressing y or n when prompted:


Use channel Al Jazeera (aljazeera.freeviewnz.tv)? [y/N]y
Use channel BaseFM (basefm.freeviewnz.tv)? [y/N]y
Use channel C4 (c4.freeviewnz.tv)? [y/N]y
Use channel Canterbury Television (canterbury-tv.freeviewnz.tv)? [y/N]y
Use channel Channel North Television (channel-north-tv.freeviewnz.tv)? [y/N]y
Use channel ChineseTV8 (chinese-tv8.freeviewnz.tv)? [y/N]y
Use channel ChoiceTV (choice.freeviewnz.tv)? [y/N]y
Use channel CUE (cue.freeviewnz.tv)? [y/N]y
Use channel Dunedin Television (dunedin-tv.freeviewnz.tv)? [y/N]y
Use channel Firstlight (firstlight.freeviewnz.tv)? [y/N]y
Use channel FOUR (four.freeviewnz.tv)? [y/N]y
Use channel FOUR Plus 1 (four-plus1.freeviewnz.tv)? [y/N]y
Use channel Info-Rotorua (info-rotorua.freeviewnz.tv)? [y/N]y
Traceback (most recent call last):
File "tv_grab_nz-py", line 226, in <module>
use = raw_input('Use channel %s (%s)? [y/N]' % (channel[1], channel[0]))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0101' in position 13: ordinal not in range(128)


So.... it started working (and then perhaps errors at the Moari tv as you mention.)

So...

/usr/bin/env python tv_grab_nz-py --config-file tv_grab_nz-py.conf

Adding in the config file it seemed to successfully run all the way through, returning all the XML of the file.

But it's made no difference in terms of the TVHeadend EPG - internal grabber module still disabled, and still no options within EPG Source under each channel

:-(
Yep i think your whole problem is the unconfigred tv_grab_nz-py. As I said in my detailed post, there is a bug in tv_grab_nz-py which means it bombs out and leaves it unconfigured. That is why I said to download my .conf file and place it in /storage/.xmltv/tv_grab_nz-py.conf . You can then manually edit it to exclude channels you don't want, either by deleting the whole line or making the = onto a ! ie
channel=canterbury-tv.freeviewnz.tv
channel!parliament.freeviewnz.tv
In that config ctv is wanted, parliament tv is not.

I feel that once you have that file saved properly, you can run tv_grab_nz-py manually via ssh and should see the listings flow out (outputs to stdout by default). Once you have achieved that all should the work.
Last Edit: 2 years 4 months ago by nickr.
The administrator has disabled public write access.
The following user(s) said Thank You: rjbathgate

TVHeadend EPG via XML File 2 years 4 months ago #15

  • rjbathgate
  • rjbathgate's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 13
  • Karma: 0
Awesome!
That is why I said to download my .conf file and place it in /storage/.xmltv/tv_grab_nz-py.conf .

Damn, I missed the /.xmltv/ directory and just had it in /storage/

Moved it to /storage/.xmltv/tv_grab_nz-py.conf, restarted and BOOM! EPG sources started appearing!

After another restart, all of the EPG sources were available, and then I linked them to the channel mapping. And then one more restart and the EPG is full!

Thank you so very much, massively appreciated.

Cheers
The administrator has disabled public write access.
  • Page:
  • 1
  • 2