XMLTV – the easy way…

I had a lot of trouble in the past using the graphical front end for xmltv in Ubuntu, and ended up running the whole thing from the command line. This is how:

Install xmltv:

For ubuntu:

sudo apt-get install xmltv

For Arch:

sudo pacman -S xmltv

There, that wasn’t too hard :)

Do the next part as a normal user, and set your files to be created in your home directory somewhere

Now you need to locate your “grabber”

tv_find_grabbers

I needed tv_grab_uk_rt, I hope there is one there for your area

Next you need to configure your settings:

tv_grab_uk_rt – -configure

With this command you can make choices about many things, choose the defaults if unsure, and only choose the channels you want.

Now to grab the listings, pick a location for the xml file you will create

tv_grab_uk_rt – -output=/home/bimma/.TVDATA.xml

Then, if you want to, you can sort your listing:

tv_sort – -output=/home/bimma/.TVDATA.xml     /home/bimma/.TVDATA.xml

That’s it. Now what? How do you get to your listings? Well, I use a nice little web application called TVFOX, which lays out the listings in a decent order, and allows you to assign scripts to clickable areas, for watching and recording.

To wrap things up, I wrote a small script to fetch the listings every Sunday after I boot up the PC (could never get the hang of cron, or it could never get the hang of me!) which I put in my autostart.sh (on openbox).

First, gettv.sh:

#!/bin/bash
sleep 60
rightday=0
curday=$(date -d now +%w)
mysunday=$(date -d now +%A)

if [ “$curday” = “$rightday” ] ; then
zenity –question –title=”TV Listings” –text=”It’s “$mysunday”, do you want to collect TV Listings?”
itssunday=$?
else
exit
fi

echo “Output still $itssunday”

if [ “$itssunday” = 0 ] ; then
terminal -x /home/bimma/tv_listings.sh
else
exit
fi

and tv_listings.sh:

#!/bin/bash
/usr/bin/tv_grab_uk_rt –output=/home/bimma/.TVDATA.xml
/usr/bin/tv_sort –output=/home/bimma/.TVDATA.xml  /home/bimma/.TVDATA.xml

Enjoy

Addendum:

You may need to change the ownership and read/writeability of your .xmltv directory to get updates working:

sudo chown -R user_name ~/.xmltv

sudo  chmod -R 777 ~/.xmltv

Leave a Reply

Your email address will not be published. Required fields are marked *