micolous.id.au

The result of a blogging accident

au_xmltvgen_austext

au_xmltvgen_austext is a program to generate XMLTV listings from the data on the AUSTEXT service, hosted by Channel Seven and Prime.

Updates

Update 2009-08-31: I have discovered that AUSTEXT is shutting down on September 30th, 2009. Presently, the only over-the-air program guide over digital television appears to be very crippled, only showing the current and next program (when it could show a whole lot more). Channel 7 cite the increasing availability of the information over the internet and their website as a reason for terminating the service.

As a result, this program will definitely stop working at that time, forever. This page will stay up though. I have no idea though if it actually supported Teletext over DVB-T (terrestrial digital television), as I don’t have a DVB-T tuner.

Update circa-2007: There is another version written in Python that exists called tv_grab_au_tuhs. It gets information from tvguide.org.au, setup by an Australian TiVo users group. I’d probably suggest you get tv_grab_au_tuhs instead of this, if you’re using MythTV. The data that their script generates is less legally encumbered (Creative Commons license), however their site does require registration. I’m currently using the tuhs setup on my MythTV setup, and it’s somewhat better than using the d1.com.au version of tv_grab_au with Sydney listings (I live in Adelaide).

All I can really say is that Austext has been around for many many years, and that it will probably remain for many more, while the technology is still in use. The tuhs grabber offers more channels and doesn’t have the interesting parsing bugs that this script has. It also has better support for Prime oddities, actually has feeds for Channel 9/NBN/WIN, and humans do actually make sure that the data is correct. There is also some extra metadata, and you don’t have to manually change any channels - something which is ideal for MythTV.

If you’re a person who doesn’t have a permanent internet connection, then this may suit you better. The decision is yours. :) Other versions and equivalents of tv_grab_au exist, and many are listed on Dr William Uther’s Australian XMLTV sources page. This grabber is the only one listed that doesn’t use the internet.

Requirements

  • xmltv
  • alevtd (and Video for Linux, so you need Linux for that, however you could run this script remotely on any Python-supported OS).
  • Python 2.3 or later
  • A good analog television reception for Channel 7 or Prime, and analog TV card, setup with Video for Linux. I have a “TV Excel” card, which has a bt878 chipset and Phillips tuner, which is actually labeled as being an LG tuner on the tuner unit. I have a roof mounted antenna. I get good signals for channels 2, 7, 9, 10 and SBS, and a horrible signal for channel 31.
  • A program to use the XMLTV feed in :-)

License

au_xmltvgen_austext is Copyright 2004 - 2005 Michael Farrell.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

Download

The current version of au_xmltvgen_austext is 1.1. You can download it as a bzip2’d tarball (10 kb), or you can download a patch from 1.0 to 1.1.

Changelog

Version 1.1 (2005-03-28) bzip2’d tarball: 10kb, 1.0 to 1.1 patch: 2kb. Added some support for parsing the rating (G, PG, M, MA, etc.) and wether a program has captions. This breaks Prime and Seven QLD feeds a lot, due to no parsing code for multiple sets of programs in different regions.

Version 1.0 (2005-03-20) bzip2’d tarball: 10kb. Original release

Installation

Installing the program is as easy as unpacking the archive and running ‘make install’ as root.

Usage

au_xmltvgen_austext [timezone] [server hostname] [server port]
  • timezone: The timezone of the data. If none is specified, then +0930 is assumed. During daylight savings you’ll need to adjust this. Queensland and Western Australia are always on the correct timezone for those areas, they are hard coded (as they have no daylight savings).
  • server hostname: The hostname or IP where alevtd is running. If none is specified then localhost is assumed.
  • server port: The port that alevtd is running on. If none is specified then 5654 is assumed.

You’ll need to start alevtd first, and have your TV card set to Channel Seven (or Prime). I find alevtd is a bit touchy, I run it with the following commandline options:

alevtd -v /dev/vbi0 -4 -d -F -i localhost

Then wait about five to ten minutes. Then run auxmltvgenaustext:

au_xmltvgen_austext | tv_sort > ~/listings.xml

This should output listings to ~/listings.xml if all went well. If you find that some data is missing or there is a parser error, run auxmltvgenaustext without piping it’s output anywhere. This will let you see where the problem is.

What do you get?

Streams for SBS, ABC, Seven and Ten in all state capitals, as well as Seven in regional Queensland and Prime in regional NSW and Victoria. The channel xmltv names are as follows:

  • SBS (sbs.austext)

With other channels made up as follows:

Network name

  • ABC (abc)
  • Prime (prime)
  • Seven (seven)
  • Network Ten (ten)

City or State

  • Adelaide (adl)
  • Brisbane (bris)
  • Melbourne (melb)
  • NSW (nsw)
  • Perth (pth)
  • Queensland (qld)
  • Syndey (syd)
  • Victoria (vic)

Putting it together

The channel name and city/state are sperated with a dot, then ”.austext” is added to the end. The state entries only apply to Prime (NSW/VIC) and Seven (QLD). All other channels are by the state capital city.

In action

With the data used by tvtime, it looks like this:

Sample image

Sample image

Compatibility with tv_grab_au

None. This program has no configuration files, and the syntax is tottally different. You could run a cron script at 08:00 that changes the TV card’s channel to Channel 7/Prime, then at 08:10 run auxmltvgenaustext and output that to a file for use in whatever program you like. I wrote this due to the many versions of tvgrabau, and the most I could get was a feed for SBS and ABC for locations outside of Sydney (the d1.con.au based grabber).

Troubleshooting and bugs

  • Sometimes (Prime, Seven QLD) programs are only in certain regional areas and tvsort will complain that two programs are overlapping. This is because auxmltvgen_austext doesn’t parse pages very well. This doesn’t effect me, but if it effects you, please send me a patch to fix it, and I’ll put it in the next version.
  • The parser also doesn’t like when a program entry takes up more than one line. This is because teletext doesn’t allow very long lines. This is hard to predict, as it’s a human issue. This seems to occur mostly on SBS.
  • The parser only supports the analogue TV service. This means that the SBS World News Channel and ABC2 will not appear. I don’t own a digital TV tuner or digital television. There’s probably a digital version of Austext, but I know nothing about that stuff.
  • There is no Channel Nine/WIN/NBN program guide, because Austext doesn’t supply one. Community TV channels, such as Channel 31 in Adelaide, do not have information on Austext therefore aren’t available either.
  • Sometimes the Austext people are a bit inconsistent with their program guides for Channel 7 and put the evening news and current affairs programs in 12 hour time format. If this annoys you, then send them a nice reminder to use 24 hour time format and be consistent. The email address to complain to is austext @seven.com.au ;)
  • Finally, the parser doesn’t take into account radio interference with the teletext stream. This is random, and I can’t predict it. Try adjusting your antenna and finetuning the channel. External, roof mounted antennas work the best. You do need a really good video signal to get a flawless teletext stream. You may experience errornous titles or programs not being listed (and thus the previous program going for the length of the next as well).

Contact

You can contact me via email if you wish to report bugs. I can’t promise to fix bugs or help you out because this isn’t my job. See the contact page for more info. The email address in the tarballs doesn’t work anymore.

Please do not ask me to publish my copy of the xmltv data generated from this software, as Channel 7 don’t like people freely distributing the data. Please see page 104 on AUSTEXT for more information.