summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ee3cab3)
make youtube file https://www.youtube.com/watch?v=DDfRPtDsedA work
- ' was not quoted correctly: '\\'' does not work in shell, it has to be '"'"'
my $cookie = '';
my $useragent = qq{ --user-agent='Mozilla/4.0 (compatible; MSIE 5.0; Linux) Opera 5.0 [en]' };
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 (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);
$self->debug("Going to execute: %s", $cmdline);
system($cmdline);