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 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/Republic of Ireland (Radio Times)" from the Video Source page of mythtv-setup. We'll call this video source "uk_rt". Selecting this will kick off a config utility in a terminal window. What you enter here is pretty irrelevant because we'll overwrite this data later.

Selecting 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 field contains the correct information. I provide a script for doing this in the next section.

First of all, we need to install xmltv:

sudo apt-get install xmltv xmltv-util

Downloading the Script

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 all required files:

The archive contains:

Extract the archive:

tar xf updateid_2.1.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 (note that it assumed that there is no root password for mysql).

cd updateid_2.1
./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 and called your video source uk_rt, this will be ~/.mythtv/uk_rt.xmltv. This tells tv_grab_uk_rt which channels to grab.

cp ~/.mythtv/uk_rt.xmltv ~/.mythtv/uk_rt.xmltv.save

cp updateid.xmltv ~/.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, serviceid, xmltvid from channel"

Feedback

The ids.cfg file is based on the work of John Pullan in the mythtv-dev mailing list. This script should bridge the gap until those guys fix MythTV itself. Send any comments/bugfixes/updates to Garry. I'd especially like feedback from people in other parts of the UK so that the regional BBC and ITV channels are correct (thanks to D. R. Newman for your comments so far).

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