From 256be95193598233bd2abd18d80499c476f61fbf Mon Sep 17 00:00:00 2001 From: trizen Date: Sun, 27 Sep 2020 09:56:51 +0300 Subject: quotemeta() the filename of the cookie file when passing it to `hypervideo`. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This now allows the filename to contain shell metacharacters. Signed-off-by: Jesús --- lib/WWW/FairViewer.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/WWW/FairViewer.pm') diff --git a/lib/WWW/FairViewer.pm b/lib/WWW/FairViewer.pm index 5657c4c..977e8af 100644 --- a/lib/WWW/FairViewer.pm +++ b/lib/WWW/FairViewer.pm @@ -756,12 +756,11 @@ sub _extract_from_ytdl { my $cookie_file = $self->get_cookie_file; if (defined($cookie_file) and -f $cookie_file) { - push @ytdl_cmd, '--cookies', $cookie_file; + push @ytdl_cmd, '--cookies', quotemeta($cookie_file); } my $json = $self->proxy_stdout(@ytdl_cmd, quotemeta("https://www.youtube.com/watch?v=" . $videoID)); - - my $ref = $self->parse_json_string($json); + my $ref = $self->parse_json_string($json); my @formats; if (ref($ref) eq 'HASH' and exists($ref->{formats}) and ref($ref->{formats}) eq 'ARRAY') { -- cgit v1.2.3