Update of /cvsroot/xmltv/xmltv/grab/it
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv777/grab/it
Modified Files:
tv_grab_it.in
Log Message:
fixes to skytv
skytv now handles categories when using --slow
Index: tv_grab_it.in
===================================================================
RCS file: /cvsroot/xmltv/xmltv/grab/it/tv_grab_it.in,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** tv_grab_it.in 14 Jun 2006 20:56:14 -0000 1.45
--- tv_grab_it.in 16 Aug 2006 20:59:24 -0000 1.46
***************
*** 14,17 ****
--- 14,20 ----
# 14/06/2006
# - minor update for changes in skytv.it site (now skylife.it)
+ # 16/08/2006
+ # - fixes to skytv
+ # - skytv now handles categories when using --slow
#################################################
# TODO
***************
*** 84,88 ****
my $date_today = UnixDate("today", '%Y-%m-%d');
! my @default_backends = ('wfactory', 'skytv');
my %channels; #to store display names
--- 87,91 ----
my $date_today = UnixDate("today", '%Y-%m-%d');
! my @default_backends = ('skytv', 'wfactory');
my %channels; #to store display names
***************
*** 1030,1036 ****
$linetemp=~/(.*)\Q \E(.*)\Q \E(.*)/;
my ($category, $year, $country) = ($1, $2, $3);
! $programme->{category}=[[$category, $LANG ]] if (defined $category and $category ne '');
$programme->{date} = $year if (defined $year and $year ne '');
$programme->{country} = [[$country, $LANG]] if (defined $country and $country ne '');
# warn "|$category|$year|$country\n";
}
--- 1033,1046 ----
$linetemp=~/(.*)\Q \E(.*)\Q \E(.*)/;
my ($category, $year, $country) = ($1, $2, $3);
!
$programme->{date} = $year if (defined $year and $year ne '');
$programme->{country} = [[$country, $LANG]] if (defined $country and $country ne '');
+
+ #it looks like category is used only in movies
+ if (defined $category and $category ne '') {
+ $programme->{category}=[['Film', $LANG ]];
+ push (@{$programme->{category}}, [tidy($category), $LANG ]);
+ }
+
# warn "|$category|$year|$country\n";
}
***************
*** 1095,1110 ****
my @urls = (
! 'http://www.skytv.it/GuidaTv/LaProgrammazione/_Cinema.htm',
! 'http://www.skytv.it/GuidaTv/LaProgrammazione/_Sport.htm',
! 'http://www.skytv.it/GuidaTv/LaProgrammazione/_News.htm',
! 'http://www.skytv.it/GuidaTv/LaProgrammazione/_Mondo_e_Tendenze.htm',
! 'http://www.skytv.it/GuidaTv/LaProgrammazione/_Ragazzi_e_Musica.htm',
! 'http://www.skytv.it/GuidaTv/LaProgrammazione/_Intrattenimento.htm',
! #'http://www.skytv.it/GuidaTV/LaProgrammazione/tvGuidePopUp?temaTVGuide=1', #was: cinema
! #'http://www.skytv.it/GuidaTV/LaProgrammazione/tvGuidePopUp?temaTVGuide=2', #was: MondiCulture
! #'http://www.skytv.it/GuidaTV/LaProgrammazione/tvGuidePopUp?temaTVGuide=3', #was: intrattenimento
! #'http://www.skytv.it/GuidaTV/LaProgrammazione/tvGuidePopUp?temaTVGuide=4', #was: ragazzimusica
! #'http://www.skytv.it/GuidaTV/LaProgrammazione/tvGuidePopUp?temaTVGuide=5', #was: news
! #'http://www.skytv.it/GuidaTV/LaProgrammazione/tvGuidePopUp?temaTVGuide=6', #was: sport
);
--- 1105,1120 ----
my @urls = (
! #'http://www.skytv.it/GuidaTv/LaProgrammazione/_Cinema.htm',
! #'http://www.skytv.it/GuidaTv/LaProgrammazione/_Sport.htm',
! #'http://www.skytv.it/GuidaTv/LaProgrammazione/_News.htm',
! #'http://www.skytv.it/GuidaTv/LaProgrammazione/_Mondo_e_Tendenze.htm',
! #'http://www.skytv.it/GuidaTv/LaProgrammazione/_Ragazzi_e_Musica.htm',
! #'http://www.skytv.it/GuidaTv/LaProgrammazione/_Intrattenimento.htm',
! 'http://www.skytv.it/GuidaTV/LaProgrammazione/tvGuidePopUp?temaTVGuide=1', #was: cinema
! 'http://www.skytv.it/GuidaTV/LaProgrammazione/tvGuidePopUp?temaTVGuide=2', #was: MondiCulture
! 'http://www.skytv.it/GuidaTV/LaProgrammazione/tvGuidePopUp?temaTVGuide=3', #was: intrattenimento
! 'http://www.skytv.it/GuidaTV/LaProgrammazione/tvGuidePopUp?temaTVGuide=4', #was: ragazzimusica
! 'http://www.skytv.it/GuidaTV/LaProgrammazione/tvGuidePopUp?temaTVGuide=5', #was: news
! 'http://www.skytv.it/GuidaTV/LaProgrammazione/tvGuidePopUp?temaTVGuide=6', #was: sport
);
***************
*** 1117,1120 ****
--- 1127,1132 ----
eval { $content = get_nice($url); };
+ #warn $content;
+ #exit;
if ($@) { #get_nice has died
warn ($DEF_LANG eq 'eng' ?
***************
*** 1167,1177 ****
my $num;
for ($url) {
! /Mondo_e_Tendenze.htm/ && do{ $num = 2; last;};
! /Ragazzi_e_Musica.htm/ && do{ $num = 4; last;};
! /Intrattenimento.htm/ && do{ $num = 3; last;};
! /News.htm/ && do{ $num = 5; last;};
! /Sport.htm/ && do{ $num = 6; last;};
! /Cinema.htm/ && do{ $num = 1; last;};
! #/temaTVGuide=(.)$/ && do{ $num = $1; last;};
}
--- 1179,1189 ----
my $num;
for ($url) {
! #/Mondo_e_Tendenze.htm/ && do{ $num = 2; last;};
! #/Ragazzi_e_Musica.htm/ && do{ $num = 4; last;};
! #/Intrattenimento.htm/ && do{ $num = 3; last;};
! #/News.htm/ && do{ $num = 5; last;};
! #/Sport.htm/ && do{ $num = 6; last;};
! #/Cinema.htm/ && do{ $num = 1; last;};
! /temaTVGuide=(.)$/ && do{ $num = $1; last;};
}
***************
*** 1373,1377 ****
$programme->{length}= $1*60 if ($1 ne '');
}
!
if ($content=~/\Q<span class="event_sinossi">\E(.*?)</) {
my $desc = $1;
--- 1385,1390 ----
$programme->{length}= $1*60 if ($1 ne '');
}
!
!
if ($content=~/\Q<span class="event_sinossi">\E(.*?)</) {
my $desc = $1;
***************
*** 1406,1413 ****
#tricky one
! # if ($desc=~/^con (.*?)\. (.*)/) {
! # $cast = $1;
! # $desc = $2 || '';
! # }
if ($cast) {
--- 1419,1431 ----
#tricky one
! if ($desc=~/^con (.*?)\. (.*)/) {
! $desc = $2;
! $cast = $1;
!
! if ($cast=~/(.*?); (.*)/) {
! $cast = $1;
! $country = $2;
! }
! }
if ($cast) {
***************
*** 1418,1421 ****
--- 1436,1456 ----
}
}
+
+
+ $content=~s/[\n|\r]+//gm;
+
+ if ($content=~/\Qtd><span class="event_titolo" style="FONT-WEIGHT: bold">\E(.*?)<\Q\/span> <span class="event_titolo">\E(.*?)</) {
+ my ($category, $category2) = ($1, $2);
+
+ if ($category=~/Informazione|Intrattenimento|Ragazzi e Musica|Mondo e Tendenze/) {
+ $category = $category2;
+ undef $category2;
+ }
+
+ $programme->{category}=[[tidy($category), $LANG ]] if defined $category;
+ push (@{$programme->{category}}, [tidy($category2), $LANG ]) if defined $category2;
+ }
+
+
$programme->{length}= $length*60 if ($length);
|