Fix E_NOTICES on php 8.2
[playVideoOnDreamboxProxy.git] / www / play.php
index d96764d3a8b7487c2ae99c58be9865dc407fbb00..0fdb243de8ef2704f1c0e003c8741a7992da8654 100644 (file)
@@ -18,7 +18,7 @@ if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'GET') {
 
 set_error_handler('errorHandlerStore');
 
-$pageUrl  = getPageUrl();
+[$pageUrl, $dryRun] = getPageUrl();
 $json     = getYoutubeDlJson($pageUrl, $youtubedlPath);
 $videoUrl = extractVideoUrlFromJson($json);
 if (php_sapi_name() == 'cli') {
@@ -26,7 +26,9 @@ if (php_sapi_name() == 'cli') {
 } else {
     header('Video-URL: ' . $videoUrl);
 }
-playVideoOnDreambox($videoUrl, $dreamboxUrl);
+if (!$dryRun) {
+    playVideoOnDreambox($videoUrl, $dreamboxUrl);
+}
 
 
 function errorInput($msg)