ARTICLE

Your TV Guide under Linux!
Contributed by Clement Lefebvre in Multimedia on 2006-09-26 11:13:02

What do most people have in common? They watch TV! In fact, if you're like most people you probably watch TV a lot. For this you need a pleasant and effective way to know in advance what's on TV, at what time and on which channel. This is a very common need, and different people use different solutions: the newspaper, a TV magazine or even some fancy applications running in their satellite decoder. You're different though, you use Linux. Therefore there's no reason why you should get your TV schedule the way everybody does. And you'll be happy to know that there is an easy way to set up your Linux box to do just that.

XMLTV

XMLTV is a great project. Just look at the name, "XML-TV", it's like a combination of one of the most geeky technologies and one of the most common things on Earth. In a way, it brings your imagination close to that fantasy shared among all computer enthusiasts: the use of domotics and intelligent appliances to automate everything you need in your house. But let's keep our feet on the ground, XMLTV is only going to do one thing for you, it'll bring you the TV schedule, and it's not going to make you coffee right? With that in mind, let's have a closer look at it.

At present XMLTV can grab TV listings for the following regions: Australia, Belgium and Luxembourg, Brazil, Britain and Ireland, Denmark, Estonia, Finland, France, Germany, Hungary and Romania, Iceland, Italy, Japan, Netherlands, North America, Norway, Portugal, Reunion Island (France), South Africa, Spain, Sweden, and Switzerland.

If "xmltv" is not present in your distribution's repositories you can find the source code as well as RPM and DEB packages for it on the project's website: http://xmltv.org/wiki/

Once installed on your system, you can use the scripts to download the TV listings for the geographical region you're interested in. XMLTV provides a collection of scripts which name starts with "tv_". The most important scripts are the one called "tv_grab_" and they are suffixed with the name of the region. For instance the script which grabs the TV listings for the UK is called "tv_grab_uk_rt". These scripts download the listings from the Internet and output the result in XML.

Before you can use tv_grab, you need to configure it. In this article we'll assume you're interested in the UK region. In a terminal, type the following:

tv_grab_uk_rt --configure

The script will present you the available TV channels from that region and you'll have to answer for each one whether or not you want to see the listings for this channel. Once you've gone through all the channels, it will save the configuration in ~/.xmltv/tv_grab_uk_rt.conf.

Once this is done, and tv_grab knows which channels you're interested in, you can use it to download the listings and save them as an XML file:

tv_grab_uk_rt > tv.xml

The resulting XML file contains your TV schedule in XMLTV format. All you need now is a GUI application to show you that data in a nice and pleasant way.

Maxemum TV-Guide

There are a few GUI applications on the Internet which are able to read XMLTV files. One of them is Maxemum TV-Guide (MTVG), which you can download as a TGZ archive, an RPM or DEB package from here: http://mtvg.sourceforge.net/

MTVG is developed in C++, based on Qt and it is the perfect solution if you use KDE. Alternatively, if you're using Gnome you can have a look at another XMLTV GUI application called OnTV: http://johan.svedberg.com/projects/coding/ontv/

Once you've installed and run MTVG you should see a screen like this one:

Press the "Preferences" button and fill the "Update" section to tell MTVG where to find the XML file and how to update its content:

As you can see in the above screenshots, you can tell tv_grab to run in quiet mode (for debug information not to be shown). Also, if you use the --days option you can tell tv_grab to only get the listings for a certain number of days. By default, tv_grab gets as much information as it can from its Internet source, so updates will be faster if you specify a number of days. Finally, check the "Auto Update" option to tell MTVG to update the listing automatically.

Press "Done", and "Update Now...". Once MTVG has finished updating the listings, the information appears on the screen:

By clicking on the adequate column you can sort the listings by time, title or channel. If you select an item, you'll see its description in the bottom pane. The two right panes allow you to filter by type of programs and by channel.

MTVG is also full of nice little features. For instance, it shows you which programs are already started and how long you have left until they finish. For instance, in the above screenshot, the "RTE Racing" program is 40% finished and there's only 1h33 left of it.

You can also search for programs and add them in your "favorite" list. When one of your "favorite" program is about to start MTVG notifies you with a popup dialog box or by running a command of your choice.

Conclusion

MTVG and XMLTV represent the perfect solution to get an updated TV schedule under Linux. It's fast, it's easy to configure and thanks to MTVG it's easy to browse and to use. You get notified for things you don't want to miss, the listings get updated automatically and, thanks to the way KDE sessions work, you can just take advantage of the MTVG system tray icon, have the application always run in the background and never think of it until you need it.


 
Discussion(s)
TV Guide under Linux
Written by Willie Buyoff on 2006-11-08 12:15:11
I guess this is a neat little application. I wouldn't really have much use for it. I really don't care what's on TV anywhere other than North America. Besides, if I really wanted to know what's on tv, why not go to tvguide.com?
Discuss! Reply!

