# (c) 2007 by Ralf Ertzinger <ralf@camperquake.de>
-# 2008-2009,2011 by Christian Garbs <mitch@cgarbs.de>
+# 2008-2009,2011-2012 by Christian Garbs <mitch@cgarbs.de>
# 2010 by Maximilian Rehkopf <otakon@gmx.net>
+#
# licensed under GNU GPL v2
#
# A getter which will download the media to a local file storage
my $dlfile;
my $dirname;
my $cookie = "";
+ my $useragent = "--user-agent=Mozilla/5.0";
$dlfile = sprintf($self->_getval('FILEPATTERN'),
$self->_encode($video->{'SOURCE'}),
$self->_encode($video->{'DLURL'}),
$self->_encode($video)->{'URL'});
+ $dlfile =~ s/([\\"])/\\$1/g;
+
$dirname = dirname($dlfile);
if ($self->_diskfree($dirname) < $self->_getval('MINFREE')) {
$self->error("Not enough free space to download");
}
$cookie = "--header=\"Cookie: $video->{'COOKIE'}\"" if (defined $video->{'COOKIE'});
- my $cmdline = "( wget -q -O\"$tmpfile\" $cookie \"$video->{'DLURL'}\" && mv \"$tmpfile\" \"$dlfile\" && chmod =rw \"$dlfile\" && touch \"$dlfile\" || rm -f \"$tmpfile\" ) &";
+ my $cmdline = "( wget -q -O\"$tmpfile\" $useragent $cookie \"$video->{'DLURL'}\" && mv \"$tmpfile\" \"$dlfile\" && chmod =rw \"$dlfile\" && touch \"$dlfile\" || rm -f \"$tmpfile\" ) &";
$self->debug("Going to execute: %s", $cmdline);
system($cmdline);