From e672bc57514b6a11cd17d7fa20b2f71f3132690c Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 14 Dec 2022 22:22:32 +0100 Subject: [PATCH 1/2] Filter all H.246 high profile codecs .. instead of hard-coding the list --- www/functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/functions.php b/www/functions.php index 3e4e2be..ca64ed5 100644 --- a/www/functions.php +++ b/www/functions.php @@ -118,6 +118,10 @@ function extractVideoUrlFromJson($json) //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; @@ -139,6 +143,7 @@ function extractVideoUrlFromJson($json) return ($b->quality ?? 0) - ($a->quality ?? 0); }); foreach ($safeFormats as $format) { + //echo $format->format . ' | ' . $format->vcodec . ' | ' . $format->acodec . "\n"; $url = $format->url; break; } -- 2.30.2 From d8006352f992e60c9f19e7889c39aec1d40e9c1e Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Mon, 20 Nov 2023 17:04:42 +0100 Subject: [PATCH 2/2] Fix E_NOTICES on php 8.2 --- www/functions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/www/functions.php b/www/functions.php index ca64ed5..95694e7 100644 --- 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']); } - $parts = parse_url($pageUrl); + $parts = parse_url($pageUrl ?? null); if ($parts === false) { errorInput('Invalid URL in POST data'); } else if (!isset($parts['scheme'])) { @@ -137,6 +137,8 @@ function extractVideoUrlFromJson($json) //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'); } -- 2.30.2