India EPG data for MythTV (XMLTV listings grabber)
Note: The information in this post is no longer valid. The listings provider seems to have ceased the service as of 2013. I am leaving the post here for historical interest.
An enhanced TV viewing and recording experience is one of the cornerstones of an HTPC.
But perhaps it is also the most challenging aspect of setting up HTPC in India, because the non-availability of India specific electronic program guide (EPG) listings makes TV viewing and recording next to impossible.
Although this is one of my first posts and too early to get into EPG listings, I wanted to get this out and share for the benefit of poor souls stopped in their tracks trying to build and use HTPC for TV viewing in India.
North America has paid listings sources that are reliable, while a few other countries have “grabber” scripts that scrape the websites of TV channels or other webpages and try to re-format the html into machine readable XMLTV format. India had none – until now.
Just as I started out researching EPG solutions for India, I luckily came upon the excellent website http://www.whatsonindia.com that has comprehensive listings for all channels and providers in India. I set about writing a grabber script for MythTV that uses listings from this provider. With help from the XMLTV documentation and the good fellows at whatsonindia.com, an automated grabber script that can load good quality EPG data for all channels in India was developed. I have been using this for viewing and recording TV for the past 2 months and am quite happy with the way it turned out. It may be a while before it can be submitted to the official XMLTV distribution so that it gets into MythTV installations easily, but am putting it up here for download till then.
tv_grab_in (Opens in new window for download)
Installation instructions -
Tested with MythTV 0.22 on Mythbuntu 9.10 1. Download the file tv_grab_in using the above link 2. Copy it to /usr/bin/ directory. (Note: If you happen to wipe and re-install your OS, this file will naturally disappear. Until it is packaged into official XMLTV, this step would need to be done each time you install the OS). 3. Restart your mythbackend and mythfrontend 4. Go into mythtv-setup, video sources. Either choose to setup new video source or edit your existing video source - you should be able to see a Listings grabber named "India (www.whatsonindia.com)" now (it is detected from the /usr/bin directory). Select it, make sure the checkbox to perform an EIT scan is unchecked, and finish the setup. 5. Related settings - under Input Connections, make sure the source above is assigned to your video input. 6. When you exit mythtv-setup you will be prompted to run mythfilldatabase - allow it to run. You should see it running in the terminal window. You should be connected to the internet throughout this time. It may take anywhere from a minute to ten minutes to finish. 7. Now open mythtv-setup again, and get into Channel editor. You should see an exhaustive listing of all India channels now. Select each channel which you are interested in and fill in the Channel number. This number must be the same number used by your STB if your input connection is from an STB via a capture card (using IR blaster to change channels), or the frequency number if your input connection is from a tuner. Finish and exit the setup. (Note: It would be much easier and faster to do the above step using the MythWeb interface)
That is it, now you can check it out in Live TV. You should be able to see the EPG on pressing “S”.
Settings to have MythTV populate the latest data everyday automatically -
In mythfrontend, go to Settings->General, and navigate to the page for mythfilldatabase settings. Change the settings as follows - mythfilldatabase program: mythfilldatabase mythfilldatabase arguments: <leave this blank> mythfilldatabase log path: <mythtv home dir (~mythtv)>/mfdb.log mythfilldatabase run frequency (days): 1 mythfilldatabase execution start: <enter a number between 0 and 24> mythfilldatabase execution end: <enter a number that is prev number + 2> Uncheck the "Run mythfilldatabase at time suggested by grabber" checkbox and click finish. Note that the log path must be full path including the file name, and it should be writable by "mythtv" user (or more generally, the user id under which the mythbackend runs). The execution start/end times could be chosen at random and give it a window of about 3 hours - this helps to spread out the load on the listings server.
That is it, you are set to receive EPG updates everyday and should have guide info in your MythTV program guide now for 2~4 days in advance.
There will be other posts in future detailing the best ways to get channel icons, and thoughts on the best IR hardware to change STB channels (hint – my local dealer in Bangalore bundled an HP IR receiver + blaster + MCE remote control with Hauppauge PVR150. This receiver+blaster really rocks!). Now then, happy channel surfing!