X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=videosite%2FYahooGrabber.pm;h=fc880438ffaf0253ad564f88cd68b0e61267adc5;hb=1cfec45c0c1cac8fdebca4313c3bcfb3a9f1ab07;hp=ee911099d47e351d6f676bb9b557bd731f8fcf30;hpb=74d40b19f656fb5731cbf258321dbc3c19c48a03;p=videosite.git diff --git a/videosite/YahooGrabber.pm b/videosite/YahooGrabber.pm index ee91109..fc88043 100644 --- a/videosite/YahooGrabber.pm +++ b/videosite/YahooGrabber.pm @@ -3,12 +3,11 @@ # # Grabber for video.yahoo.com -package YahooGrabber; +package videosite::YahooGrabber; -use GrabberBase; -@ISA = qw(GrabberBase); +use videosite::GrabberBase; +@ISA = qw(videosite::GrabberBase); -use LWP::Simple qw(!get); use XML::Simple; use HTML::Parser; use Data::Dumper; @@ -37,6 +36,7 @@ sub _parse { my $p = XML::Simple->new(); my $t; my @accum; + my $ua = $self->ua(); $url =~ m|$pattern|; $url = $1; @@ -49,7 +49,7 @@ sub _parse { $metadata->{'DLURL'} = undef; # Get the XML file containing the video metadata - unless(defined($content = LWP::Simple::get(sprintf('http://cosmos.bcst.yahoo.com/up/yep/process/getPlaylistFOP.php?node_id=%s', $2)))) { + unless(defined($content = $self->simple_get(sprintf('http://cosmos.bcst.yahoo.com/up/yep/process/getPlaylistFOP.php?node_id=%s', $2), $ua))) { $self->error('Could not download XML metadata'); return undef; } @@ -68,7 +68,7 @@ sub _parse { # The XML does not contain the title of the video, for # reasons possibly known to some jerk at yahoo. # So we'll have to parse the actual HTML, too. - unless(defined($content = LWP::Simple::get($url))) { + unless(defined($content = $self->simple_get($url, $ua))) { $self->error('Could not download HTML'); return undef; }