From 939081e274d0a9868e5ba9a7951666ad508afb96 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Wed, 6 Jan 2010 13:34:00 +0100 Subject: =?UTF-8?q?Version=201.7.11=20-=20Fixed=20resetting=20the=20file?= =?UTF-8?q?=20size=20when=20regenerating=20the=20index=20file.=20-=20The?= =?UTF-8?q?=20new=20function=20cDevice::PatPmtParser()=20can=20be=20used?= =?UTF-8?q?=20in=20derived=20devices=20to=20access=20=20=20the=20PAT/PMT?= =?UTF-8?q?=20of=20the=20currently=20replayed=20material.=20-=20Updated=20?= =?UTF-8?q?the=20Italian=20OSD=20texts=20(thanks=20to=20Diego=20Pierotto).?= =?UTF-8?q?=20-=20The=20PCR=20pid=20in=20generated=20PMTs=20is=20now=20set?= =?UTF-8?q?=20to=200x1FFF=20("no=20PCR=20pid")=20in=20=20=20cPatPmtGenerat?= =?UTF-8?q?or::GeneratePmt(),=20because=20VDR=20doesn't=20record=20the=20P?= =?UTF-8?q?CR=20pid.=20-=20Updated=20the=20Estonian=20OSD=20texts=20(thank?= =?UTF-8?q?s=20to=20Arthur=20Konovalov).=20-=20The=20'sky'=20plugin=20is?= =?UTF-8?q?=20no=20longer=20part=20of=20the=20VDR=20source.=20-=20Improved?= =?UTF-8?q?=20SPU=20handling=20on=20devices=20with=20limited=20OSD=20capab?= =?UTF-8?q?ilities=20(thanks=20to=20=20=20Matthieu=20Castet).=20-=20Severa?= =?UTF-8?q?l=20code=20modifications=20to=20avoid=20compiler=20warnings=20(?= =?UTF-8?q?thanks=20to=20Winfried=20K=C3=B6hler).=20-=20Added=20stream=20t?= =?UTF-8?q?ype=2011172=20AUDIO=20to=20cPatPmtParser::ParsePmt()=20(thanks?= =?UTF-8?q?=20to=20Johann=20=20=20Friedrichs).=20-=20Removed=20debug=20out?= =?UTF-8?q?put=20of=20'-'=20from=20cTransfer::Receive().=20-=20Added=20def?= =?UTF-8?q?ines=20for=20large=20files=20to=20the=20'newplugin'=20script=20?= =?UTF-8?q?(reported=20by=20Udo=20Richter).=20-=20Removed=20the=20workarou?= =?UTF-8?q?nd=20for=20short=20channel=20names=20of=20"Kabel=20Deutschland"?= =?UTF-8?q?,=20because=20=20=20apparently=20they=20now=20have=20their=20da?= =?UTF-8?q?ta=20according=20to=20the=20DVB=20standard=20(thanks=20to=20=20?= =?UTF-8?q?=20Johann=20Friedrichs).=20-=20Some=20fixes=20to=20dvbspu.[hc]?= =?UTF-8?q?=20(thanks=20to=20Johann=20Friedrichs).=20-=20Fixed=20a=20busy?= =?UTF-8?q?=20loop=20when=20moving=20editing=20marks=20(thanks=20to=20Joha?= =?UTF-8?q?nn=20Friedrichs).=20-=20Updated=20sources.conf=20(thanks=20to?= =?UTF-8?q?=20Derek=20Kelly).=20-=20Modified=20cCharSetConv=20so=20that=20?= =?UTF-8?q?it=20can=20be=20used=20to=20convert=20from=20"whatever=20VDR=20?= =?UTF-8?q?uses"=20=20=20to=20a=20given=20code=20(thanks=20to=20Joachim=20?= =?UTF-8?q?Wilke).=20-=20Channel=20names=20containing=20commas=20are=20now?= =?UTF-8?q?=20handled=20correctly=20in=20channels.conf.=20=20=20If=20a=20c?= =?UTF-8?q?hannel's=20short=20name=20contains=20a=20comma,=20it=20is=20rep?= =?UTF-8?q?laced=20with=20a=20'.'.=20-=20cDevice=20now=20logs=20the=20devi?= =?UTF-8?q?ce=20number=20when=20a=20new=20device=20is=20created.=20-=20Fix?= =?UTF-8?q?ed=20handling=20STREAMTYPE=5F11172=5FAUDIO=20in=20cPatPmtParser?= =?UTF-8?q?::ParsePmt().=20-=20cParsePatPmt=20now=20has=20functions=20to?= =?UTF-8?q?=20retrieve=20the=20audio,=20dolby=20and=20subtitle=20pids.=20-?= =?UTF-8?q?=20cPatFilter::Process()=20now=20only=20stores=20CA=20descripto?= =?UTF-8?q?rs=20for=20video=20and=20audio=20pids=20=20=20(thanks=20to=20Fr?= =?UTF-8?q?ancesco=20Saverio=20Schiavarelli=20for=20reporting=20a=20proble?= =?UTF-8?q?m=20with=20channels=20=20=20that=20have=20some=20encrypted=20co?= =?UTF-8?q?mponents=20that=20VDR=20doesn't=20use).=20-=20cDevice::AddPid()?= =?UTF-8?q?=20now=20stores=20the=20stream=20type=20of=20the=20given=20pid?= =?UTF-8?q?=20(thanks=20to=20Andreas=20=20=20Regel).=20-=20Added=20cFont::?= =?UTF-8?q?FontName()=20and=20cFont::Size()=20(thanks=20to=20Andreas=20Reg?= =?UTF-8?q?el).=20-=20cPatPmtParser=20now=20also=20stores=20the=20audio=20?= =?UTF-8?q?stream=20types.=20-=20The=20support=20for=20full=20featured=20D?= =?UTF-8?q?VB=20cards=20of=20the=20TT/FuSi=20design=20has=20been=20moved?= =?UTF-8?q?=20=20=20into=20the=20new=20plugin=20'dvbsddevice'.=20On=20syst?= =?UTF-8?q?ems=20that=20use=20such=20a=20card=20as=20their=20=20=20primary?= =?UTF-8?q?=20device,=20this=20plugin=20now=20needs=20to=20be=20loaded=20w?= =?UTF-8?q?hen=20running=20VDR=20in=20order=20=20=20to=20view=20live=20or?= =?UTF-8?q?=20recorded=20video.=20If=20the=20plugin=20is=20not=20loaded,?= =?UTF-8?q?=20the=20card=20will=20=20=20be=20treated=20like=20a=20budget?= =?UTF-8?q?=20DVB=20card,=20and=20there=20will=20be=20no=20OSD=20or=20view?= =?UTF-8?q?ing=20=20=20capability.=20-=20Fixed=20handling=20the=20"CA=20PM?= =?UTF-8?q?T"=20generation=20(revised=20a=20change=20not=20mentioned=20in?= =?UTF-8?q?=20version=20=20=201.7.9's=20changes,=20which=20caused=20a=20ma?= =?UTF-8?q?lfunction=20with=20Conax=20and=20Viaccess=20CAMs).=20-=20Fixed?= =?UTF-8?q?=20stopping=20subtitle=20display=20when=20switching=20the=20pri?= =?UTF-8?q?mary=20device=20(thanks=20to=20=20=20Anssi=20Hannula).=20=20=20?= =?UTF-8?q?IMPORTANT=20NOTE=20TO=20PLUGIN=20AUTHORS:=20a=20plugin=20that?= =?UTF-8?q?=20implements=20a=20derived=20cDevice=20=20=20class=20that=20ca?= =?UTF-8?q?n=20replay=20video=20must=20now=20call=20the=20MakePrimaryDevic?= =?UTF-8?q?e()=20function=20of=20=20=20its=20base=20class.=20-=20Fixed=20c?= =?UTF-8?q?ompiler=20warnings=20"format=20not=20a=20string=20literal=20and?= =?UTF-8?q?=20no=20format=20arguments"=20=20=20in=20some=20syslog=20calls?= =?UTF-8?q?=20(thanks=20to=20Rolf=20Ahrenberg).=20-=20The=20new=20command?= =?UTF-8?q?=20line=20options=20--edit=20and=20--genindex=20can=20be=20used?= =?UTF-8?q?=20to=20edit=20a=20=20=20recording=20or=20generate=20its=20inde?= =?UTF-8?q?x=20without=20actually=20starting=20the=20entire=20VDR=20=20=20?= =?UTF-8?q?(based=20on=20a=20patch=20from=20Helmut=20Auer).=20-=20Improved?= =?UTF-8?q?=20the=20description=20of=20the=20transponder=20parameters=20in?= =?UTF-8?q?=20vdr.5=20(thanks=20to=20=20=20Winfried=20K=C3=B6hler).=20-=20?= =?UTF-8?q?Avoiding=20setting=20the=20video=20stream=20type=20to=202=20if?= =?UTF-8?q?=20the=20vpid=20is=200=20(problem=20reported=20=20=20by=20Arthu?= =?UTF-8?q?r=20Konovalov).=20-=20Implemented=20handling=20the=20"Content?= =?UTF-8?q?=20Descriptor"=20(based=20on=20a=20patch=20from=20Rolf=20=20=20?= =?UTF-8?q?Ahrenberg).=20The=20'classic',=20'sttng'=20and=20'curses'=20ski?= =?UTF-8?q?ns=20display=20the=20textual=20=20=20representation=20of=20the?= =?UTF-8?q?=20content=20descriptors=20as=20"genre".=20The=20epg.data=20fil?= =?UTF-8?q?e=20stores=20=20=20the=20genre=20using=20the=20tag=20character?= =?UTF-8?q?=20'G'.=20-=20Implemented=20handling=20the=20"Parental=20Rating?= =?UTF-8?q?=20Descriptor"=20(based=20on=20a=20patch=20from=20Rolf=20=20=20?= =?UTF-8?q?Ahrenberg).=20The=20'classic',=20'sttng'=20and=20'curses'=20ski?= =?UTF-8?q?ns=20display=20the=20parental=20=20=20rating=20(if=20given)=20i?= =?UTF-8?q?n=20their=20event=20displays.=20The=20epg.data=20file=20stores?= =?UTF-8?q?=20=20=20the=20parental=20rating=20using=20the=20tag=20characte?= =?UTF-8?q?r=20'R'.=20=20=20IMPORTANT=20NOTE:=20if=20VDR=20doesn't=20displ?= =?UTF-8?q?ay=20a=20parental=20rating,=20this=20does=20not=20=20=20necessa?= =?UTF-8?q?rily=20mean=20that=20the=20given=20programme=20is=20suitable=20?= =?UTF-8?q?for=20all=20audiences!=20-=20Rearranged=20cEvent=20members=20to?= =?UTF-8?q?=20minimize=20memory=20waste.=20-=20After=20a=20CLRE=20command,?= =?UTF-8?q?=20no=20further=20EPG=20processing=20is=20now=20done=20for=2010?= =?UTF-8?q?=20seconds,=20=20=20so=20that=20data=20sent=20with=20subsequent?= =?UTF-8?q?=20PUTE=20commands=20doesn't=20interfere=20with=20data=20=20=20?= =?UTF-8?q?from=20the=20broadcasters=20(suggested=20by=20Helmut=20Auer).?= =?UTF-8?q?=20-=20Added=20support=20for=20DVB=20cards=20with=20multiple=20?= =?UTF-8?q?fontends.=20Note=20that=20this=20only=20=20=20works=20for=20DVB?= =?UTF-8?q?=20cards=20where=20each=20frontend=20can=20be=20used=20independ?= =?UTF-8?q?ently=20of=20all=20=20=20the=20others=20on=20the=20same=20adapt?= =?UTF-8?q?er.=20-=20Fixed=20plugin=20arguments=20corruption=20with=20glib?= =?UTF-8?q?c=202.11=20on=20x86=5F64=20(thanks=20to=20=20=20Anssi=20Hannula?= =?UTF-8?q?).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PLUGINS/src/sky/getskyepg.pl | 260 ------------------------------------------- 1 file changed, 260 deletions(-) delete mode 100755 PLUGINS/src/sky/getskyepg.pl (limited to 'PLUGINS/src/sky/getskyepg.pl') diff --git a/PLUGINS/src/sky/getskyepg.pl b/PLUGINS/src/sky/getskyepg.pl deleted file mode 100755 index dfca96a..0000000 --- a/PLUGINS/src/sky/getskyepg.pl +++ /dev/null @@ -1,260 +0,0 @@ -#!/usr/bin/perl - -# getskyepg.pl: Get EPG data for Sky channels from the Internet -# -# Connects to a running VDR instance via SVDRP, gets the channel data -# for the Sky channels and connects to Internet web pages to extract the -# EPG data for these channels. The result is sent to VDR via SVDRP. -# -# See the README file for copyright information and how to reach the author. -# -# $Id: getskyepg.pl 2.1 2009/10/18 14:05:47 kls Exp $ - -use Getopt::Std; -use Time::Local; - -$Usage = qq{ -Usage: $0 [options] - -Options: -c filename channel config file name (default: channels.conf.sky) - -d hostname destination hostname (default: localhost) - -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: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 'vdr-bugs@tvdr.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.tvdr.de - vdr-bugs\@tvdr.de"; -$GAP = 2; - -$SkyWebPage = "www.bleb.org/tv/data/listings"; -$WGET = "/usr/bin/wget -q -O-"; -$WGET .= " -U '$IDENT'" unless $User; -$LOGGER = "logger -t SKYEPG"; - -$DST = -3600; # Daylight Saving Time offset -$SecsInDay = 86400; - -@Channels = (); - -$idxSource = 0; -$idxNumber = 1; -$idxName = 2; - -Error("days out of range: $Days") unless (1 <= $Days && $Days <= 7); - -sub Log -{ - system("$LOGGER '@_'"); -} - -sub Error -{ - Log(@_); - die "$0: @_\n"; -} - -sub GetChannels -{ - open(CHANNELS, $Conf) || Error("$Conf: $!"); - while () { - chomp; - next if (/^#/); - my @a = split(":"); - push(@Channels, [@a]) unless ($a[$idxName] eq "x"); - } - close(CHANNELS); -} - -GetChannels(); - -sub GetPage -{ - my $channel = shift; - my $day = shift; - $day--; - 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; - $s =~ s/\s*(.*)\s*/$1/; - $s =~ s/\s+/ /g; - return $s; -} - -sub Extract -{ - my $s = shift; - my $t = shift; - $s =~ /<$t>([^<]*)<\/$t>/; - return ReplaceTags(StripWhitespace($1)); -} - -# In order to get the duration we need to buffer the last event: -$Id = ""; -$Time = 0; -$Title = ""; -$Subtitle = ""; -$Desc = ""; - -sub GetEpgData -{ - my ($channel, $channelID) = @_; - my $numEvents = 0; - SVDRPsend("C $channelID"); - $Time = 0; - for $day (1 .. $Days) { - my $dt = 0; - my @page = GetPage($channel, $day); - my $data = ""; - for $line (@page) { - chomp($line); - if ($line =~ //) { - $data = ""; - } - elsif ($line =~ /<\/programme>/) { - my $title = Extract($data, "title"); - my $subtitle = Extract($data, "subtitle"); - my $desc = Extract($data, "desc"); - my $start = Extract($data, "start"); - # 'end' is useless, because it is sometimes missing :-( - # my $end = Extract($data, "end"); - if (!$subtitle) { - # They sometimes write all info into the description, as in - # Episode: some description. - # Why don't they just fill in the data correctly? - my ($s, $d) = ($desc =~ /([^:]*)[:](.*)/); - if ($s && $d) { - $subtitle = $s; - $desc = $d; - } - } - # 'start' and 'end' as time of day isn't of much use here, since - # the page for one day contains data that actually belongs to the - # next day (after midnight). Oh well, lets reconstruct the missing - # information: - $start = "0" . $start if (length($start) < 4); - my ($h, $m) = ($start =~ /(..)(..)/); - $dt = $SecsInDay if ($h > 12); - # convert to time_t: - my @gmt = gmtime; - $gmt[0] = 0; # seconds - $gmt[1] = $m; # minutes - $gmt[2] = $h; # hours - $time = timegm(@gmt) + ($day - 1) * $SecsInDay + ($h < 12 ? $dt : 0); - # compensate for DST: - $time += $DST if (localtime($time))[8]; - # create EPG data: - if ($Time) { - $duration = $time - $Time; - SVDRPsend("E $Id $Time $duration"); - SVDRPsend("T $Title"); - SVDRPsend("S $Subtitle"); - SVDRPsend("D $Desc"); - SVDRPsend("e"); - $numEvents++; - } - # buffer the last event: - $Id = $time / 60 % 0xFFFF; # this gives us unique ids for every minute of over 6 weeks - $Time = $time; - $Title = $title; - $Subtitle = $subtitle; - $Desc = $desc; - } - else { - $data .= $line; - } - } - sleep($GAP); - } - SVDRPsend("c"); - Log("generated $numEvents EPG events"); -} - -sub ProcessEpg -{ - for (@Channels) { - my $channel = @$_[$idxName]; - my $channelID = @$_[$idxSource]; - Log("processing channel $channel - $channelID"); - SVDRPsend("PUTE"); - SVDRPreceive(354); - GetEpgData($channel, $channelID); - SVDRPsend("."); - SVDRPreceive(250); - } - Log("done"); -} - -#--------------------------------------------------------------------------- -# TODO: make this a Perl module??? What about Error()??? - -use Socket; - -$Timeout = 300; # max. seconds to wait for response - -$SIG{ALRM} = sub { Error("timeout"); }; -alarm($Timeout); - -$iaddr = inet_aton($Dest) || Error("no host: $Dest"); -$paddr = sockaddr_in($Port, $iaddr); - -$proto = getprotobyname('tcp'); -socket(SOCK, PF_INET, SOCK_STREAM, $proto) || Error("socket: $!"); -connect(SOCK, $paddr) || Error("connect: $!"); -select(SOCK); $| = 1; -SVDRPreceive(220); -ProcessEpg(); -SVDRPsend("QUIT"); - -sub SVDRPsend -{ - my $s = shift; - print SOCK "$s\r\n"; -} - -sub SVDRPreceive -{ - my $expect = shift | 0; - my @a = (); - while () { - s/\s*$//; # 'chomp' wouldn't work with "\r\n" - push(@a, $_); - if (substr($_, 3, 1) ne "-") { - my $code = substr($_, 0, 3); - Error("expected SVDRP code $expect, but received $code") if ($code != $expect); - last; - } - } - return @a; -} - -#--------------------------------------------------------------------------- -- cgit v1.2.3