118 lines
5.2 KiB
Plaintext
118 lines
5.2 KiB
Plaintext
$OpenBSD: patch-get_iplayer,v 1.35 2010/05/26 20:24:23 sthen Exp $
|
|
--- get_iplayer.orig Wed May 26 14:19:02 2010
|
|
+++ get_iplayer Wed May 26 21:23:26 2010
|
|
@@ -327,7 +327,7 @@ mkpath $profile_dir if ! -d $profile_dir;
|
|
|
|
|
|
# get list of additional user plugins and load plugin
|
|
-my $plugin_dir_system = '/usr/share/get_iplayer/plugins';
|
|
+my $plugin_dir_system = '${TRUEPREFIX}/share/get_iplayer/plugins';
|
|
my $plugin_dir_user = "$profile_dir/plugins";
|
|
for my $plugin_dir ( ( $plugin_dir_user, $plugin_dir_system ) ) {
|
|
if ( opendir( DIR, $plugin_dir ) ) {
|
|
@@ -645,12 +645,13 @@ sub init_search {
|
|
delete $binopts->{vlc};
|
|
push @{ $binopts->{vlc} }, '-vv' if $opt->{debug};
|
|
|
|
- $bin->{id3v2} = $opt->{id3v2} || 'id3v2';
|
|
+ $bin->{id3v2} = $opt->{id3v2} || 'id3tag';
|
|
$bin->{atomicparsley} = $opt->{atomicparsley} || 'AtomicParsley';
|
|
|
|
$bin->{tee} = 'tee';
|
|
|
|
- $bin->{flvstreamer} = $opt->{flvstreamer} || 'flvstreamer';
|
|
+ $bin->{flvstreamer} = $opt->{flvstreamer} || 'rtmpdump';
|
|
+
|
|
delete $binopts->{flvstreamer};
|
|
push @{ $binopts->{flvstreamer} }, ( '--timeout', 10 );
|
|
push @{ $binopts->{flvstreamer} }, '--quiet' if $opt->{quiet};
|
|
@@ -4063,7 +4064,7 @@ sub tag_file {
|
|
my ( $id3_name, $id3_episode, $id3_desc, $id3_channel ) = ( $prog->{name}, $prog->{episode}, $prog->{desc}, $prog->{channel} );
|
|
s|"|\\"|g for ($id3_name, $id3_episode, $id3_desc, $id3_channel);
|
|
# Only tag if the required tool exists
|
|
- if ( main::exists_in_path('id3v2') ) {
|
|
+ if ( main::exists_in_path('id3tag') ) {
|
|
main::logger "INFO: id3 tagging $prog->{ext} file\n";
|
|
my @cmd = (
|
|
$bin->{id3v2},
|
|
@@ -5611,6 +5612,24 @@ sub get_stream_data_cdn {
|
|
|
|
my $count = 1;
|
|
for my $cattribs ( @{ $mattribs->{connections} } ) {
|
|
+
|
|
+ # Get authstring from more specific mediaselector if this mode is specified - fails sometimes otherwise
|
|
+ if ( $cattribs->{authString} && $cattribs->{kind} =~ /^(limelight|akamai|level3|sis|iplayertok)$/ && (grep /^$mode$/, (split /,/, $mattribs->{modelist})) ) {
|
|
+ # Build URL
|
|
+ my $media_stream_data_prefix = 'http://www.bbc.co.uk/mediaselector/4/mtis/stream/';
|
|
+ my $url = $media_stream_data_prefix."$mattribs->{verpid}/$mattribs->{service}/$cattribs->{kind}?cb=".( sprintf "%05.0f", 99999*rand(0) );
|
|
+ my $xml = main::request_url_retry( main::create_ua( 'desktop' ), $url, 3, undef, undef, 1 );
|
|
+ main::logger "\n$xml\n" if $opt->{debug};
|
|
+ # get new set of connection attributes from the new xml data
|
|
+ my $new_mattribs = (parse_metadata( $xml ))[0];
|
|
+ my $new_cattribs = $new_mattribs->{connections}[0];
|
|
+ # Override elemnts from more specific connection attribs if present
|
|
+ for my $element ( keys %{ $new_cattribs } ) {
|
|
+ $cattribs->{$element} = $new_cattribs->{$element} if $new_cattribs->{$element};
|
|
+ }
|
|
+ }
|
|
+ decode_entities($cattribs->{authString});
|
|
+
|
|
# Common attributes
|
|
# swfurl = Default iPlayer swf version
|
|
my $conn = {
|
|
@@ -5643,24 +5662,29 @@ sub get_stream_data_cdn {
|
|
$conn->{authstring} = $cattribs->{authString};
|
|
}
|
|
|
|
+ $conn->{playpath} = $cattribs->{identifier};
|
|
+ $conn->{streamurl} = "rtmp://$cattribs->{server}:1935/$cattribs->{application}?_fcs_vhost=$cattribs->{server}&undefined";
|
|
+ $conn->{application} = "$cattribs->{application}?_fcs_vhost=$cattribs->{server}&undefined";
|
|
+
|
|
if ( $cattribs->{authString} ) {
|
|
+ if ( $cattribs->{authString} !~ /&aifp=/ ) {
|
|
+ $cattribs->{authString} .= '&aifp=v001';
|
|
+ }
|
|
+
|
|
+ if ( $cattribs->{authString} !~ /&slist=/ ) {
|
|
+ $cattribs->{identifier} =~ s/^mp[34]://;
|
|
+ $cattribs->{authString} .= '&slist=&cattribs->{identifier}';
|
|
+ }
|
|
+
|
|
### ??? live and Live TV, Live EMP Video or Non-public EMP video:
|
|
- $conn->{playpath} = "$cattribs->{identifier}?$cattribs->{authString}&aifp=v001";
|
|
+ $conn->{playpath} .= "?$cattribs->{authString}";
|
|
+ $conn->{streamurl} .= "&$cattribs->{authString}";
|
|
+ $conn->{application} .= "&$cattribs->{authString}";
|
|
} else {
|
|
- $conn->{playpath} = $cattribs->{identifier};
|
|
+ $conn->{streamurl} .= "&undefined";
|
|
+ $conn->{application} .= "&undefined";
|
|
}
|
|
- if ( $cattribs->{authString} ) {
|
|
- $conn->{streamurl} = "rtmp://$cattribs->{server}:1935/$cattribs->{application}?_fcs_vhost=$cattribs->{server}&auth=$cattribs->{authString}&aifp=v001&slist=$cattribs->{identifier}";
|
|
- } else {
|
|
- $conn->{streamurl} = "rtmp://$cattribs->{server}:1935/$cattribs->{application}?_fcs_vhost=$cattribs->{server}&undefined";
|
|
- }
|
|
- # Remove offending mp3/mp4: at the start of the identifier (don't remove in stream url)
|
|
- $cattribs->{identifier} =~ s/^mp[34]://;
|
|
- if ( $cattribs->{authString} ) {
|
|
- $conn->{application} = "$cattribs->{application}?_fcs_vhost=$cattribs->{server}&$cattribs->{authString}&aifp=v001&slist=$cattribs->{identifier}";
|
|
- } else {
|
|
- $conn->{application} = "$cattribs->{application}?_fcs_vhost=$cattribs->{server}&undefined";
|
|
- }
|
|
+
|
|
# Port 1935? for live?
|
|
$conn->{tcurl} = "rtmp://$cattribs->{server}:80/$conn->{application}";
|
|
|
|
@@ -5828,6 +5852,10 @@ sub get_stream_data {
|
|
my $mode;
|
|
for my $mattribs ( @medias ) {
|
|
|
|
+ # Put verpid into mattribs
|
|
+ $mattribs->{verpid} = $verpid;
|
|
+ $mattribs->{modelist} = $prog->modelist;
|
|
+
|
|
# New iphone stream
|
|
if ( $mattribs->{service} eq 'iplayer_streaming_http_mp4' ) {
|
|
# Fix/remove some audio stream attribs
|