astroport-webui/youtube_watch.php

58 lines
1.2 KiB
PHP

<?php
require_once('functions.php');
require_once('conf/conf.php');
function astroport_urlencode ($str) {
$str = str_replace('%', '%25', $str);
$str = str_replace('#', '%23', $str);
return $str;
}
$videoURI = urldecode($_GET['uri']);
list($a, $ipfsPath, $videoIPFS_ID, $videoFileName) = explode('/', $videoURI);
$videoURL = 'http://'. HOST. '/' . urlencode($ipfsPath) . '/' . urlencode($videoIPFS_ID) . '/' . astroport_urlencode($videoFileName);
$videoName = htmlentities(urldecode($_GET['name']));
$videoMIME = htmlentities($_GET['mime']);
?><!DOCTYPE html>
<html>
<head>
<title>Astrobunker</title>
<link rel="stylesheet" href="styles/crowdbunker/crowdbunker.css" type="text/css" />
<link rel="icon" type="image/png" href="styles/crowdbunker/astrobunker.png" />
</head>
<body>
<header>
<h6 class="sitetitle">
<a href="youtube.php"><?php echo SITENAME; ?></a>
</h6>
<p class="usp">
<?php echo USP; ?>
</p>
</header>
<main>
<?php
echo '
<article>
<video autoplay="autoplay" controls>
<source src="'. $videoURL .'" type="'. $videoMIME .'">
</video>
<h1 class="video-title">
' . $videoName . '
</h1>
<p>
<a href="'. $videoURL . '">Télécharger</a>
</p>
</article>';
?>
</main>
</body>
</html>