From 5a9b600bfd34228cfba30485572174f5fb508ff3 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 19 Oct 2017 21:04:28 +0200 Subject: [PATCH] Do not try to parse stderr data + check if we really have an URL --- www/play.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/www/play.php b/www/play.php index a9adc5b..ce221e0 100644 --- a/www/play.php +++ b/www/play.php @@ -45,7 +45,7 @@ function extractVideoUrl($pageUrl, $youtubedlPath) . ' --quiet' . ' --dump-json' . ' ' . escapeshellarg($pageUrl) - . ' 2>&1'; + . ' 2> /dev/null'; $lastLine = exec($cmd, $output, $exitCode); if ($exitCode !== 0) { @@ -75,6 +75,13 @@ function extractVideoUrl($pageUrl, $youtubedlPath) //use URL chosen by youtube-dl $url = $data->url; } + + if ($url == '') { + errorOut( + 'No video URL found', + '406 No video URL found' + ); + } return $url; } -- 2.30.2