git.cweiske.de
/
playVideoOnDreamboxProxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from:
d0a86fe
)
Fix E_NOTICES on php 8.2
master
github/master
author
Christian Weiske
<cweiske@cweiske.de>
Mon, 20 Nov 2023 16:04:42 +0000
(17:04 +0100)
committer
Christian Weiske
<cweiske@cweiske.de>
Mon, 20 Nov 2023 16:04:42 +0000
(17:04 +0100)
www/functions.php
patch
|
blob
|
history
diff --git
a/www/functions.php
b/www/functions.php
index 3e4e2beeeda9aa1d8c9fe76e27bc294f595d3bd0..95694e71cbd547c7a0ee9efd2882cbcb2796f9e6 100644
(file)
--- a/
www/functions.php
+++ b/
www/functions.php
@@
-39,7
+39,7
@@
function getPageUrl()
errorInput('Content type is not text/plain but ' . $_SERVER['CONTENT_TYPE']);
}
errorInput('Content type is not text/plain but ' . $_SERVER['CONTENT_TYPE']);
}
- $parts = parse_url($pageUrl);
+ $parts = parse_url($pageUrl
?? null
);
if ($parts === false) {
errorInput('Invalid URL in POST data');
} else if (!isset($parts['scheme'])) {
if ($parts === false) {
errorInput('Invalid URL in POST data');
} else if (!isset($parts['scheme'])) {
@@
-118,6
+118,10
@@
function extractVideoUrlFromJson($json)
//dreambox 7080hd does not play VP9 video streams
continue;
}
//dreambox 7080hd does not play VP9 video streams
continue;
}
+ if (strtolower(substr($format->vcodec, 0, 6)) == 'avc1.6') {
+ //dreambox DM7080 does not play H.264 High Profile
+ continue;
+ }
if ($format->protocol == 'http_dash_segments') {
//split up into multiple small files
continue;
if ($format->protocol == 'http_dash_segments') {
//split up into multiple small files
continue;
@@
-133,12
+137,15
@@
function extractVideoUrlFromJson($json)
//filter: best quality
usort($safeFormats, function ($a, $b) {
//filter: best quality
usort($safeFormats, function ($a, $b) {
+ $a->acodec = $a->acodec ?? null;
+ $b->acodec = $b->acodec ?? null;
if ((($a->acodec != 'none') + ($b->acodec != 'none')) == 1) {
return ($b->acodec != 'none') - ($a->acodec != 'none');
}
return ($b->quality ?? 0) - ($a->quality ?? 0);
});
foreach ($safeFormats as $format) {
if ((($a->acodec != 'none') + ($b->acodec != 'none')) == 1) {
return ($b->acodec != 'none') - ($a->acodec != 'none');
}
return ($b->quality ?? 0) - ($a->quality ?? 0);
});
foreach ($safeFormats as $format) {
+ //echo $format->format . ' | ' . $format->vcodec . ' | ' . $format->acodec . "\n";
$url = $format->url;
break;
}
$url = $format->url;
break;
}