git://git.camperquake.de
/
videosite.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c644add
)
Youtube: Add new signature to download URLs
author
Ralf Ertzinger
<ralf@skytale.net>
Fri, 28 Sep 2012 14:43:07 +0000
(16:43 +0200)
committer
Ralf Ertzinger
<ralf@skytale.net>
Fri, 28 Sep 2012 14:43:07 +0000
(16:43 +0200)
videosite/YouTubeGrabber.pm
patch
|
blob
|
history
diff --git
a/videosite/YouTubeGrabber.pm
b/videosite/YouTubeGrabber.pm
index
14f1032
..
e611a1f
100644
(file)
--- a/
videosite/YouTubeGrabber.pm
+++ b/
videosite/YouTubeGrabber.pm
@@
-449,6
+449,7
@@
sub _decode_url_encoded_fmt_stream_map {
my $data = shift;
my $dataencoded = shift;
my @data;
my $data = shift;
my $dataencoded = shift;
my @data;
+ my $h = {};
$data = $self->decode_hexurl($data) if $dataencoded;
# This will
$data = $self->decode_hexurl($data) if $dataencoded;
# This will
@@
-464,7
+465,16
@@
sub _decode_url_encoded_fmt_stream_map {
# From each array entry, pick the itag and the url values and return that
# as a hash reference
# From each array entry, pick the itag and the url values and return that
# as a hash reference
- return { map { $_->{'itag'}, $_->{'url'} } @data };
+
+ foreach (@data) {
+ if (exists($_->{'sig'})) {
+ $h->{$_->{'itag'}} = sprintf('%s&signature=%s', $_->{'url'}, $_->{'sig'});
+ } else {
+ $h->{$_->{'itag'}} = $_->{'url'};
+ }
+ }
+
+ return $h;
}
}