Get_Iplayer and downloading other program versions

fs ck fsckemail at gmail.com
Sat Dec 18 12:50:59 EST 2010


On Sat, Dec 18, 2010 at 12:13 PM, Aman Singer <aman.singer at gmail.com> wrote:
>        Can anyone confirm this issue? I hope it is simply user error, but
> am doubtful, as it does seem to be looking for versions, indicating the
> command to look for the audiodescribed version is getting executed, but not
> finding them.

I can confirm this issue.

The BBC obscurely changed the way they serve up program version
meta-data at some point and this broke get_iplayer for audio described
content.

If someone with git repo commit rights can commit the attached minimal
patch I (and Aman) would be grateful.

Thanks.
-------------- next part --------------
--- get_iplayer.git-20101218	2010-12-18 17:13:15.000000000 +0000
+++ get_iplayer.latest	2010-12-18 17:48:46.000000000 +0000
@@ -4975,7 +4975,7 @@
 		$url = main::url_decode( $url );
 	# iPlayer LiveTV or PID
 	} else {
-		$url = 'http://www.bbc.co.uk/iplayer/playlist/'.$prog->{pid};
+		$url = 'http://www.bbc.co.uk/iplayer/playlist/'.$prog->{pid}.'/ad';
 	}
 	
 	main::logger "INFO: iPlayer metadata URL = $url\n" if $opt->{verbose};
@@ -5097,7 +5097,9 @@
 			# <alternate id="default" />
 			if ( m{<alternate\s+id="(.+?)"} ) {
 				my $curr_version = lc($1);
-				$version = lc($1);
+				# Remap version name from 'default' => 'audiodescribed' because we are using the /ad playlist URL:
+				$curr_version = 'audiodescribed' if $curr_version eq 'default';
+				$version = $curr_version;
 				# if current version is already defined, add a numeric suffix
 				if ( $prog->{verpids}->{$curr_version} ) {
 					my $vercount = 1;
@@ -5108,20 +5110,14 @@
 					}
 					$version = $curr_version;
 				}
-			# If this item has no version name then append $count to previous version found (a hack but I think it works)
+			# If this item has no version name then this is assumed to be the 'default' version
 			} else {
-				# determine version name and trailing count (if any)
-				$prev_version =~ m{^(.+)(\d*)$};
-				my $prev_count = $2 || 1;
-				$prev_version = $1 || 'default';
-				$prev_count++;
-				$version = $prev_version.$prev_count;
+				$version = 'default';
 			}
 			main::logger "INFO: Using Not Live standard TV and Radio: $verpid\n" if $opt->{verbose} && $verpid;
 		}
 
 		next if ! ($verpid && $version);
-		$prev_version = $version;
 		$prog->{verpids}->{$version} = $verpid;
 		$prog->{durations}->{$version} = $1 if m{duration="(\d+?)"};
 		main::logger "INFO: Version: $version, VersionPid: $verpid, Duration: $prog->{durations}->{$version}\n" if $opt->{verbose};  


More information about the get_iplayer mailing list