Show error when youtube-dl is not installed
authorChristian Weiske <cweiske@cweiske.de>
Tue, 13 Nov 2018 19:46:22 +0000 (20:46 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 13 Nov 2018 19:46:22 +0000 (20:46 +0100)
www/functions.php

index 2d4e515..43c3a77 100644 (file)
@@ -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)'