Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support for specifying filename for RTMP downloads.

Fixes issue 377.
  • Loading branch information...
commit 6ba5003b1d6387c932f7c6cc041db5277525ec12 1 parent e99dd1f
@zakflash zakflash authored
Showing with 7 additions and 4 deletions.
  1. +4 −1 get_flash_videos
  2. +3 −3 lib/FlashVideo/RTMPDownloader.pm
View
5 get_flash_videos
@@ -338,9 +338,12 @@ sub download {
}
my $suggested_filename = $suggested_fnames[-1];
+ if (ref($actual_url) eq 'ARRAY') {
+ $suggested_filename ||= $actual_url->{flv};
+ }
if (!$opt{play}) {
- if (!$opt{yes} && @suggested_fnames > 1) {
+ if (!$opt{yes} && !$opt{filename} && @suggested_fnames > 1) {
print "There are different suggested filenames, please choose:\n";
my $count;
foreach my $filename (@suggested_fnames) {
View
6 lib/FlashVideo/RTMPDownloader.pm
@@ -11,11 +11,11 @@ use FlashVideo::Utils;
use constant LATEST_RTMPDUMP => 2.2;
sub download {
- my ($self, $rtmp_data) = @_;
+ my ($self, $rtmp_data, $file) = @_;
- $self->{printable_filename} = $rtmp_data->{flv};
+ $self->{printable_filename} = $file;
- my $file = $rtmp_data->{flv} = $self->get_filename($rtmp_data->{flv});
+ $file = $rtmp_data->{flv} = $self->get_filename($file);
if (-s $file && !$rtmp_data->{live}) {
info "RTMP output filename '$self->{printable_filename}' already " .
Please sign in to comment.
Something went wrong with that request. Please try again.