Youtube: check for meta attribute existance before usage
authorRalf Ertzinger <ralf@skytale.net>
Sat, 29 Jan 2011 18:15:28 +0000 (19:15 +0100)
committerRalf Ertzinger <ralf@skytale.net>
Sat, 29 Jan 2011 18:15:28 +0000 (19:15 +0100)
videosite/YouTubeGrabber.pm

index b3fe738..17f1d8d 100644 (file)
@@ -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",