We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f65c7d9 commit eac06ffCopy full SHA for eac06ff
get_iplayer
@@ -5685,7 +5685,12 @@ sub fetch_episodes_recursive {
5685
my $dom = XML::LibXML->load_html(string => $html, recover => 1, suppress_errors => 1);
5686
if ( ! $check_series_nav ) {
5687
my @hrefs = $dom->findnodes('//*[contains(@class,"series-nav")]//a/@href');
5688
- push @urls, "https://www.bbc.co.uk".$_->findvalue('.') for @hrefs;
+ for my $href (@hrefs) {
5689
+ my $href_path = $href->findvalue('.');
5690
+ my ($sid) = $href_path =~ /seriesId=([^\&]+)/i;
5691
+ next if $sid && $sid !~ REGEX_PID;
5692
+ push @urls, "https://www.bbc.co.uk".$href_path;
5693
+ }
5694
$has_series_nav = @hrefs;
5695
$check_series_nav = 1;
5696
}
0 commit comments