Show error when youtube-dl is not installed
[playVideoOnDreamboxProxy.git] / www / functions.php
index 2d4e515e2e1c5067b499623f2c47dbafa4d96568..43c3a7771a6148cc38800303d93f0e651c12230c 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)'