From 287cd613a1d5d08fb56e107460473132d23e3ca0 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 3 Dec 2006 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.4.4-1=20-=20Some=20improvements=20to=20the?= =?UTF-8?q?=20man=20pages=20(thanks=20to=20Ville=20Skytt=C3=A4).=20-=20Fix?= =?UTF-8?q?ed=20a=20possible=20segfault=20in=20cSkins::Message()=20(thanks?= =?UTF-8?q?=20to=20Udo=20Richter).=20-=20Made=20the=20getskyepg.pl=20scrip?= =?UTF-8?q?t=20of=20the=20'sky'=20plugin=20send=20a=20user=20agent=20messa?= =?UTF-8?q?ge=20to=20=20=20the=20server,=20according=20to=20the=20rules=20?= =?UTF-8?q?at=20http://bleb.org/tv/data/listings.=20=20=20If=20your=20vers?= =?UTF-8?q?ion=20of=20'wget'=20doesn't=20support=20the=20-U=20option=20to?= =?UTF-8?q?=20set=20the=20user=20agent,=20=20=20use=20the=20new=20option?= =?UTF-8?q?=20-U=20of=20getskyepg.pl=20to=20have=20the=20information=20add?= =?UTF-8?q?ed=20to=20the=20URL=20=20=20as=20a=20query=20string.=20-=20The?= =?UTF-8?q?=20getskyepg.pl=20script=20now=20replaces=20"&"=20with=20"&?= =?UTF-8?q?".=20-=20Fixed=20a=20possible=20crash=20in=20remux.c=20on=2064-?= =?UTF-8?q?bit=20machines=20(thanks=20to=20Reinhard=20Nissl).=20-=20Fixed?= =?UTF-8?q?=20a=20typo=20in=20the=20change=20to=20the=20"Use=20small=20fon?= =?UTF-8?q?t"=20setup=20option=20in=20version=201.3.47=20=20=20in=20the=20?= =?UTF-8?q?HISTORY=20and=20CONTRIBUTORS=20file=20(reported=20by=20Andreas?= =?UTF-8?q?=20Brugger).=20-=20Added=20a=20missing=20'const'=20to=20cRecord?= =?UTF-8?q?ingInfo::ChannelID()=20(reported=20by=20Andreas=20=20=20Brugger?= =?UTF-8?q?).=20This=20required=20the=20APIVERSION=20to=20be=20increased,?= =?UTF-8?q?=20so=20plugins=20will=20have=20to=20=20=20be=20recompiled.=20-?= =?UTF-8?q?=20Now=20calling=20cPluginManager::Active()=20only=20if=20VDR?= =?UTF-8?q?=20is=20really=20trying=20to=20shut=20down,=20=20=20and=20waiti?= =?UTF-8?q?ng=20for=205=20minutes=20before=20calling=20it=20again=20(thank?= =?UTF-8?q?s=20to=20J=C3=B6rg=20Wendel=20for=20=20=20reporting=20that=20cP?= =?UTF-8?q?lugin::Active()=20was=20called=20too=20often,=20and=20to=20Udo?= =?UTF-8?q?=20Richter=20for=20=20=20some=20hints=20on=20how=20to=20improve?= =?UTF-8?q?=20this).=20-=20Replaced=20'unsigned=20long'=20with=20'uint32?= =?UTF-8?q?=5Ft'=20and=20'uint64'=20with=20'uint64=5Ft'=20to=20=20=20avoid?= =?UTF-8?q?=20problems=20on=2064-bit=20machines.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PLUGINS/src/sky/HISTORY | 9 +++++++++ PLUGINS/src/sky/getskyepg.pl | 28 ++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 4 deletions(-) (limited to 'PLUGINS/src/sky') diff --git a/PLUGINS/src/sky/HISTORY b/PLUGINS/src/sky/HISTORY index 45774f1..3233bf6 100644 --- a/PLUGINS/src/sky/HISTORY +++ b/PLUGINS/src/sky/HISTORY @@ -45,3 +45,12 @@ VDR Plugin 'sky' Revision History 2006-03-26: Version 0.3.5 - Fixed format string handling. + +2006-12-02: Version 0.3.5 (version number not increased) + +- Made the getskyepg.pl script send a user agent message to + the server, according to the rules at http://bleb.org/tv/data/listings. + If your version of 'wget' doesn't support the -U option to set the user agent, + use the new option -U of getskyepg.pl to have the information added to the URL + as a query string. +- The getskyepg.pl script now replaces "&" with "&". diff --git a/PLUGINS/src/sky/getskyepg.pl b/PLUGINS/src/sky/getskyepg.pl index 26dbc0a..6388caa 100755 --- a/PLUGINS/src/sky/getskyepg.pl +++ b/PLUGINS/src/sky/getskyepg.pl @@ -8,7 +8,7 @@ # # See the README file for copyright information and how to reach the author. # -# $Id: getskyepg.pl 1.4 2006/01/08 10:21:32 kls Exp $ +# $Id: getskyepg.pl 1.6 2006/12/02 09:52:49 kls Exp $ use Getopt::Std; use Time::Local; @@ -21,18 +21,29 @@ Options: -c filename channel config file name (default: channels.conf.sky -p port SVDRP port number (default: 2001) -S source channel source (default: S28.2E) -D days days to get EPG for (1..7, default: 2) + -U use this if your version of 'wget' doesn't support -U }; -die $Usage if (!getopts("c:d:D:hp:S:") || $opt_h); +die $Usage if (!getopts("c:d:D:hp:S:U") || $opt_h); $Conf = $opt_c || "channels.conf.sky"; $Dest = $opt_d || "localhost"; $Port = $opt_p || 2001; $Source = $opt_S || "S28.2E"; $Days = $opt_D || 2; +$User = $opt_U; + +# See "Rules for using this data" on http://bleb.org/tv/data/listings. +# In case you modify this script in a way that changes its behavior +# towards the www.bleb.org website, please replace 'vdrbugs@cadsoft.de' +# with your own email address! That way Andrew Flegg , +# who runs that web site, can contact you in case of problems. +$IDENT = "VDR::getskyepg.pl, http://www.cadsoft.de/vdr - vdrbugs\@cadsoft.de"; +$GAP = 2; $SkyWebPage = "www.bleb.org/tv/data/listings"; $WGET = "/usr/bin/wget -q -O-"; +$WGET .= " -U '$IDENT'" unless $User; $LOGGER = "/usr/bin/logger -t SKYEPG"; $DST = -3600; # Daylight Saving Time offset @@ -76,13 +87,21 @@ sub GetPage my $channel = shift; my $day = shift; $day--; - my $url = "$SkyWebPage/$day/$channel.xml"; + my $url = "http://$SkyWebPage/$day/$channel.xml"; + $url .= "?$IDENT" if $User; Log("reading $url"); my @page = split("\n", `$WGET '$url'`); Log("received " . ($#page + 1) . " lines"); return @page; } +sub ReplaceTags +{ + my $s = shift; + $s =~ s/&/&/g; + return $s; +} + sub StripWhitespace { my $s = shift; @@ -96,7 +115,7 @@ sub Extract my $s = shift; my $t = shift; $s =~ /<$t>([^<]*)<\/$t>/; - return StripWhitespace($1); + return ReplaceTags(StripWhitespace($1)); } # In order to get the duration we need to buffer the last event: @@ -174,6 +193,7 @@ sub GetEpgData $data .= $line; } } + sleep($GAP); } SVDRPsend("c"); Log("generated $numEvents EPG events"); -- cgit v1.2.3