Postprocessing
Postprocessing
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)
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)
-
- Site Admin
- Posts: 495
- Joined: Mon Sep 06, 2004 4:44 pm
-
- Site Admin
- Posts: 495
- Joined: Mon Sep 06, 2004 4:44 pm
Channel Ordering
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
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
Cheers,
SidKnee
From a purely selfish point of view
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
Cheers,
SidKnee
-
- Site Admin
- Posts: 495
- Joined: Mon Sep 06, 2004 4:44 pm
-
- Site Admin
- Posts: 495
- Joined: Mon Sep 06, 2004 4:44 pm
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
-
- Site Admin
- Posts: 495
- Joined: Mon Sep 06, 2004 4:44 pm
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.
Hi Alan - As usual you're just too quick off the mark
Checked this out last night and it works exactly as you said it would - my only problem now is operator error Sage isn't displaying channels by XML ID but by channel order - so it ignores the ID changes you've so helpfully incorporated
Doh!
SidKnee
Checked this out last night and it works exactly as you said it would - my only problem now is operator error Sage isn't displaying channels by XML ID but by channel order - so it ignores the ID changes you've so helpfully incorporated
Doh!
SidKnee
-
- Site Admin
- Posts: 495
- Joined: Mon Sep 06, 2004 4:44 pm
Channel numbers.
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
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
-
- Site Admin
- Posts: 495
- Joined: Mon Sep 06, 2004 4:44 pm
-
- Site Admin
- Posts: 495
- Joined: Mon Sep 06, 2004 4:44 pm
have you tried the import plugin provided by nielm in this thread http://forums.freytechnologies.com/foru ... ostcount=4 ?