Youtube: match .../watch?&v=... URLs
[videosite.git] / videosite / LiveLeakGrabber.pm
index d640e68..27f4c7f 100644 (file)
@@ -8,7 +8,6 @@ package videosite::LiveLeakGrabber;
 use videosite::GrabberBase;
 @ISA = qw(videosite::GrabberBase);
 
-use LWP::Simple qw(!get);
 use HTML::TokeParser;
 use Data::Dumper;
 
@@ -34,6 +33,7 @@ sub _parse {
     my $content;
     my $metadata = {};
     my $p;
+    my $ua = $self->ua();
 
     $url =~ m|$pattern|;
     $url = $1;
@@ -46,7 +46,7 @@ sub _parse {
     $metadata->{'DLURL'} = undef;
 
     # Get the site to extract the title
-    unless(defined($content = LWP::Simple::get($url))) {
+    unless(defined($content = $self->simple_get($url, $ua))) {
         $self->error('Could not download page');
         return undef;
     }
@@ -60,7 +60,7 @@ sub _parse {
     }
 
     # Get the file containing the video metadata
-    unless(defined($content = LWP::Simple::get(sprintf('http://www.liveleak.com/mi?token=%s', $2)))) {
+    unless(defined($content = $self->simple_get(sprintf('http://www.liveleak.com/mi?token=%s', $2), $ua))) {
         $self->error('Could not download metadata');
         return undef;
     }