fix quoting in AsyncWgetFileGetter again
[videosite.git] / videosite / MetaCafeGrabber.pm
index bc798f3..ccab7a9 100644 (file)
@@ -1,9 +1,13 @@
-package MetaCafeGrabber;
+# (c) 2007 by Ralf Ertzinger <ralf@camperquake.de>
+# licensed under GNU GPL v2
+#
+# Grabber for metacafe.com
 
-use GrabberBase;
-@ISA = qw(GrabberBase);
+package videosite::MetaCafeGrabber;
+
+use videosite::GrabberBase;
+@ISA = qw(videosite::GrabberBase);
 
-use LWP::Simple qw(!get);
 use HTML::Parser;
 use Data::Dumper;
 
@@ -11,14 +15,13 @@ use strict;
 
 sub new {
     my $class = shift;
-    my $self = $class->SUPER::new();
-
-    $self->{'NAME'} = 'metacafe';
-    $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*metacafe.com/watch/(\d+)(?:\S+)?)'];
-
-    bless($self, $class);
+    my $self = $class->SUPER::new(
+        NAME => 'metacafe',
+        PATTERNS => ['(http://(?:[-a-zA-Z0-9_.]+\.)*metacafe.com/watch/(\d+)(?:\S+)?)'],
+        @_,
+    );
 
-    return $self;
+    return bless($self, $class);
 }
 
 sub _parse {
@@ -42,7 +45,7 @@ sub _parse {
     $metadata->{'TITLE'} = undef;
     $metadata->{'DLURL'} = undef;
 
-    unless(defined($content = LWP::Simple::get(sprintf('http://www.metacafe.com/watch/%s', $2)))) {
+    unless(defined($content = $self->simple_get(sprintf('http://www.metacafe.com/watch/%s', $2)))) {
         $self->error('Could not download %s', $url);
         return undef;
     }