X-Git-Url: https://git.camperquake.de/gitweb.cgi?p=videosite.git;a=blobdiff_plain;f=videosite%2FFileGetter.pm;fp=videosite%2FFileGetter.pm;h=b2a0cea6c3fe686ff9fb2367f7432bc46d7b7b5d;hp=f7c680ec75ba33db36737b617745a9540a2397ea;hb=debab097d66f3bd735e837a146bc81d09e420961;hpb=9bb78db68a79470e45dd6400321e3dd96ffcb20b diff --git a/videosite/FileGetter.pm b/videosite/FileGetter.pm index f7c680e..b2a0cea 100644 --- a/videosite/FileGetter.pm +++ b/videosite/FileGetter.pm @@ -14,15 +14,16 @@ use File::Basename; sub new { my $class = shift; - my $self = $class->SUPER::new(); - - $self->{'NAME'} = 'filegetter'; - $self->{'_PARAMS'} = {'MINFREE' => ['500000', 'The amount of space that needs to be available on the filesystem before the video is downloaded (in kilobytes)'], 'FILEPATTERN', => ['/tmp/%s - %s - %s.flv', "The file name to save the file under. 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 encoded (space and / replaced by _)"]}; - - bless($self, $class); - $self->_prepare_parameters(); - - return $self; + my $self = $class->SUPER::new( + NAME => 'filegetter', + _PARAMS => { + MINFREE => ['500000', 'The amount of space that needs to be available on the filesystem before the video is downloaded (in kilobytes)'], + FILEPATTERN => ['/tmp/%s - %s - %s.flv', "The file name to save the file under. 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 encoded (space and / replaced by _)"] + }, + @_, + ); + + return bless($self, $class); } sub get {