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 {
my $dlfile;
my $dirname;
my $cookie = "";
+ my $useragent = "-H \"User-Agent: Mozilla/5.0\"";
$dlfile = sprintf($self->_getval('FILEPATTERN'),
$self->_encode($video->{'SOURCE'}),
}
$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);