January 1, 0001

— type: post layout: post meta: {} title: Setting up an EPG for MythTV in New Zealand tags: - MythTV - Tips and Tricks published: true status: publish — One of the most important things to get right for your MythTV installation is the Electronic Program Guide (EPG). The EPG lets MythTV know when all of the programs are on so it know when to record your favourite show like “The Best of Top Gear”. I’ve been using xmlTVNZ for some months now reasonably successfully. xmlTVNZ is a command line tool that scrapes various web-sites for the TV listings. The specific web-sites that are scraped depend on the command line parameters passed to it, which depend on which channels you are interested in getting EPG data for. Because of it’s scraping nature, it’s prone to falling over when a web-site that it scrapes changes. I think that problem may of occurred last night because all of the TV3 listings going forward disappeared. I managed to eventually get it working again by modifying the command line parameters to scrape TV3 off the Sky web-site instead of XTRA (which now appears to be Yahoo!). I’ve also belonged to the Myth TV in NZ mailing list for some months and recently there was talk of some other common EPG methods. At the time I didn’t look into it because xmlTVNZ had been working fine. Given the recent problems though I looked into both the “Hairy” and “Nice” EPG listing methods. The “Hairy” EPG is located at http://hairy.geek.nz/epg/ but when I looked last night there was some other strange directory listing there. The “Nice” EPG is located at http://nice.net.nz/epg/ and was all up when I looked last night. Both the Hairy and Nice EPG’s are based of the DVB program guide broadcast by Sky. The Nice one appears to have at least better information than obtained by xmlTVNZ because after updating there was lots of information updated after running mythfilldatabase for the same number of days. Below is a set of instructions for getting the Nice EPG running within MythTV. This just covers the analog stations that I am recording since I don’t have a satellite dish installed but should work for any set of stations that you are tuning.

  1. Login as the mythtv user.
  2. Open the /home/mythtv/.mythtv/ directory
  3. Create a new directory called epg in that directory. This new directory could be created anywhere within the mythtv users home directory. I just put it in the .mythtv directory so it’s out of the way and next to the other MythTV related configuration directories like channels, which contains my channel icons.
  4. Create a new shell script file called nice.net.nz.sh in the epg directory. This will be used to script the download of the Nice EPG and to then populate the MythTV program database. This script could be named anything you like.
  5. Populate the newly created shell script with the following:#!/bin/bash wget http://nice.net.nz/epg/listings.xml.gz gunzip -f listings.xml.gz mythfilldatabase --no-delete --file 1 -1 listings.xml --update
  6. Alter the XMLTV ID values within the MythTV configuration for the channels that you want to have updated by the Nice EPG. This can be done using mythtv-setup or by using mythfilldatabase passing the --manual flag rather than --update. The XMLTV ID values I am using based on the Nice EPG are below.
  7. Open up KCron or any other Crontab editor of your choice.
  8. Schedule the newly created shell script nice.net.nz.sh to run daily at a suitable time as the mythtv user. Since it doesn’t do any web-site scraping it is much faster than xmlTVNZ so could be run at any time of the day without any problems. Based on the last time the listings.xml.gz file was updated on nice.net.nz (~5:30 AM) it would be good to schedule it sometime after 6 AM.
comments powered by Disqus