Skip to content
Browse files

'web' lists package dependencies now; 'gfv' updated

  • Loading branch information...
1 parent be666fa commit fbbbd3707eadfbbb41b75a3560342ea6327a4114 @epitron committed Aug 5, 2012
Showing with 25 additions and 11 deletions.
  1. +4 −3 get-flash-videos
  2. +18 −5 lib/FlashVideo/Site/Brightcove.pm
  3. +3 −3 web
View
7 get-flash-videos
@@ -129,9 +129,10 @@ check that the URL really works(!).
Check for updates by running: $0 --update
-If the latest version does not support this please open a bug (or
-contribute a patch!) at http://code.google.com/p/get-flash-videos/
-make sure you include the output with --debug enabled.
+If the latest version does not support this please open a bug
+at http://code.google.com/p/get-flash-videos/ making sure you include
+the output with --debug enabled. Alternatively, fix it yourself and send us
+a pull request on Github: https://github.com/monsieurvideo/get-flash-videos
EOF
read_conf();
View
23 lib/FlashVideo/Site/Brightcove.pm
@@ -125,10 +125,23 @@ EOF
for my $d (@found) {
next if $metadata->{videoId} && $d->{id} != $metadata->{videoId};
- my $host = ($d->{FLVFullLengthURL} =~ m!rtmp://(.*?)/!)[0];
- my $file = ($d->{FLVFullLengthURL} =~ m!&([a-z0-9:]+/.*?)(?:&|$)!)[0];
- my $app = ($d->{FLVFullLengthURL} =~ m!//.*?/(.*?)/&!)[0];
- my $filename = ($d->{FLVFullLengthURL} =~ m!&.*?/([^/&]+)(?:&|$)!)[0];
+ # There might be different versions (aka "renditions") of this video -
+ # if so, choose the highest quality.
+ #
+ # TODO: support quality settings
+ my $rtmp_url = $d->{FLVFullLengthURL};
+
+ if ($d->{renditions} and ref($d->{renditions}) eq 'ARRAY') {
+ my @renditions = sort { $a->{encodingRate} <=> $b->{encodingRate} }
+ @{ $d->{renditions} };
+
+ $rtmp_url = $renditions[-1]->{defaultURL};
+ }
+
+ my $host = ($rtmp_url =~ m!rtmp://(.*?)/!)[0];
+ my $file = ($rtmp_url =~ m!&([a-z0-9:]+/.*?)(?:&|$)!)[0];
+ my $app = ($rtmp_url =~ m!//.*?/(.*?)/&!)[0];
+ my $filename = ($rtmp_url =~ m!&.*?/([^/&]+)(?:&|$)!)[0];
$app .= "?videoId=$d->{id}&lineUpId=$d->{lineupId}&pubId=$d->{publisherId}&playerId=$player_id&playerTag=&affiliateId=";
@@ -137,7 +150,7 @@ EOF
pageUrl => $page_url,
swfUrl => "http://admin.brightcove.com/viewer/federated/f_012.swf?bn=590&pubId=$d->{publisherId}",
tcUrl => "rtmp://$host:1935/$app",
- auth => ($d->{FLVFullLengthURL} =~ /^[^&]+&(.*)$/)[0],
+ auth => ($rtmp_url =~ /^[^&]+&(.*)$/)[0],
rtmp => "rtmp://$host/$app",
playpath => $file,
flv => "$filename.flv",
View
6 web
@@ -6,9 +6,9 @@ require 'epitools/path'
## Check for required binaries in the path
missing = false
-%w[wmctrl xse xclip].each do |requirement|
- unless Path.which(requirement)
- puts "* '#{requirement}' not found in path; please install."
+{"wmctrl"=>"wmctrl", "xse" => "xsendevents", "xclip" => "xclip"}.each do |bin, package|
+ unless Path.which(bin)
+ puts "* '#{bin}' not found in path; please install the '#{package}' package."
missing = true
end
end

0 comments on commit fbbbd37

Please sign in to comment.
Something went wrong with that request. Please try again.