astrXbian_UX-et-webUI/www/boris/youtube.php

93 lines
2.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
require_once('conf.php');
require_once('functions.php');
$videosList = array();
exec("/bin/bash -c './get_astrxbian_index.sh'", $videos);
$videos = array_reverse($videos);
// ## film;MDan5TDuT-0;;Le Manuel de Survie en Dictature v1.1 au format papier;;["onelove"];k51qzi5uqu5dl0hnglpzumjezep2avacrtbx7i15v91elcxac4cpd8290kl1hq;720p;/ipfs/QmZp63RXhLm6QASmw1t2R8fu5waSJFmyW7cmdVNxyuJXzg/MDan5TDuT-0_Le%20Manuel%20de%20Survie%20en%20Dictature%20v1.1%20au%20format%20papier.mp4
foreach ($videos as $v) {
list($a, $youtubeID, $c, $videoName, $e, $src, $h, $quality, $videoURI) = explode(";", $v);
$videoURL = 'http://'. HOST. $videoURI;
$videoEco = 'http://'. HOST. '/ipns/' . $h;
$mimeType = guessTypeFromFilename($videoURI);
if ($mimeType == 'video/mp4') {
$videosList[] = [
'mime' => $mimeType,
'url' => $videoURL,
'eco' => $videoEco,
'uri' => $videoURI,
'name' => $videoName,
'youtubeID' => $youtubeID
];
}
}
?><!DOCTYPE html>
<html>
<head>
<title>Astroport/School: WWW/IPFS - Interfaces et API - </title>
<link rel="stylesheet" href="styles/astroport/style.css" type="text/css" />
<link rel="icon" type="image/png" href="./astroport.png" />
</head>
<body>
<header>
<h1>
<a href="youtube.php">Astroport "<span><?php echo STATION_NAME; ?></span>"</a>
</h1>
</header>
<main>
<?php
// echo '<pre>'; var_dump($videosList); echo '</pre>';
echo '<ul id="videosList">';
foreach ($videosList as $video) {
echo '<li>';
$href = 'youtube_watch.php?uri='. $video['uri'] . '&amp;name='. urlencode($video['name']) .'&mime='. $video['mime'];
echo '
<a href="'. $video['eco'] .'">
<img src="'. sprintf(YOUTUBE_THUMB, $video['youtubeID']) . '" alt="'. $video['name'] . '" />
</a>
<p class="video-title">
<a href="'. $href .'">
' . $video['name'] . '
</a>
</p>';
echo '</li>';
}
echo '</ul>';
?>
</main>
<footer>
<p>
<span>le code est libre</span> × <span>voyez le évoluer</span>
</p>
<p>
<span><a href="https://git.p2p.legal/axiom-team/astrXbian/src/branch/master/www/boris">~/.zen/AstXbian/www/boris</a></span> × <span><a href="/ipfs/QmbmjSBWVNSSjJsMmCeFuFtQiuWyGg6iUGLRyvK7TUkFN8">Voir le code de la page</a></span>
</p>
</footer>
</body>
</html>