$self->error('fmt_url_map not found in PLAYER_CONFIG');
return undef;
}
+ } elsif ($e =~ m|yt\.playerConfig\s*=\s*(.+);\n|) {
+ my $args = $1;
+ $self->debug("Found yt.playerConfig: %s", $args);
+
+ $jsp = videosite::JSArrayParser->new();
+ $self->debug("Using %s to parse", ref($jsp));
+ $r = $jsp->parse($args);
+
+ unless(defined($r)) {
+ $self->error("Found information hash, but could not parse");
+ return undef;
+ }
+
+ if (exists($r->{'args'}) and exists($r->{'args'}->{'ps'}) and ($r->{'args'}->{'ps'} eq 'live')) {
+ $self->error("Video URL seems to point to a live stream, cannot save this");
+ return undef;
+ }
+
+ if (exists($r->{'args'}) and exists($r->{'args'}->{'url_encoded_fmt_stream_map'}) and ($r->{'args'}->{'url_encoded_fmt_stream_map'} ne '')) {
+ %urls = %{$self->_decode_url_encoded_fmt_stream_map($r->{'args'}->{'url_encoded_fmt_stream_map'}, 0)};
+
+ $self->debug("Pagetype: 2012 (yt.playerConfig), url_encoded_fmt_stream_map");
+ } else {
+ $self->error('url_map not found in yt.playerConfig');
+ return undef;
+ }
}
+
if (%urls) {
$self->__pick_url(\%urls, $preflist, $metadata);
last SWF_ARGS;