- Study message before throwing it to the grabbers
[videosite.git] / videosite / GoogleGrabber.pm
index 7d9cad6..5bfc61f 100644 (file)
@@ -56,12 +56,12 @@ sub _parse {
     # Look for the title
     if ($p->get_tag('title')) {
         $metadata->{'TITLE'} = $p->get_text();
-        $metadata->{'TITLE'} =~ s/ - Google Video$//;
+        $metadata->{'TITLE'} =~ s/\s?- Google Video$//s;
     }
 
     while ($e = $p->get_tag('a')) {
-        if ((exists($a->[1]{'id'})) and ('ipoddownloadlink' eq $a->[1]{'id'})) {
-            $metadata->{'DLURL'} = $a->[1]{'href'};
+        if ((exists($e->[1]{'id'})) and ('ipoddownloadlink' eq $e->[1]{'id'})) {
+            $metadata->{'DLURL'} = $e->[1]{'href'};
             last;
         }
     }