From 89b8c37caad7b96532e77592e82ff1585991bb9a Mon Sep 17 00:00:00 2001 From: Ralf Ertzinger Date: Fri, 25 Jan 2008 21:35:40 +0100 Subject: [PATCH] - Rework download URL finder for youtube, fixing recent breakage --- videosite/YouTubeGrabber.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/videosite/YouTubeGrabber.pm b/videosite/YouTubeGrabber.pm index 2cb55c1..006ec17 100644 --- a/videosite/YouTubeGrabber.pm +++ b/videosite/YouTubeGrabber.pm @@ -73,14 +73,18 @@ sub _parse { 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'}); } } -- 1.8.3.1