From 45557538a82fa857d8bf5fa060d99f18ea6444a7 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 7 Dec 2017 22:59:18 +0100 Subject: [PATCH] Filter out chopped DASH segment streams --- www/play.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/www/play.php b/www/play.php index ce221e0..d9593a5 100644 --- a/www/play.php +++ b/www/play.php @@ -9,7 +9,11 @@ if (file_exists($cfgFile)) { $pageUrl = getPageUrl(); $videoUrl = extractVideoUrl($pageUrl, $youtubedlPath); -header('Video-URL: ' . $videoUrl); +if (php_sapi_name() == 'cli') { + echo $videoUrl . "\n"; +} else { + header('Video-URL: ' . $videoUrl); +} playVideoOnDreambox($videoUrl, $dreamboxHost); function getPageUrl() @@ -64,8 +68,12 @@ function extractVideoUrl($pageUrl, $youtubedlPath) $url = null; foreach ($data->formats as $format) { - //dreambox 7080hd does not play hls files if (strpos($format->format, 'hls') !== false) { + //dreambox 7080hd does not play hls files + continue; + } + if ($format->protocol == 'http_dash_segments') { + //split up into multiple small files continue; } $url = $format->url; @@ -127,7 +135,6 @@ function errorInput($msg) header('HTTP/1.0 400 Bad Request'); header('Content-type: text/plain'); echo $msg . "\n"; - syslog(LOG_ERR, 'playVideoOnDreamboxProxy: ' . $httpStatus . ':' . $msg); exit(1); } -- 2.30.2