use videosite::GrabberBase;
@ISA = qw(videosite::GrabberBase);
-use LWP::UserAgent;
-use HTTP::Cookies;
use HTML::TokeParser;
use Data::Dumper;
my $self = shift;
my $url = shift;
my $pattern = shift;
- my $jar = HTTP::Cookies->new();
- my $ua = LWP::UserAgent->new('agent' => 'Mozilla/5.0');
+ my $ua = $self->ua();
my $content;
my $metadata = {};
my $p;
$metadata->{'DLURL'} = undef;
# Set the cookies necessary to get the video data
- $jar->set_cookie(undef, 'pp', '1', '/', '.redtube.com');
- $ua->cookie_jar($jar);
+ $ua->cookie_jar->set_cookie(undef, 'pp', '1', '/', '.redtube.com');
- unless(defined($r = $ua->get(sprintf("http://www.redtube.com/%s", $2)))) {
+ unless(defined($content = $self->simple_get(sprintf("http://www.redtube.com/%s", $2), $ua))) {
$self->error('Could not download page');
return undef;
}
- # Get the site to extract the title
- $content = $r->decoded_content();
-
$p = HTML::TokeParser->new(\$content);
# Look for the title