On 17/07/2011 21:57, Sam Kuper wrote:
ERROR: Failed to record 'Thermal imagery in the desert - -
(http://www.bbc.co.uk/learningzone/clips/thermal-imagery-in-the-desert/3204.html)'
...
> Clearly this didn't work, despite my having provided a long set of
fallback modes. I'm unsure how to proceed, and would welcome
constructive suggestions!


FWIW, I was able to download this clip with a very small patch to get_iplayer. AFAICT, the access token for this clip is ultimately returned with "auth=" already prepended, which get_iplayer doesn't expect and thus duplicates, giving a bogus query string for the rtmp URL. This appears to be peculiar to Akamai CDN connections, but not necessarily all of them. As Nigel Taylor pointed out earlier, this isn't related to iPlayer content per se, but a workaround seemed benign enough that I could roll it into my get_iplayer fork. Hope I don't eat those words.

Patch is attached. Info on my fork here:

https://github.com/dinkypumpkin/get_iplayer/wiki/instructions


>From 689f1382309dc75fefe86393711fae5059ae603c Mon Sep 17 00:00:00 2001
From: dinkypumpkin <dinkypump...@gmail.com>
Date: Mon, 18 Jul 2011 18:50:00 +0100
Subject: [PATCH] Handle embedded param name in Akamai auth token
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------1.7.6"

This is a multi-part message in MIME format.
--------------1.7.6
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit


For at least some embedded content (example below), the Akamai
auth token is returned with "auth=" already prepended, which
get_iplayer doesn't expect and thus duplicates.  The changes in
this commit will handle auth tokens with or without the param
name prepended.

Example:
http://www.bbc.co.uk/learningzone/clips/thermal-imagery-in-the-desert/3204.html
---
 get_iplayer |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)


--------------1.7.6
Content-Type: text/x-patch; 
name="0014-Handle-embedded-param-name-in-Akamai-auth-token.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; 
filename="0014-Handle-embedded-param-name-in-Akamai-auth-token.patch"

diff --git a/get_iplayer b/get_iplayer
index d0cd7da..daf47e4 100755
--- a/get_iplayer
+++ b/get_iplayer
@@ -5810,7 +5810,10 @@ sub get_stream_data_cdn {
                                my $url = 
${media_stream_live_prefix}."?server=$cattribs->{server}&identifier=$cattribs->{identifier}&kind=$cattribs->{kind}&application=$cattribs->{application}";
                                my $xml = main::request_url_retry( 
main::create_ua( 'desktop' ), $url, 3, undef, undef, 1 );
                                main::logger "\n$xml\n" if $opt->{debug};
-                               $cattribs->{authString} = 'auth='.$1 if $xml =~ 
m{<token>(.+?)</token>};
+                               $cattribs->{authString} = 'auth='.$1 if $xml =~ 
m{<token>auth=(.+?)</token>};
+                               if ( ! $cattribs->{authString} ) {
+                                       $cattribs->{authString} = 'auth='.$1 if 
$xml =~ m{<token>(.+?)</token>};
+                               }
                                $conn->{authstring} = $cattribs->{authString};
                        }
 

--------------1.7.6--


_______________________________________________
get_iplayer mailing list
get_iplayer@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/get_iplayer

Reply via email to