$urls = $self->decode_hexurl($urls);
%urls = split(/[\|,]/, $urls);
$self->debug("Pagetype: 2010 (swfHTML), fmt_url_map");
- } elsif ($e =~ m|\x27PLAYER_CONFIG\x27:\s+(.+)\}\);|) {
+ } elsif ($e =~ m|\x27PLAYER_CONFIG\x27:\s+(.+)(?:\}\);)?|) {
my $args = $1;
$self->debug("Found PLAYER_CONFIG: %s", $args);
$urls{$_} = $self->decode_hexurl($urls{$_});
}
$self->debug("Pagetype: 2011 (PLAYER_CONFIG), fmt_url_map");
+ } elsif (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: 2011 (PLAYER_CONFIG), url_encoded_fmt_stream_map");
} else {
$self->error('fmt_url_map not found in PLAYER_CONFIG');
return undef;
# matching video IDs to download URLs
sub _decode_url_encoded_fmt_stream_map {
my $self = shift;
- my $data = $self->decode_hexurl(shift);
+ my $data = shift;
+ my $dataencoded = shift;
my @data;
+ $data = $self->decode_hexurl($data) if (defined($dataencoded) && $dataencoded);
# This will
# - Split the decoded string into segments (along ,)
# - Interpret each segment as a concatenated key-value list (key and value separated by =, pairs separated by &