diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2001-01-18 18:00:00 +0100 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2001-01-18 18:00:00 +0100 |
commit | 3fe3c15d5db9c1f3982ffe6dac1ae4ad56d1664d (patch) | |
tree | e1c4e489899c119fdfaad6f6bdf9bde988616df2 /epg2html.pl | |
parent | 9aa2cda494d7af2733362de78234441a25959e86 (diff) | |
download | vdr-patch-lnbsharing-3fe3c15d5db9c1f3982ffe6dac1ae4ad56d1664d.tar.gz vdr-patch-lnbsharing-3fe3c15d5db9c1f3982ffe6dac1ae4ad56d1664d.tar.bz2 |
Version 0.70vdr-0.70
- VDR now requires driver version 0.8.1 or higher.
- Recordings are now saved in PES mode. Note that you now need to install the
driver *WITHOUT* 'outstream=0'! This is the default when you 'make insmod' in
the DVB/driver directory.
Old recordings (in AV_PES mode) can still be replayed (as long as the driver
still supports replaying AV_PES files). The only limitation with this is that
in fast forward/back mode the picture may be slightly distorted and there may
be sound fragments.
- The EPG data is now dumped into the file /video/epg.data every ten minutes.
Use the Perl script 'epg2html.pl' to convert the raw EPG data into a simple
HTML programme listing.
- Fixed handling of channel switching with the "Blue" button in the "What's on
now/next?" menus.
- Fixed saving the MarginStop setup parameter.
- Fixed missing initialization in cConfig.
- Implemented "On Disk Editing".
- There is no more default 'timers.conf' file.
- Added Italian language texts (thanks to Alberto Carraro).
- Fixed starting a replay session when the program is currently in "transfer
mode".
- Fixed setting/modifying timers via SVDRP with empty summary fields.
- Fixed a problem with recordings that have a single quote character in their
name (this is now mapped to 0x01).
- Changed the value for Diseqc to '0' in the default 'channels.conf'.
- Fixed displaying channels and recording status in the RCU's LED display when
a recording is interrupted due to higher priority.
- Implemented safe writing of config files (first writes into a temporary file
and then renames it).
- In case the video data stream is broken the log message will come only every
5 seconds.
- The current channel is now saved in the 'setup.conf' file when VDR is cancelled,
and will be restored next time it is started (thanks to Deti Fliegl).
- The EIT scanning thread is now locked when switching channels to avoid problems.
- Encrypted channels can now be selected even without knowing the PNR (however, it
is still necessary for the EPG info).
Diffstat (limited to 'epg2html.pl')
-rw-r--r-- | epg2html.pl | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/epg2html.pl b/epg2html.pl new file mode 100644 index 0000000..215eb73 --- /dev/null +++ b/epg2html.pl @@ -0,0 +1,96 @@ +#!/usr/bin/perl + +# A simple EPG to HTML converter +# +# Converts the EPG data written by 'vdr' into the file /video/epg.data +# into a simple HTML programme listing, consisting of one file per channel +# plus an 'index.htm' file. All output files are written into the current +# directory. +# +# Usage: epg2html.pl < /video/epg.data +# +# See the main source file 'vdr.c' for copyright information and +# how to reach the author. +# +# $Id: epg2html.pl 1.2 2000/12/01 18:37:46 kls Exp $ + +@Index = (); + +sub GetDay +{ + return substr(localtime(shift), 0, 10); +} + +sub GetTime +{ + return substr(localtime(shift), 11, 5); +} + +sub Tags +{ + my $s = shift; + $s =~ s/\&/&/g; + $s =~ s/</</g; + $s =~ s/>/>/g; + return $s; +} + +while (<>) { + chomp; + if (/^C ([^ ]+) *(.*)/) { + my $Channel = $2; + (my $Page = $Channel) =~ y/\/ /-_/; + $Page .= ".htm"; + $Channel = Tags($Channel); + push(@Index, qq{<a href="$Page">$Channel</a><br>\n}); + my %Events = (); + while (<>) { + if (/^E (.*) (.*) (.*)/) { + (my $Time, $Duration) = ($2, $3); + my $Title = "", $Subtitle = "", $Description = ""; + while (<>) { + if (/^T (.*)/) { $Title = Tags($1); } + elsif (/^S (.*)/) { $Subtitle = Tags($1); } + elsif (/^D (.*)/) { $Description = Tags($1); } + elsif (/^e/) { + $Events{$Time} = [($Duration, $Title, $Subtitle, $Description)]; + last; + } + } + } + elsif (/^c/) { + my @Schedule = (); + my $Day = ""; + for $t (sort keys %Events) { + (my $Duration, $Title, $Subtitle, $Description) = @{$Events{$t}}; + my $d = GetDay($t); + if ($d ne $Day) { + push(@Schedule, "</table>\n") if ($Day && @Schedule); + push(@Schedule, "<h2>$d</h2>\n"); + push(@Schedule, "<table cellspacing=2>\n"); + $Day = $d; + } + my $Entry = $Title; + $Entry .= "<br><i>$Subtitle</i>" if $Subtitle; + $Entry .= "<br>$Description" if $Description; + push(@Schedule, "<tr><td valign=top>" . GetTime($t) . "</td><td>$Entry</td></tr>\n"); + } + push(@Schedule, "</table>\n") if (@Schedule); + open(PAGE, ">$Page") or die "$Page: $!\n"; + print PAGE "<html>\n<head><title>$Channel</title><head>\n<body>\n"; + print PAGE "<h1>$Channel</h1>\n"; + print PAGE @Schedule; + print PAGE "</body>\n</html>\n"; + close(PAGE); + last; + } + } + } + } + +open(INDEX, ">index.htm") or die "index.htm: $!\n"; +print INDEX "<html>\n<head><title>EPG Index</title><head>\n<body>\n"; +print INDEX sort { lc($a) cmp lc($b) } @Index; +print INDEX "</body>\n</html>\n"; +close(INDEX); + |