X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=videosite%2FAsyncFileGetter.pm;h=c47f9ddd97d863948c2e64f8644d903baf1e0045;hb=89e8775f8f880bd14731e4501d13a3d63fe5fcb5;hp=fa44e56823017ac490ad8703dca5f3f59dd9f632;hpb=75f5e1e4124b64bea529c545212b8c64a890f858;p=videosite.git diff --git a/videosite/AsyncFileGetter.pm b/videosite/AsyncFileGetter.pm index fa44e56..c47f9dd 100644 --- a/videosite/AsyncFileGetter.pm +++ b/videosite/AsyncFileGetter.pm @@ -20,14 +20,12 @@ use MIME::Base64; sub new { my $class = shift; - my $self = $class->SUPER::new(); + my $self = $class->SUPER::new( + NAME => 'asyncfilegetter', + @_, + ); - $self->{'NAME'} = 'asyncfilegetter'; - - bless($self, $class); - $self->_prepare_parameters(); - - return $self; + return bless($self, $class); } sub get { @@ -36,6 +34,7 @@ sub get { my $dlfile; my $dirname; my $cookie = ""; + my $useragent = "-H \"User-Agent: Mozilla/5.0\""; $dlfile = sprintf($self->_getval('FILEPATTERN'), $self->_encode($video->{'SOURCE'}), @@ -69,7 +68,7 @@ sub get { } $cookie = "-H \"Cookie: $video->{'COOKIE'}\"" if (defined $video->{'COOKIE'}); - my $cmdline = "( GET $cookie \"$video->{'DLURL'}\" > \"$tmpfile\" && mv \"$tmpfile\" \"$dlfile\" && chmod =rw \"$dlfile\" || rm -f \"$tmpfile\" ) &"; + my $cmdline = "( GET $useragent $cookie \"$video->{'DLURL'}\" > \"$tmpfile\" && mv \"$tmpfile\" \"$dlfile\" && chmod =rw \"$dlfile\" || rm -f \"$tmpfile\" ) &"; $self->debug(encode_base64($cmdline)); system($cmdline);