fix quoting in AsyncWgetFileGetter again
[videosite.git] / videosite / MetaCafeGrabber.pm
index 5f14049..ccab7a9 100644 (file)
@@ -8,7 +8,6 @@ package videosite::MetaCafeGrabber;
 use videosite::GrabberBase;
 @ISA = qw(videosite::GrabberBase);
 
-use LWP::Simple qw(!get);
 use HTML::Parser;
 use Data::Dumper;
 
@@ -16,16 +15,13 @@ use strict;
 
 sub new {
     my $class = shift;
-    my $self = $class->SUPER::new();
+    my $self = $class->SUPER::new(
+        NAME => 'metacafe',
+        PATTERNS => ['(http://(?:[-a-zA-Z0-9_.]+\.)*metacafe.com/watch/(\d+)(?:\S+)?)'],
+        @_,
+    );
 
-    $self->{'NAME'} = 'metacafe';
-    $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*metacafe.com/watch/(\d+)(?:\S+)?)'];
-
-    bless($self, $class);
-
-    $self->_prepare_parameters();
-
-    return $self;
+    return bless($self, $class);
 }
 
 sub _parse {
@@ -49,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;
     }