Postprocessing

Discussion of my XMLTV Radio Times grabber
Post Reply
TriTonT
Posts: 1
Joined: Mon Sep 13, 2004 10:39 pm

Postprocessing

Post by TriTonT »

Hi,

First up, thanks for the (very frequent) updates. You've managed to make the whole XMLTV thing a no-brainer for people in the UK.

For those who still need to do a bit more with the output, such as put the channels in a particular order or strip out sections I've got a quick method.

By using the DOS version of the UNIX sed command (I'm using GNU sed 4.0.7) you can make changes to the output file.

I use the following .bat file to download the listing - wait 2 minutes for it to finish - postprocess it with the parameters specified in the sedscript file.

download.bat

RadioTimes\xmltvrt.exe /grab
sleep 120
sed -f sedscript RadioTimes\data.xml > listing.xml

sedscript file

#sed script to fix xmltv
#fix seconds
s/ +0/00 +0/g
#fix channel order (id)
s/channel id="99"/channel id="01"/g
s/channel id="112"/channel id="02"/g
s/channel id="38"/channel id="03"/g
s/channel id="132"/channel id="04"/g
s/channel id="134"/channel id="05"/g
s/channel id="185"/channel id="06"/g
s/channel id="45"/channel id="07"/g
s/channel id="47"/channel id="10"/g
s/channel id="801"/channel id="12"/g
s/channel id="923"/channel id="19"/g
s/channel id="921"/channel id="20"/g
#fix channel order (programme)
s/channel="99"/channel="01"/g
s/channel="112"/channel="02"/g
s/channel="38"/channel="03"/g
s/channel="132"/channel="04"/g
s/channel="134"/channel="05"/g
s/channel="185"/channel="06"/g
s/channel="45"/channel="07"/g
s/channel="47"/channel="10"/g
s/channel="801"/channel="12"/g
s/channel="923"/channel="19"/g
s/channel="921"/channel="20"/g

The above script first adds seconds to all the programme times (not needed by me now that it is an option in the grabber) and second maps the channel ids from the Radio Times to the Freeview channel numbers (as this is the order I want them to list in DVR application I use).

sed could also be used to limit the number of days you give to your application, limit the fields (eg not including <credits>) or tweaking the field names so you application can display the info you want.

The above sedscript runs for me in about 2sec.

None of this would be necessary if all the applications we use had all the functions we want, but at least sed is a quick workaround.

Current setup:

Windows 2003 Server with 2 VisionPlus DVB-t cards
running WebScheduler and XMLTV Radio Times Grabber
allowing recording of about 6 channels at once

Serving recorded content and XMLTV data to
2 x xbox (XBMC)
1 x PC (Media Portal)
1 x PocketPC (XMLTV data only)
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Post by alanbirtles »

ok thanks for the info, its always interesting to know how people are using my programs
spants

thanks for the idea

Post by spants »

i need to get them in telewest format.... :)
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Post by alanbirtles »

it should be fairly easy to do, all you will need to do is copy the above script and change the channel numbers
SidKnee

Channel Ordering

Post by SidKnee »

Hi Alan - is there any way that this channel ordering can be built into your grabber, so that we can specify a channel ID that the grabber will write to the XML?

From a purely selfish point of view :oops:
I know that SageTV will allow me to remap channel ID's to the correct channel numbers (for the tuner), but it still displays them in ID order.

It's not the end of the world but it would make things even easier for us SageTV users :wink:

Cheers,
SidKnee
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Post by alanbirtles »

not easily and i havent got a lot of spare time at the moment but it could be done in the future
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Post by alanbirtles »

as a quick solution i have added a altchids.txt file in the program directory, to change the output xml id simply add the radio times ID followed by a space then the ID you want in the XML (doesn't have to be a number) eg:

Code: Select all

#Radiotimes channel ID - XMLTV channel ID
102 BBC1
115 BBC2
30 ITV1
132 Ch4
134 Five
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Post by alanbirtles »

see http://www.birtles.org.uk/xmltv/xmltv_altchids.txt for a altchids.txt file containing the ids used by XMLTV
Last edited by alanbirtles on Tue Jun 07, 2005 8:47 pm, edited 1 time in total.
SidKnee

Post by SidKnee »

Hi Alan - As usual you're just too quick off the mark :D

Checked this out last night and it works exactly as you said it would - my only problem now is operator error :roll: Sage isn't displaying channels by XML ID but by channel order - so it ignores the ID changes you've so helpfully incorporated :oops:

Doh!
SidKnee
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Post by alanbirtles »

ah well, i'd been meaing to do this for a while anyway
RedDom

Channel numbers.

Post by RedDom »

Alan,
I also use your fantastic grabber with sageTV. The main issue with sage is ordering the channels and getting the correct TV channel number in the guide. It seems that it needs some extra information about the channel number. Putting it in the channel id does not really help. It seems it needs to go in the display name portion of the channels section.
Would it be possible to have a file like altchids, but that could be used for channel numbers to produce something like this. with the channel number being the first element of the display name.

<channel id="london.bbc2.bbc.co.uk">
<display-name>2</display-name>
<display-name>BBC2 London & South East</display-name>
</channel>

obviously different platforms have different channel numbers, but it would be quite easy for people to fill their own list in.

thx
RD
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Post by alanbirtles »

i might look into this in a few weeks, but im really busy at the moment, are you sure this is nescesarry? have you asked on the sage boards for an alternative method
RedDom

Post by RedDom »

Thats fine, there are various ways to do this in sage, its jus easier if someone else does all the work.... :lol:

RD
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Post by alanbirtles »

have you tried the import plugin provided by nielm in this thread http://forums.freytechnologies.com/foru ... ostcount=4 ?
Guest

Post by Guest »

:oops: I had tried it before, but not in combination with remapping the channel ids. that works fine, i'm not sure what will happen if I do use multiple lineups, as they will have to have different channel ids' in order to have different channel numbers, which may cause some confusion.

RD
Post Reply