From 292869f170ef28b227d6f6cc06b80666cf011477 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Tue, 13 Nov 2018 20:46:22 +0100 Subject: [PATCH] Show error when youtube-dl is not installed --- www/functions.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/www/functions.php b/www/functions.php index 2d4e515..43c3a77 100644 --- a/www/functions.php +++ b/www/functions.php @@ -37,7 +37,12 @@ function getYoutubeDlJson($pageUrl, $youtubedlPath) $lastLine = exec($cmd, $output, $exitCode); if ($exitCode !== 0) { - if (strpos($lastLine, 'Unsupported URL') !== false) { + if ($exitCode === 127) { + errorOut( + 'youtube-dl not found at ' . $youtubedlPath, + '500 youtube-dl not found' + ); + } else if (strpos($lastLine, 'Unsupported URL') !== false) { errorOut( 'Unsupported URL at ' . $pageUrl, '406 Unsupported URL (No video found)' -- 2.30.2