Permalink
Browse files

Added &signature=SIG to video URL.

  • Loading branch information...
1 parent 550a828 commit d4c2653caa35aaa688cbbe34a52d010be0f24e28 @trizen committed Sep 28, 2012
@@ -42,7 +42,7 @@ use File::Spec::Functions qw(
);
my $appname = 'GTK Youtube Viewer';
-my $version = '3.0.1';
+my $version = '3.0.2';
my $execname = 'gtk-youtube-viewer';
# Developer key
@@ -107,7 +107,7 @@ require WWW::YoutubeViewer;
use File::Spec::Functions qw(catdir catfile curdir path rel2abs tmpdir);
my $appname = 'Youtube Viewer';
-my $version = '3.0.1';
+my $version = '3.0.2';
my $execname = 'youtube-viewer';
# A better <STDIN> support:
@@ -2142,7 +2142,7 @@ sub download_video {
if (not $? and not $opt{keep_original_video}) {
unlink $title
- or warn_cant_do('unlink', $title);
+ or warn colored("[!] Can't unlink file '$title': $!", 'bold red'). "\n\n";
}
}
@@ -2188,7 +2188,7 @@ sub play_videos {
? sprintf($CONFIG{mplayer_srt_args}, $streaming->{srt_file})
: q{}
),
- grep { defined and $_ ne q{} } values %MPLAYER
+ grep({ defined and $_ ne q{} } values %MPLAYER),
)
);
@@ -17,7 +17,7 @@ Version 0.01
=cut
-our $VERSION = '0.01';
+our $VERSION = '0.02';
=head1 SYNOPSIS
@@ -47,7 +47,7 @@ my %valid_options = (
# Main options
v => {valid => [], default => 2},
- page => {valid => [qr/^(?!0+\z)(\d+)\z/], default => 1},
+ page => {valid => [qr/^(?!0+\z)\d+\z/], default => 1},
results => {valid => [1 .. 50], default => 10},
hd => {valid => [qw(true)], default => undef},
caption => {valid => [qw(true false)], default => undef},
@@ -622,6 +622,12 @@ sub _get_pairs_from_info_data {
++$i;
}
+ foreach my $hash_ref(@array){
+ if(exists $hash_ref->{url} and exists $hash_ref->{sig}){
+ $hash_ref->{url} .= "&signature=$hash_ref->{sig}";
+ }
+ }
+
return @array;
}

0 comments on commit d4c2653

Please sign in to comment.