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/Search.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/WWW/FairViewer/Search.pm') diff --git a/lib/WWW/FairViewer/Search.pm b/lib/WWW/FairViewer/Search.pm index af6005b..6f4e8d0 100644 --- a/lib/WWW/FairViewer/Search.pm +++ b/lib/WWW/FairViewer/Search.pm @@ -167,16 +167,16 @@ sub related_to_videoID { my $viewCount = 0; - if ($info->{viewCountText}{simpleText} =~ /^([\d,]+) views/) { + if (($info->{viewCountText}{simpleText} // '') =~ /^([\d,]+) views/) { $viewCount = ($1 =~ tr/,//dr); } - elsif ($info->{viewCountText}{simpleText} =~ /Recommended for you/i) { + elsif (($info->{viewCountText}{simpleText} // '') =~ /Recommended for you/i) { next; # filter out recommended videos from related videos } my $lengthSeconds = 0; - if ($info->{lengthText}{simpleText} =~ /([\d:]+)/) { + if (($info->{lengthText}{simpleText} // '') =~ /([\d:]+)/) { my $time = $1; my @fields = split(/:/, $time); -- cgit v1.2.3