OpenELEC/OpenELEC.tv — pull request #2247 by drivera73 (2013-04-30 05:20:42+00:00)
Title: Allow TVHeadend to use a scripts stdout output as an XMLTV input

TVHeadend supports the use of tv_grab_file to load the XMLTV output from a file. Cron can be used to generate fresh EPG listings periodically. However, this has drawbacks when suspend kicks in as it may end up that the XMLTV will fall out-of-date due to the system not being active at the scheduled refresh times.

TVHeadend addresses this by performing fresh fetches as necessary, but then again - if the source is stale, the fetch will also be ineffective. By allowing the use of a scripts stdin output, TVHeadend can not only fetch the content itself as needed, but custom scripts can be written to generate the XMLTV output.

Granted, the Unix socket option is also available, but there is no tool in the OpenELEC instance that can be used from a shell script to open and write to Unix domain sockets (the bundled NC version doesn't support -U). It also falls prey to the aforementioned "bad timing" issues, since the external process would also be managed outside of TVH.

This is a happy medium which allows external custom grabbers to easily be triggered by TVHeadend on demand.