From d94b8edc59dd508c9cb9f382a9e3d4f8bd98b9d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20S=C3=A9nica?= Date: Thu, 2 Jan 2025 22:02:15 +0000 Subject: [PATCH] Vodafone.pt Grabber - fix grabbing from previous dates and 0 pad day and month --- grab/pt_vodafone/tv_grab_pt_vodafone | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/grab/pt_vodafone/tv_grab_pt_vodafone b/grab/pt_vodafone/tv_grab_pt_vodafone index 2c623190..947abec7 100755 --- a/grab/pt_vodafone/tv_grab_pt_vodafone +++ b/grab/pt_vodafone/tv_grab_pt_vodafone @@ -106,7 +106,6 @@ use utf8; use XMLTV; use XMLTV::Version "$XMLTV::VERSION"; use DateTime; -use DateTime::Format::Strptime; use Encode; # used to convert 'perl strings' into 'utf-8 strings' use XML::LibXML; use XMLTV::Configure::Writer; @@ -278,10 +277,6 @@ sub get_epg my $channelInfo = _read_channel_data(); - # start the day before to fetch potential programmes that started the previous day - $curDate->add(days => -1); - my @daily_blocks = ("18-00"); - while ( $curDate <= $endDate ) { for my $channel (@channelList) { @@ -300,11 +295,11 @@ sub get_epg $xmlchannels{ $channelId } = \%ch ; - my $date_day = $curDate->day; - my $date_month = $curDate->month; + my $date_day = $curDate->strftime('%d'); + my $date_month = $curDate->strftime('%m'); my $date_year = $curDate->year; - for my $period (@daily_blocks) { + for my $period ("00-06","06-12","12-18","18-00") { print( STDERR "requesting EPG from " . $curDate->ymd() ." [".$period."]". " for " . $channelId . "\n" ) if( !$opt->{quiet} ); print( STDERR " GET ".$json_baseurl.$channel."/".$date_year."/".$date_month."/".$date_day."/".$period."\n" ) if( $opt->{debug} ); @@ -325,7 +320,6 @@ sub get_epg for my $programme ( @{ $data }) { my %prog; my ($dtstart, $dtend, $starts_today) = make_dates($programme->{startDate}, $programme->{endDate}, $curDate); - next PROGRAMME unless $starts_today; $prog{start} = $dtstart; $prog{stop} = $dtend; @@ -374,7 +368,6 @@ sub get_epg } $curDate->add(days => 1); - @daily_blocks = ("00-06","06-12","12-18","18-00"); } $writer->write_channel($_) for values %xmlchannels;