Simply copy ``data/config.php.dist`` onto ``data/config.php`` and adjust it.
+If your dreambox web interface is password protected, add the username
+and password to the ``$dreamboxUrl`` configuration variable::
+
+ $dreamboxUrl = 'http://user:pass@dreambox';
+
=====
Usage
//configuration for "play video on dreambox" proxy server
// copy it to config.php and adjust it.
$youtubedlPath = '/usr/bin/youtube-dl';
-$dreamboxHost = 'dreambox';
+$dreamboxUrl = 'http://dreambox';
?>
return $url;
}
-function playVideoOnDreambox($videoUrl, $dreamboxHost)
+function playVideoOnDreambox($videoUrl, $dreamboxUrl)
{
ini_set('track_errors', 1);
- $xml = @file_get_contents('http://' . $dreamboxHost . '/web/session');
+ $xml = @file_get_contents($dreamboxUrl . '/web/session');
if ($xml === false) {
list($http, $code, $message) = explode(
' ', $http_response_header[0], 3
$sx = simplexml_load_string($xml);
$token = (string) $sx;
- $playUrl = 'http://' . $dreamboxHost
+ $playUrl = $dreamboxUrl
. '/web/mediaplayerplay'
. '?file=4097:0:1:0:0:0:0:0:0:0:'
. str_replace('%3A', '%253A', rawurlencode($videoUrl));
<?php
$youtubedlPath = '/usr/bin/youtube-dl';
-$dreamboxHost = 'dreambox';
+$dreamboxUrl = 'http://dreambox';
require_once __DIR__ . '/functions.php';
$cfgFile = __DIR__ . '/../data/config.php';
} else {
header('Video-URL: ' . $videoUrl);
}
-playVideoOnDreambox($videoUrl, $dreamboxHost);
+playVideoOnDreambox($videoUrl, $dreamboxUrl);
function errorInput($msg)