XMLTV Scheduling for the UK



Introduction

For UK DVB Freeview channels, there are two ways to receive scheduling information - the 7 day guide transmitted in the digital broadcast or the 14 day XML guide available from the Radio Times website. The are pros and cons for each method:

  • The XMLTV feed is 14 days and the EIT is 7
  • The XMLTV feed has more detailed information on the programmes
  • The EIT covers radio, but the Radio Times (ironically) does not
  • The EIT is much easier to get working

The EIT is covered in the main guide, the rest of this page is dedicated to getting the XMLTV scheduling working.

XMLTV Radio Times Listing for the UK

The Radio Times feed is selected by choosing "United Kingdom (alternative)" from the Video Source page of mythtv-setup. This sets up up a scheduled grab using the tv_grab_uk_rt utility. However, it misses out an important part of the configuration - it doesn't link the channels in the channel table with the sources in the XML feed.

To fix this, all you really have to do is update the channel table in the mythconverg database so that the xmltvid and icon fields contain the correct information. I've provided a scripot for doing this later on.

First of all, we need to install xmltv:

sudo apt-get install xmltv xmltv-util

Downloading the Scripts

This page provides a utility for making the update of the channel table as easy as possible. It looks at what channels you have in your MythTV database and generates the SQL needed to update them.

Download the following files:

Install the icons:

cd /usr/share/mythtv
sudo tar xf /home/mythtv/icons.tar.gz

Extract the archive:

tar xf updateid.tar.gz

Prerequisites

Important: the script assumes that that you've already setup your video source and done a channel scan. See my step by step instructions on how to do this:


Running the Script

Run the script as the mythtv user. Note that it assumed that there is no root password for mysql.

./updateid

This will look at the channels which you have configured and generate two files, updateid.xmltv and updateid.sql. Please check the contents of these before using them!

Copy updateid.xmltv over your xmltv file. If you ran mythtv-setup as mysql and called your video source uk_rt, this will be /home/mythtv/.mythtv/uk_rt.xmltv. This tells tv_grab_uk_rt which channels to grab.

cp /home/mythtv/.mythtv/uk_rt.xmltv /home/mythtv/.mythtv/uk_rt.xmltv.save

cp updateid.xmltv /home/mythtv/.mythtv/uk_rt.xmltv

Backup your channels table and update it with the xmltvids:

mysqldump --opt mythconverg channel > channel.sql

mysql -u root < updateid.sql

The listings should be populated automatically each day by the cron (/etc/cron.daily/mythtv-backend), but you can kick it off by running:

mythfilldatabase

Troubleshooting

If you have any problems, it's probbaly because one of your channels aren't defined in the ids.cfg file. To help fix this, you can get a list of xmltvids by running:

tv_grab_uk_rt --list-channels > /tmp/all_channels.txt

You can also get a list of the channels in your database by running:

mysql -uroot mythconverg --exec "
select callsign, networkid, serviceid, xmltvid
from channel c, dtv_multiplex m
where c.mplexid=m.mplexid"

Feedback

The ids.cfg file is based on the work of John Pullan in the mythtv-dev mailing list. I adapted it and added the icon path. This script should bridge the gap until those guys fix MythTV itself. Send any comments/bugfixes/updates to Garry.

Also take a look here for an alternative method of doing this.


Leave a comment.