From 22f4cccc663915b14612a8419e4a36a5bbcca9b7 Mon Sep 17 00:00:00 2001 From: Ralf Ertzinger Date: Sat, 29 Jan 2011 19:15:28 +0100 Subject: [PATCH] Youtube: check for meta attribute existance before usage --- videosite/YouTubeGrabber.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/videosite/YouTubeGrabber.pm b/videosite/YouTubeGrabber.pm index b3fe738..17f1d8d 100644 --- a/videosite/YouTubeGrabber.pm +++ b/videosite/YouTubeGrabber.pm @@ -120,7 +120,7 @@ sub _parse { SWF_ARGS: while ($tag = $p->get_tag('div', 'meta', 'script')) { if ('meta' eq $tag->[0]) { - if ('title' eq $tag->[1]->{'name'}) { + if (exists($tag->[1]->{'name'}) and ('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", -- 1.8.3.1