[PATCH 2/2] Update --versions help text and error message for signed-only programmes

dinkypumpkin dinkypumpkin at gmail.com
Wed Feb 29 16:12:50 EST 2012


When attempting to download signed- or audiodescribed-only programmes
without explicitly adding 'signed' or 'audiodescribed' to --versions,
get_iplayer would produce the slightly cryptic error message:

WARNING: No programmes are available for this pid

The error message has been expanded to indicate which versions are
available.  The help text for --versions has been expanded to explain
the list processions and to indicate that 'default' is the default value.
---
 get_iplayer |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/get_iplayer b/get_iplayer
index 77c13d5..089ea9c 100755
--- a/get_iplayer
+++ b/get_iplayer
@@ -157,7 +157,7 @@ my $opt_format = {
 	history		=> [ 1, "history!", 'Search', '--history', "Search/show recordings history"],
 	since		=> [ 0, "since=n", 'Search', '--since', "Limit search to programmes added to the cache in the last N hours"],
 	type		=> [ 2, "type=s", 'Search', '--type <type>', "Only search in these types of programmes: ".join(',', keys %prog_types).",all (tv is default)"],
-	versionlist	=> [ 1, "versionlist|versions|version-list=s", 'Search', '--versions <versions>', "Version of programme to search or record (e.g. '--versions signed,audiodescribed,default')"],
+	versionlist	=> [ 1, "versionlist|versions|version-list=s", 'Search', '--versions <versions>', "Version of programme to search or record.  List is processed from left to right and first version found is downloaded.  Example: '--versions signed,audiodescribed,default' will prefer signed and audiodescribed programmes if available.  Default: 'default'"],
 
 	# Output
 	command		=> [ 1, "c|command=s", 'Output', '--command, -c <command>', "Run user command after successful recording using args such as <pid>, <name> etc"],
@@ -5019,7 +5019,7 @@ sub get_verpids {
 
 	# Detect noItems or no programmes
 	if ( $xml =~ m{<noItems\s+reason="noMedia"} || $xml !~ m{kind="(programme|radioProgramme)"} ) {
-		main::logger "\rWARNING: No programmes are available for this pid\n";
+		main::logger "\rWARNING: No programmes are available for this pid with version(s): ".($opt->{versionlist} ? $opt->{versionlist} : 'default').($prog->{versions} ? " ($prog->{versions} are available)\n" : "\n");
 		return 1;
 	}
 
-- 
1.7.5.4




More information about the get_iplayer mailing list