if ('meta' eq $e->[0]) {
if ('title' eq $e->[1]->{'name'}) {
$metadata->{'TITLE'} = $e->[1]->{'content'};
+ $self->debug('Title found: %s', $metadata->{'TITLE'});
}
}
}
# Look for the download URL
foreach $e (@text) {
- if ($e->[0] =~ m|/watch_fullscreen\?(.*)\&fs|) {
- $metadata->{'DLURL'} = 'http://www.youtube.com/get_video.php?' . $1;
+ if ($e->[0] =~ m|/watch_fullscreen\?(.+)\x27|) {
+ my %args = map { my @a = split(/=/); ($a[0], $a[1]) } split(/&/, $1);
+ $metadata->{'DLURL'} = sprintf('http://www.youtube.com/get_video.php?video_id=%s&t=%s',
+ $metadata->{'ID'}, $args{'t'});
+ $self->debug('URL found: %s', $metadata->{'DLURL'});
}
}