Patch to tag all BBC HD programs as category HD

fs ck fsckemail at gmail.com
Fri Dec 10 08:15:21 EST 2010


I found that many of the programs in the channel 'BBC HD' were also on
other channels. Subsequently a search using --channel=hd only showed a
subset of HD programs.

This patch works around this by adding 'HD' to the category list for
all programs that are on 'BBC HD' channel regardless of what
get_iplayer stores as the channel.

--- get_iplayer.orig	2010-12-10 12:31:01.000000000 +0000
+++ get_iplayer_with_hd_cat_only	2010-12-10 13:11:23.848851317 +0000
@@ -6470,10 +6470,11 @@
 	# Download index feed
 	# Sort feeds so that category based feeds are done last - this makes
sure that the channels get defined correctly if there are dups
 	my @channel_list;
-	push @channel_list, grep !/(categor|popular|highlights)/, keys %channels;
+	push @channel_list, grep !/(categor|popular|highlights|bbchd)/, keys
%channels;
 	push @channel_list, grep  /categor/, keys %channels;
 	push @channel_list, grep  /popular/, keys %channels;
 	push @channel_list, grep  /highlights/, keys %channels;
+	push @channel_list, grep  /bbchd/, keys %channels;
 	for ( @channel_list ) {

 		my $url = "${channel_feed_url}/$_/list/limit/400";
@@ -6634,6 +6635,7 @@
 				$cats{$_} = 1 for ( @category, split /,/, $prog->{$pid}->{categories} );
 				$cats{Popular} = 1 if $channel eq 'Popular';
 				$cats{Highlights} = 1 if $channel eq 'Highlights';
+				$cats{HD} = 1 if $channel eq 'BBC HD';
 				$prog->{$pid}->{categories} = join(',', sort keys %cats);

 				# If this is a dupicate pid and the channel is now Signed then
both versions are available



More information about the get_iplayer mailing list