Australian TV Listings

From MythTV Official Wiki
Revision as of 07:33, 7 September 2006 by Philled (talk | contribs) (How to get Australian tv guide data)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Guide Data Copyright In Australia

Australia doesn't have a service like Zap2It to provide program guide listings. As such there is no tv_grab_au in the MythTV distribution and Aussie users have to create their own. The problem is that not only is there no "official" listings provider, but the TV stations own the copyright to the data and actively prohibit its use for things like personal video recorders such as MythTV. Many people have written grabbers to get the data off web sites such as Yahoo, MSN, YourTV etc only to find that they introduce mechansisms to prevent those grabbers from working.

Sources Of Guide Data

One way to solve this is to purchase the guide data from IceTV

Alternatively, for those who want guide data for free, there is a source of data which is freely and openly available and designed to be downloaded for PVRs. This is provided by the nice folks at OzTiVo. and was originally designed for Aussie owners of TiVo boxes. However, because it outputs guide data in XMLTV format it can also be used by MythTV users. Have a look at the Australian XMLTV grabber page to get more details. In order to use this you will need to create a free account on their web site first.

The script provided by the OzTiVo guys is quite a complex perl script which does things some clever things like:

  • store a username/password in a config file.
  • re-write XMLTV ids (useful if you're switching from a different data source).
  • force the addition of explicit timezones on timestamps (useful for people from some states).
  • filter out specific channels entirely.
  • grab some channel's data from and some from IceTV and merge the result into one XMLTV dataset ( covers more channels than IceTV).
  • gives newbies who are looking for a 'tv_grab_au' script something to get hold of.
  • use standard XMLTV grabber script options.

However, an alternative is to use the script which is a script built into the whole service. This script is very fast to run and because it's a "built-in" to the service you shouldn't need to worry about downloading a new version etc when they change things. When run, it queries the preferences associated with your username and password to decide which channels to download. It then extracts 7 days worth of data for those channels into XMLTV format which you can then load into MythTV using mythfilldatabase. The XMLTVIDs in this data probably won't match what you have in your MythTV channel setup, so this is what you need to do to get it to work:

  1. Put the commands below in a shell script (note the wget command should be all one line)
  2. Change the sed commands to be suitable for your own XMLTV IDs
  3. Change the output file name to suit after the ">"
wget --input-file=/home/mythtv/.xmltv/tv_grab_au_tvg.conf --output-document=- | sed
's/SBS-NEWS/news\.sbs\.com\.au/g ; s/Seven-Syd/sydney\.seven\.com\.au/g ;
s/Ten-NSW/sydney\.ten\.com\.au/g ; s/SBS-NSW/sydney\.sbs\.com\.au/g ;
s/ABC2/abc2\.abc\.gov\.au/g ; s/Nine-Syd/sydney\.nine\.com\.au/g ; 
s/ABC-NSW/nsw\.abc\.gov\.au/g' > /home/mythtv/.xmltv/tvlistings_tvg.xml

mythfilldatabase --file 1 7 /home/mythtv/.xmltv/tvlistings_tvg.xml

The url for wget is specified in the --input-file param as it needs to contain your username and password. Make this file rw------- by chmod 600 so that others can't see your account logon details. The file should have one line like this wherer UserName and password are the username and password for your account:

An easy way to run this automatically is to run this from a daily cron job. That can be set up either in the crontab for a particular user, or /etc/crontab or /etc/cron.daily/. Whichever is best may depend on your linux distribution. One thing to note when running it from cron is that you should put a randomiser into the call so that it doesn't do it at exactly the same time each day. Eg:

0 1 * * * sleep $((RANDOM % 18000)) && <whatever the download command is>

This helps to reduce the peak loads put on the servers by running the script sometime between 1am and 6am every day.