use videosite::GrabberBase;
@ISA = qw(videosite::GrabberBase);
-use LWP::Simple qw(!get);
-use LWP::UserAgent;
use XML::Simple;
use Data::Dumper;
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;
$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;
}
# 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) {