xmltv/grab/fr tv_grab_fr,1.98,1.99

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

Modified Files:
	tv_grab_fr 
Log Message:
fix recognition of grab failures (server returns blank page) during --configure and --list-channels

Index: tv_grab_fr
===================================================================
RCS file: /cvsroot/xmltv/xmltv/grab/fr/tv_grab_fr,v
retrieving revision 1.98
retrieving revision 1.99
diff -C2 -d -r1.98 -r1.99
*** tv_grab_fr	1 Jul 2014 17:29:21 -0000	1.98
--- tv_grab_fr	27 Aug 2014 09:40:05 -0000	1.99
***************
*** 289,293 ****
          next if not $gtw;
          my %channels = get_channels( $gtname );
!         die 'No channels could be found' if not %channels;
          $channels_for{$gt} = \%channels;
          update $bar if not $opt_quiet;
--- 289,294 ----
          next if not $gtw;
          my %channels = get_channels( $gtname );
!         #die 'No channels could be found' if not %channels;
!         print STDERR 'WARNING: No channels could be found'."\n" if not %channels;
          $channels_for{$gt} = \%channels;
          update $bar if not $opt_quiet;
***************
*** 450,454 ****
              say  "Now getting grid : $_ \n";
              my %channels = get_channels( $gtname );
!             die 'no channels could be found' if (scalar(keys(%channels)) == 0);
              foreach my $ch_did (sort(keys %channels)) {
                  my $ch_xid = "C".$ch_did.".telepoche.com";
--- 451,456 ----
              say  "Now getting grid : $_ \n";
              my %channels = get_channels( $gtname );
!             #die 'no channels could be found' if (scalar(keys(%channels)) == 0);
!             print STDERR 'WARNING: No channels could be found'."\n" if (scalar(keys(%channels)) == 0);
              foreach my $ch_did (sort(keys %channels)) {
                  my $ch_xid = "C".$ch_did.".telepoche.com";
***************
*** 1093,1096 ****
--- 1095,1102 ----
      my $t = get_tree($url);
      debug_print("get_channels(): url = '" . $url . "'");
+ 		if (!defined $t) {
+ 		    print STDERR "Unable to retrieve channels for $bouquet \n";
+ 				return %bouquet_channels;
+ 		}
  
      foreach my $cellTree ( $t->look_down( "_tag", "td", "class", "channel" ) ) {
***************
*** 1250,1254 ****
      while ( (not defined($content = get_nice($url))) || (length($content) == 0) ) {
          ++$nbretry;
!         return undef if $nbretry == $MAX_RETRY;
          debug_print("*** Retrying URL: '" . $url 
                  . "' (attempt " . $nbretry . " of " . $MAX_RETRY . ") ***");
--- 1256,1260 ----
      while ( (not defined($content = get_nice($url))) || (length($content) == 0) ) {
          ++$nbretry;
!         return undef if $nbretry > $MAX_RETRY;
          debug_print("*** Retrying URL: '" . $url 
                  . "' (attempt " . $nbretry . " of " . $MAX_RETRY . ") ***");


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
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.