7 use LWP::Simple qw(!get);
11 my $self = $class->SUPER::new();
13 $self->{'NAME'} = 'HTTPRPCGetter';
14 $self->{'_PARAMS'} = {'URL' => ['http://www.example.com/get.pl?type=%s&vid=%s&title=%s&url=%s', "The URL to call in order to trigger a download. This is a string which is passed to a sprintf call later on. The parameters passed to that sprintf call, in order, are:\n- The site the video is from\n- The ID of the video\n- The title of the video\n- The URL of the video file itself\n- The URL of the site the video was taken from\nAll parameters are hexencoded"]};
17 $self->_prepare_parameters();
27 $callurl = sprintf($self->_getval('URL'),
28 $self->_encode($video->{'TYPE'}),
29 $self->_encode($video->{'ID'}),
30 $self->_encode($video->{'TITLE'}),
31 $self->_encode($video->{'DLURL'}),
32 $self->_encode($video->{'URL'}));
34 $self->debug('Going to call %s', $callurl);
36 unless(defined(LWP::Simple::get($callurl))) {
37 $self->error("Error calling RPC");
48 $s =~ s/(.)/sprintf("%%%02x", ord($1))/ge;