TV Guide under Linux
Written by Willie Buyoff on 2006-11-08 12:16:57
Quote:

I guess this is a neat little application. I wouldn't really have much use for it. I really don't care what's on TV anywhere other than North America. Besides, if I really wanted to know what's on tv, why not go to tvguide.com?






With all that being said, I still will try it out b/c It looks pretty cool.
Discuss! Reply!

Settings for Japan
Written by Alain on 2006-11-25 19:11:14
Hi. I'm trying to make it work in Japan but I get the following errors when I try to get the tv guide or update it. Any idea how I can fix that UTF-8 problem? My locale is fr_CA.UTF-8.


Quote:

$ tv_grab_jp --output /home/alain/progtv.xml
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe7) at /usr/share/perl5/Date/Manip.pm line 7168.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7197.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7197.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7197.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7197.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7197.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7197.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7200.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7208.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7208.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7208.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7208.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7209.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7209.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7209.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7209.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7209.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7209.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7210.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7210.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7210.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7210.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7210.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7211.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7211.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7211.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7211.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7212.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7212.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7212.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7212.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7213.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7213.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7213.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7213.
Malformed UTF-8 character (unexpected non-continuation byte 0x6c, immediately after start byte 0xfa) at /usr/share/perl5/Date/Manip.pm line 7216.
Malformed UTF-8 character (unexpected non-continuation byte 0x6c, immediately after start byte 0xfa) at /usr/share/perl5/Date/Manip.pm line 7216.
Malformed UTF-8 character (unexpected non-continuation byte 0x20, immediately after start byte 0xed) at /usr/share/perl5/Date/Manip.pm line 7221.
Malformed UTF-8 character (unexpected non-continuation byte 0x73, immediately after start byte 0xe9) at /usr/share/perl5/Date/Manip.pm line 7225.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe0) at /usr/share/perl5/Date/Manip.pm line 7231.
Malformed UTF-8 character (unexpected non-continuation byte 0x20, immediately after start byte 0xe0) at /usr/share/perl5/Date/Manip.pm line 7231.
using config filename /home/alain/.xmltv/tv_grab_jp.conf
getting channels
getting program info





Discuss! Reply!

HFGID
Written by HDGFEF FHJDYFDFL on 2007-02-22 20:59:53
Quote:

Hi. I'm trying to make it work in Japan but I get the following errors when I try to get the tv guide or update it. Any idea how I can fix that UTF-8 problem? My locale is fr_CA.UTF-8.


Quote:

$ tv_grab_jp --output /home/alain/progtv.xml
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe7) at /usr/share/perl5/Date/Manip.pm line 7168.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7197.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7197.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7197.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7197.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7197.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7197.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7198.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7199.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7200.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7208.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7208.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7208.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7208.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7209.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7209.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7209.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7209.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7209.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7209.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7210.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7210.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7210.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7210.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7210.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7211.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7211.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7211.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7211.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7212.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7212.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7212.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7212.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7213.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7213.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7213.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe8) at /usr/share/perl5/Date/Manip.pm line 7213.
Malformed UTF-8 character (unexpected non-continuation byte 0x6c, immediately after start byte 0xfa) at /usr/share/perl5/Date/Manip.pm line 7216.
Malformed UTF-8 character (unexpected non-continuation byte 0x6c, immediately after start byte 0xfa) at /usr/share/perl5/Date/Manip.pm line 7216.
Malformed UTF-8 character (unexpected non-continuation byte 0x20, immediately after start byte 0xed) at /usr/share/perl5/Date/Manip.pm line 7221.
Malformed UTF-8 character (unexpected non-continuation byte 0x73, immediately after start byte 0xe9) at /usr/share/perl5/Date/Manip.pm line 7225.
Malformed UTF-8 character (1 byte, need 3, after start byte 0xe0) at /usr/share/perl5/Date/Manip.pm line 7231.
Malformed UTF-8 character (unexpected non-continuation byte 0x20, immediately after start byte 0xe0) at /usr/share/perl5/Date/Manip.pm line 7231.
using config filename /home/alain/.xmltv/tv_grab_jp.conf
getting channels
getting program info









Discuss! Reply!

American Forces Network?
Written by 67comet on 2007-08-14 03:58:04
I also live in Japan, but I use AFN (Armed Forces Network) provided by the US Mil and Mediatti Broadmand (Japanese Company). I can get the TV schedule off the internet, but it is in XML format only.

May I convert that to XMLTV or similar so I can use my Media Linux Box and it's dormant PVR card to do more than record DVD/VCR stuff?

Cheers,
Justin
Discuss! Reply!