From cc69ec1d9eb2ecf207b4c6b50a02062175e14314 Mon Sep 17 00:00:00 2001 From: Christian Garbs Date: Wed, 18 Nov 2015 00:20:22 +0100 Subject: [PATCH] fix quoting in AsyncWgetFileGetter again make youtube file https://www.youtube.com/watch?v=DDfRPtDsedA work - ' was not quoted correctly: '\\'' does not work in shell, it has to be '"'"' --- videosite/AsyncWgetFileGetter.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/videosite/AsyncWgetFileGetter.pm b/videosite/AsyncWgetFileGetter.pm index 0cc6856..756b416 100644 --- a/videosite/AsyncWgetFileGetter.pm +++ b/videosite/AsyncWgetFileGetter.pm @@ -66,14 +66,14 @@ sub _download { my $cookie = ''; my $useragent = qq{ --user-agent='Mozilla/4.0 (compatible; MSIE 5.0; Linux) Opera 5.0 [en]' }; - $dlfile =~ s/([\\'])/\\$1/g; # ??? - + $dlfile =~ s/'/'"'"'/g; # escape ' as '"'"' (end current 'string', new "string" containing a ', start new 'string') + my (undef, $tmpfile) = tempfile('videosite.tmp.XXXXXXXXXXXX', DIR => dirname($dlfile)); $self->debug('Going to download %s to %s (%s)', $dlurl, $dlfile, $tmpfile); $cookie = qq{ --header='Cookie: $video->{'COOKIE'}'} if (defined $video->{'COOKIE'}); - my $cmdline = qq{ ( wget -q -O'$tmpfile' $useragent $cookie '$video->{'DLURL'}' && mv '$tmpfile' '$dlfile' && chmod =rw '$dlfile' && touch '$dlfile' || rm -f '$tmpfile' ) & }; + my $cmdline = qq{ ( wget -q -O'$tmpfile' $useragent $cookie '$dlurl' && mv '$tmpfile' '$dlfile' && chmod =rw '$dlfile' && touch '$dlfile' || rm -f '$tmpfile' ) & }; $self->debug("Going to execute: %s", $cmdline); system($cmdline); -- 1.8.3.1