$lastLine = exec($cmd, $output, $exitCode);
if ($exitCode !== 0) {
if (strpos($lastLine, 'Unsupported URL') !== false) {
- errorOut('Unsupported URL', '400 Unsupported URL (No video found)');
+ errorOut(
+ 'Unsupported URL at ' . $pageUrl,
+ '406 Unsupported URL (No video found)'
+ );
} else {
errorOut('youtube-dl error: ' . $lastLine);
}
function playVideoOnDreambox($videoUrl, $dreamboxHost)
{
ini_set('track_errors', 1);
- $xml = file_get_contents('http://' . $dreamboxHost . '/web/session');
+ $xml = @file_get_contents('http://' . $dreamboxHost . '/web/session');
if ($xml === false) {
errorOut('Failed to fetch dreambox session token: ' . $php_errormsg);
}
header('HTTP/1.0 400 Bad Request');
header('Content-type: text/plain');
echo $msg . "\n";
+ syslog(LOG_ERR, 'playVideoOnDreamboxProxy: ' . $httpStatus . ':' . $msg);
exit(1);
}
header('HTTP/1.0 ' . $httpStatus);
header('Content-type: text/plain');
echo $msg . "\n";
+ syslog(LOG_ERR, 'playVideoOnDreamboxProxy: ' . $httpStatus . ': ' . $msg);
exit(2);
}
?>
\ No newline at end of file