xmltv/grab/it test.conf, 1.7, 1.8 tv_grab_it.in, 1.104, 1.105

Geoff <[email protected]>
Newsgroups gmane.comp.tv.xmltv.cvs
Message-ID <[email protected]>
Update of /cvsroot/xmltv/xmltv/grab/it
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7875

Modified Files:
	test.conf tv_grab_it.in 
Log Message:
fix broken backend mtv.it (channel 'MTV')

Index: tv_grab_it.in
===================================================================
RCS file: /cvsroot/xmltv/xmltv/grab/it/tv_grab_it.in,v
retrieving revision 1.104
retrieving revision 1.105
diff -C2 -d -r1.104 -r1.105
*** tv_grab_it.in	10 Oct 2014 09:49:18 -0000	1.104
--- tv_grab_it.in	4 Nov 2014 12:00:56 -0000	1.105
***************
*** 218,225 ****
  
       'mtvit' =>
!      { domain => 'www.mtv.it',
!        base_chan => 'http://www.mtv.it/tv/palinsesto/index.asp',
!        base_data => 'http://www.mtv.it/tv/palinsesto/index.asp',
!        rturl => "http://www.mtv.it/tv/palinsesto/index.asp",
         needs_login => 0,
         needs_cookies => 0,
--- 218,225 ----
  
       'mtvit' =>
!      { domain => 'tv.mtv.it',
!        base_chan => 'http://tv.mtv.it/',
!        base_data => 'http://tv.mtv.it/',
!        rturl => "http://tv.mtv.it/guida-tv/",
         needs_login => 0,
         needs_cookies => 0,
***************
*** 976,980 ****
  # since this site only has one channel this is a fake sub
  sub mtvit_get_channels_list {
!     my %chan_hash = ( 'mtvit' ,'www.mtv.it');
  
      return %chan_hash;
--- 976,980 ----
  # since this site only has one channel this is a fake sub
  sub mtvit_get_channels_list {
!     my %chan_hash = ( 'MTV' ,'www.mtv.it');
  
      return %chan_hash;
***************
*** 1000,1007 ****
  
      # build url to grab
      my $grabdate      = UnixDate(&DateCalc("today","+ ".$offset." days"), '%Y:%m:%d');
      my ($anno, $mese, $giorno) = split /:/, $grabdate;
  
!     my $url = $backend_info{mtvit}{base_data}.'?canaleSel=MTV&giorno_guid='.$giorno.'%2F'.$mese.'%2F'.$anno;
  
      warn ($DEF_LANG eq 'eng' ?
--- 1000,1009 ----
  
      # build url to grab
+     # http://tv.mtv.it/guidatv.php?tvguidedate=2014-11-05
      my $grabdate      = UnixDate(&DateCalc("today","+ ".$offset." days"), '%Y:%m:%d');
      my ($anno, $mese, $giorno) = split /:/, $grabdate;
  
!     #my $url = $backend_info{mtvit}{base_data}.'?canaleSel=MTV&giorno_guid='.$giorno.'%2F'.$mese.'%2F'.$anno;
!     my $url = $backend_info{mtvit}{base_data}.'guidatv.php?tvguidedate='.$anno.'-'.$mese.'-'.$giorno;
  
      warn ($DEF_LANG eq 'eng' ?
***************
*** 1020,1025 ****
      } 
  
!     #$content=~/colonna centrale(.*)colonna destra/s; $content=$1;
!     $content=~/<ol id=\"broadcasts\">(.*)?<div id=\"rightColumn\">/s; $content=$1;
      $content=~s/[\n|\r]+//gm;
      my @programmes = ();
--- 1022,1027 ----
      } 
  
!     #$content=~/<ol id=\"broadcasts\">(.*)?<div id=\"rightColumn\">/s; $content=$1;	
!     $content=~/<ul class="video_carousel tv">(.*?)<\/ul>/s; $content=$1;	
      $content=~s/[\n|\r]+//gm;
      my @programmes = ();
***************
*** 1030,1037 ****
      #split the lines
      foreach my $line (@lines) {
! 	next unless $line=~/span class=\'time\'/;
  
! #   <span class='time'>07:00</span><h3>NEWS</h3><p>Le notizie del giorno una finestra sull'attualita' e la cronaca.</p></li>
! 	$line=~/<span class=\'time\'>(.*?)<\/span><h3>(.*?)<\/h3><p>(.*?)<\/p>/;
  
      my %programme = ();
--- 1032,1043 ----
      #split the lines
      foreach my $line (@lines) {
!       #next unless $line=~/span class=\'time\'/;
!       next unless $line=~/div class="time"/;
  
!     #   <span class='time'>07:00</span><h3>NEWS</h3><p>Le notizie del giorno una finestra sull'attualita' e la cronaca.</p></li>
!     #$line=~/<span class=\'time\'>(.*?)<\/span><h3>(.*?)<\/h3><p>(.*?)<\/p>/;
!     
!     # <div class="time">07:30</div>...<h3 class="ondemand">MTV News</h3><p>Il telegiornale di MTV con le notizie piu' importanti del giorno. #MTVNEWS</p>
!     $line=~/div class="time">(.*?)<\/div>.*?<h3.*?>(.*?)<\/h3>\s*<p>(.*?)<\/p>/;
  
      my %programme = ();
***************
*** 1040,1066 ****
      if ($title=~/<a href.*?>(.*?)<\/a/) {$title = $1;}
  
! 	# Three mandatory fields: title, start, channel.
      if (not defined $title) {
          warn 'no title found, skipping programme';
          next;
      }
!         $programme{title}=[[tidy($title), $LANG] ];
      if (not defined $time_start) {
          warn "no start time for title $title, skipping programme";
          next;
      }
- 	
- 	$programme{desc}=[[tidy($description), $LANG] ] if ($description ne '');
-         $programme{start}=xmltv_date($time_start, $offset);
  
! 	my $time_start2 = $time_start;
! 	$time_start2=~s/://;
  
! 	if ($time_start2 <700 and $time_start2>=0) {
! 	    $programme{start}=xmltv_date($time_start, $offset + 1);
! 	    }
! 	else {
! 	    $programme{start}=xmltv_date($time_start, $offset);
! 	}
  
      $programme{channel}=$xmltv_id;
--- 1046,1073 ----
      if ($title=~/<a href.*?>(.*?)<\/a/) {$title = $1;}
  
!     # Three mandatory fields: title, start, channel.
      if (not defined $title) {
          warn 'no title found, skipping programme';
          next;
      }
!     $programme{title}=[[tidy($title), $LANG] ];
      if (not defined $time_start) {
          warn "no start time for title $title, skipping programme";
          next;
      }
  
!     $programme{desc}=[[tidy($description), $LANG] ] if ($description ne '');
!     $programme{start}=xmltv_date($time_start, $offset);
  
!     my $time_start2 = $time_start;
!     $time_start2=~s/://;
! 
!     #if ($time_start2 <700 and $time_start2>=0) {
!     if ($time_start2 <730 and $time_start2>=0) {
!         $programme{start}=xmltv_date($time_start, $offset + 1);
!     }
!     else {
!         $programme{start}=xmltv_date($time_start, $offset);
!     }
  
      $programme{channel}=$xmltv_id;

Index: test.conf
===================================================================
RCS file: /cvsroot/xmltv/xmltv/grab/it/test.conf,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** test.conf	27 Aug 2014 12:49:00 -0000	1.7
--- test.conf	4 Nov 2014 12:00:56 -0000	1.8
***************
*** 3,7 ****
  channel www.raitre.rai.it # Rai 3
  channel www.raiuno.rai.it # Rai Uno
! # broken 18/Aug/14 -  channel www.mtv.it # MTV
  channel mtvmusic.guidatv.sky.it # MTV Music
  channel www.la7.it # LA7
--- 3,7 ----
  channel www.raitre.rai.it # Rai 3
  channel www.raiuno.rai.it # Rai Uno
! channel www.mtv.it # MTV
  channel mtvmusic.guidatv.sky.it # MTV Music
  channel www.la7.it # LA7


------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.