CollegeHumor: Fix video URLs, and the title is in the XML now!
[videosite.git] / videosite / GrabberBase.pm
index eec5a33..b0bf480 100644 (file)
@@ -1,15 +1,17 @@
 # (c) 2007 by Ralf Ertzinger <ralf@camperquake.de>
 # licensed under GNU GPL v2
 
-package GrabberBase;
-use Base;
-@ISA = qw(Base);
+package videosite::GrabberBase;
+use videosite::Base;
+@ISA = qw(videosite::Base);
 
 use strict;
 
 sub new {
     my $class = shift;
-    my $self = {
+    my $self = $class->SUPER::new();
+
+    $self = {%{$self},
         NAME => 'FlashGrab',
         TYPE => 'grabber',
         PATTERNS => [],
@@ -28,7 +30,7 @@ sub get($$) {
         $self->debug("Matching %s against %s", $pattern, $url);
         if ($url =~ m|$pattern|) {
             $self->debug("Match");
-            return $self->_parse($url, $pattern), $pattern;
+            return wantarray?($self->_parse($url, $pattern), $pattern):$self->_parse($url, $pattern);
         }
     }