Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tv_grab_fr so it works again #247

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions grab/fr/tv_grab_fr
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,24 @@ use IO::Scalar;
my $GRABBER_NAME = 'tv_grab_fr';
my $GRABBER_VERSION = "$XMLTV::VERSION";

my $ROOT_URL = "https://www.telestar.fr";
my $ROOT_URL = "https://www.telepoche.fr";
my $GRID_FOR_CHANNEL = "$ROOT_URL/programme-tv/";
my $GRID_FOR_BOUQUET = "$ROOT_URL/programme-tv/bouquets/";
my $GRID_BY_CHANNEL_PER_DAY = "$ROOT_URL/programme-tv/grille-chaine/";

my $ENCODING = "utf-8";
my $LANG = "fr";
my $MAX_RETRY = 5;

my %tv_attributes = (
'source-info-name' => 'Tele Star',
'source-info-url' => 'telestar.tv',
'source-info-name' => 'Tele Poche',
'source-info-url' => 'telepoche.tv',
'source-data-url' => "$GRID_FOR_CHANNEL",
'generator-info-name' => "XMLTV/$XMLTV::VERSION, $GRABBER_NAME",
);

my ( $opt, $conf ) = ParseOptions( {
grabber_name => "$GRABBER_NAME",
version => "$GRABBER_VERSION",
description => "France (Tele Star)",
description => "France (Tele Poche)",
capabilities => [qw/baseline manualconfig cache apiconfig/],
defaults => { days => 14, offset => 0, quiet => 0, debug => 0, slow => 0 },
extra_options => [qw/slow/],
Expand Down Expand Up @@ -786,9 +784,14 @@ sub update_programme_stop_times {
debug_print(" There is a small gap of $gap minutes between '$p0_title' and '$p1_title'");
$p0->{stop} = $p1->{start};
}
else {
# Otherwise, use the current programme's duration
debug_print(" There is a large gap of $gap minutes between '$p0_title' and '$p1_title'");
elsif ($p1_start->hour < 2 || $p0_stop->hour > 6) {
# Assume there should be no gap during 'daytime'
debug_print(" Ignoring a large daytime gap of $gap minutes between '$p0_title' and '$p1_title'");
$p0->{stop} = get_xmltv_time_from_datetime($p1_start);
} else {
# But in the middle of the night there may be no programme
# so use the current programme's duration
debug_print(" There is a large gap of $gap minutes at night between '$p0_title' and '$p1_title'");
$p0->{stop} = get_xmltv_time_from_datetime($p0_stop);
}
}
Expand Down Expand Up @@ -956,7 +959,7 @@ __END__

=head1 NAME

tv_grab_fr - Grab TV listings for France (Télé Star).
tv_grab_fr - Grab TV listings for France (Télé Poche).

=head1 SYNOPSIS

Expand Down Expand Up @@ -984,7 +987,10 @@ tv_grab_fr - Grab TV listings for France (Télé Star).

Output TV listings for many channels available in France (Orange,
Free, cable/ADSL/satellite, Canal+ Sat). The data comes from
Télé Star (telestar.fr). The default is to grab 14 days.
Télé Poche (telepoche.fr). The default is to grab 14 days.

Note that this source usually does not have data for night programmes (between
midnight and 5 am).

B<--configure> Choose which bouquet/channels to grab listings data for.

Expand Down Expand Up @@ -1028,7 +1034,7 @@ L<xmltv(5)>
=head1 AUTHOR

The current tv_grab_fr script was rewritten by Nick Morrott,
knowledgejunkie at gmail dot com, to support the new telestar.fr site.
knowledgejunkie at gmail dot com, to support the new telepoche.fr site.

=cut

Loading