git.cweiske.de
/
playVideoOnDreamboxProxy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix E_NOTICES on php 8.2
[playVideoOnDreamboxProxy.git]
/
www
/
play.php
diff --git
a/www/play.php
b/www/play.php
index 810995123a9881030249c296421364ec3b657b45..0fdb243de8ef2704f1c0e003c8741a7992da8654 100644
(file)
--- a/
www/play.php
+++ b/
www/play.php
@@
-8,9
+8,17
@@
if (file_exists($cfgFile)) {
include $cfgFile;
}
include $cfgFile;
}
+//for the firefox extension
+header('Access-Control-Allow-Origin: *');
+
+if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'GET') {
+ require __DIR__ . '/form.php';
+ exit();
+}
+
set_error_handler('errorHandlerStore');
set_error_handler('errorHandlerStore');
-
$pageUrl
= getPageUrl();
+
[$pageUrl, $dryRun]
= getPageUrl();
$json = getYoutubeDlJson($pageUrl, $youtubedlPath);
$videoUrl = extractVideoUrlFromJson($json);
if (php_sapi_name() == 'cli') {
$json = getYoutubeDlJson($pageUrl, $youtubedlPath);
$videoUrl = extractVideoUrlFromJson($json);
if (php_sapi_name() == 'cli') {
@@
-18,7
+26,9
@@
if (php_sapi_name() == 'cli') {
} else {
header('Video-URL: ' . $videoUrl);
}
} else {
header('Video-URL: ' . $videoUrl);
}
-playVideoOnDreambox($videoUrl, $dreamboxUrl);
+if (!$dryRun) {
+ playVideoOnDreambox($videoUrl, $dreamboxUrl);
+}
function errorInput($msg)
function errorInput($msg)