use LWP::UserAgent;
use HTTP::Cookies;
use HTML::TokeParser;
+use HTML::Entities qw(decode_entities);
+use Encode;
use Data::Dumper;
use videosite::JSArrayParser;
$metadata->{'TITLE'} = undef;
$metadata->{'DLURL'} = undef;
+ $self->debug("Matched id %s from pattern %s", $2, $pattern);
+
$preflist = $preflist{$quality};
$self->debug("Quality: %s, preflist: [%s]", $quality, join(", ", @{$preflist}));
if ('meta' eq $tag->[0]) {
if ('title' eq $tag->[1]->{'name'}) {
$metadata->{'TITLE'} = $tag->[1]->{'content'};
+ # Convert HTML entities in the title. This is a bit convoluted.
+ $metadata->{'TITLE'} = encode("utf8",
+ decode_entities(
+ decode("utf8", $metadata->{'TITLE'})));
+
$self->debug('Title found: %s', $metadata->{'TITLE'});
}
} elsif ('script' eq $tag->[0]) {
last SWF_ARGS;
}
} elsif ('div' eq $tag->[0]) {
- if (exists($tag->[1]->{'class'}) and ('errorBox' eq $tag->[1]->{'class'})) {
+ if (exists($tag->[1]->{'class'}) and ('yt-alert-content' eq $tag->[1]->{'class'})) {
$self->error("Could not get video data for youtube %s: %s",
$metadata->{'ID'}, $p->get_trimmed_text());
return undef;