Snotr: Fix video title acquisition
[videosite.git] / videosite / VimeoGrabber.pm
index ba76cff..89d3158 100644 (file)
@@ -8,7 +8,6 @@ package videosite::VimeoGrabber;
 use videosite::GrabberBase;
 @ISA = qw(videosite::GrabberBase);
 
-use LWP::UserAgent;
 use XML::Simple;
 use Digest::MD5 qw(md5_hex);
 use Data::Dumper;
@@ -41,7 +40,6 @@ sub _parse {
     my $dlpath;
     my $timestamp;
     my $hash;
-    my $ua = LWP::UserAgent->new(agent => 'Mozilla');
 
     $url =~ m|$pattern|;
     $url = $1;
@@ -54,14 +52,11 @@ sub _parse {
     $metadata->{'DLURL'} = undef;
 
     # Get the XML file containing the video metadata
-    $content = $ua->get(sprintf('http://www.vimeo.com/moogaloop/load/clip:%s', $2));
-    unless ($content->is_success()) {
+    unless(defined($content = $self->simple_get(sprintf('http://www.vimeo.com/moogaloop/load/clip:%s', $2)))) {
         $self->error('Could not download XML metadata');
         return undef;
     }
 
-    $content = $content->decoded_content();
-
     unless(defined($t = $p->XMLin($content, KeepRoot => 1))) {
         $self->error('Could not parse XML metadata');
         return undef;