X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=videosite%2FHTTPRPCGetter.pm;h=e82e21826e57f0031714a49353553d13488d5229;hb=HEAD;hp=007fd6cc2b6ffe40008ddf50191d8c0c65537216;hpb=d738e03f4f2d70a41eba8b77177826d1ff62f42b;p=videosite.git diff --git a/videosite/HTTPRPCGetter.pm b/videosite/HTTPRPCGetter.pm index 007fd6c..e82e218 100644 --- a/videosite/HTTPRPCGetter.pm +++ b/videosite/HTTPRPCGetter.pm @@ -1,22 +1,28 @@ -package HTTPRPCGetter; +# (c) 2007 by Ralf Ertzinger +# licensed under GNU GPL v2 +# +# A getter which calls a remote URL in order to trigger a +# download. -use GetterBase; -@ISA = qw(GetterBase); +package videosite::HTTPRPCGetter; + +use videosite::GetterBase; +@ISA = qw(videosite::GetterBase); use strict; use LWP::Simple qw(!get); sub new { my $class = shift; - my $self = $class->SUPER::new(); - - $self->{'NAME'} = 'HTTPRPCGetter'; - $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"]}; - - bless($self, $class); - $self->_prepare_parameters(); - - return $self; + my $self = $class->SUPER::new( + NAME => 'HTTPRPCGetter', + _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"] + }, + @_, + ); + + return bless($self, $class); } sub get { @@ -25,7 +31,7 @@ sub get { my $callurl; $callurl = sprintf($self->_getval('URL'), - $self->_encode($video->{'TYPE'}), + $self->_encode($video->{'SOURCE'}), $self->_encode($video->{'ID'}), $self->_encode($video->{'TITLE'}), $self->_encode($video->{'DLURL'}),