X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=videosite%2FVeohGrabber.pm;h=4cac1ea99a438a6ffc374a516f6fadb9a1768882;hb=21b97d245623fe33b9e1029894045ca270a46161;hp=d54e49c9695eee7ca65049b1a9287e3bde4a58c4;hpb=045f7c72850721aed82e3c0a55c76f680d5b36f0;p=videosite.git diff --git a/videosite/VeohGrabber.pm b/videosite/VeohGrabber.pm index d54e49c..4cac1ea 100644 --- a/videosite/VeohGrabber.pm +++ b/videosite/VeohGrabber.pm @@ -8,8 +8,6 @@ package videosite::VeohGrabber; use videosite::GrabberBase; @ISA = qw(videosite::GrabberBase); -use LWP::Simple qw(!get); -use LWP::UserAgent; use XML::Simple; use Data::Dumper; @@ -35,7 +33,7 @@ sub _parse { my $content; my $metadata = {}; my $p = XML::Simple->new(); - my $ua = LWP::UserAgent->new(max_redirect => 0); + my $ua = $self->ua(); my $t; my $dlurl; my $r; @@ -51,7 +49,7 @@ sub _parse { $metadata->{'DLURL'} = undef; # Get the XML file containing the video metadata - unless(defined($content = LWP::Simple::get(sprintf('http://www.veoh.com/rest/v2/execute.xml?apiKey=5697781E-1C60-663B-FFD8-9B49D2B56D36&method=veoh.search.search&type=video&maxResults=1&permalink=%s&contentRatingId=1&', $2)))) { + unless(defined($content = $self->simple_get(sprintf('http://www.veoh.com/rest/v2/execute.xml?apiKey=5697781E-1C60-663B-FFD8-9B49D2B56D36&method=veoh.search.search&type=video&maxResults=1&permalink=%s&contentRatingId=1&', $2), $ua))) { $self->error('Could not download XML metadata'); return undef; } @@ -75,6 +73,7 @@ sub _parse { # We now have to fetch the dlurl to get the redirect target after it, # because the dlurl itself must be called with the right referer set + $ua->max_redirect(0); $r = $ua->get($dlurl, 'referer' => 'http://www.veoh.com'); unless ($r->is_redirect) {