From b564f44c00367e294b62998876118bee02bb953c Mon Sep 17 00:00:00 2001 From: Timendum Date: Mon, 25 Jun 2018 15:44:47 +0200 Subject: [PATCH] JSON info: handle empty return string --- class/Downloader.php | 7 ++++++- info.php | 5 ----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/class/Downloader.php b/class/Downloader.php index 94623ab..8fa1e53 100644 --- a/class/Downloader.php +++ b/class/Downloader.php @@ -306,7 +306,12 @@ class Downloader $cmd .= " | python -m json.tool"; } - return shell_exec($cmd); + $soutput = shell_exec($cmd); + if (!$soutput) + { + $this->errors[] = "No video found"; + } + return $soutput; } } diff --git a/info.php b/info.php index a5dc7ff..92130e8 100644 --- a/info.php +++ b/info.php @@ -14,11 +14,6 @@ } else { - if(isset($_GET['kill']) && !empty($_GET['kill']) && $_GET['kill'] === "all") - { - Downloader::kill_them_all(); - } - $json = False; if(isset($_POST['urls']) && !empty($_POST['urls']))