id() . '
'; $uriParams = []; $videosList = array(); $videosListURIs = array(); $search = isset($_GET['search']) ? urldecode($_GET['search']) : ""; exec("/bin/bash -c './get_astrxbian_index.sh \"*\" \"". $search . "\"'", $videos); exec("/bin/bash -c './get_PIN.sh'", $pinnedVideos); // $videos = array_unique($videos); // exec("/bin/bash -c './get_youtube_videos.sh'", $videos); // echo file_get_contents("http://youtube2.com/ipns/12D3KooWHLLohhFqwTs3Ccego51w1Q2WUQ8JmhSMWtsZnQpMigHY/.12D3KooWHLLohhFqwTs3Ccego51w1Q2WUQ8JmhSMWtsZnQpMigHY/FASTRXBIAN"); // echo shell_exec('whoami'); // Pour savoir quel utilisateur système exécute les scripts PHP // echo '
'; var_dump($videos); echo '
'; exit; $tagsMenu = array(); $narrowingTags = array(); $show = isset($_GET['show']) ? $_GET['show'] : 'pinned'; if (isset($_GET['tags']) and !empty($_GET['tags'])) { $tagFilter = explode('|', $_GET['tags']); } else { $tagFilter = array(); } foreach ($videos as $v) { if (empty($v)) { continue; } list($contentType, $videoID, $year, $filename, $saison, $tagsStr, $ipnsHash, $definition, $videoURI) = explode(";", $v); if (in_array($videoURI, $videosListURIs)) { continue; } list($videoSource, $videoID) = handleVideoID($videoID); $ipfsHash = preg_replace('!^/ipfs/([^/]+)/.*$!isU', '$1', $videoURI); $mimeType = guessTypeFromFilename($videoURI); $videoTags = getTagsListFromTagStr($tagsStr); if (canReadVideoFormat($mimeType)) { $tagsMenu = array_merge($tagsMenu, $videoTags); } $keepVideo = true; $keepVideo = ($keepVideo and canReadVideoFormat($mimeType)); $keepVideo = ($keepVideo and (in_array($ipfsHash, $pinnedVideos) or ($show != 'pinned'))); $keepVideo = ($keepVideo and (!in_array($ipfsHash, $pinnedVideos) or ($show != 'notpinned'))); $keepVideo = ($keepVideo and (empty($tagFilter) or (array_intersect($tagFilter, $videoTags) == $tagFilter))); if ($keepVideo) { $narrowingTags = array_merge($narrowingTags, $videoTags); /* ++$i; if ($i % $div != $r) { continue; } ++$j; if ($j > $maxElt) { break; } */ $duration = NULL; $thumbURL = ''; $videoTitle = NULL; if (($contentType == 'youtube') and ($videoSource == 'www.youtube.com')) { $thumbURL = sprintf(YOUTUBE_THUMB, $videoID); // $thumbURL = ''; // $json = getVideoJson($ipnsHash); if (!empty($json)) { // echo '
'; var_dump($json); echo '
'; $videoTitle = $json->title; $duration = $json->duration; } } elseif (($contentType == 'youtube') and ($videoSource == '9gag.com')) { $thumbURL = 'styles/'. THEME .'/9gag_logo.png'; } else { $thumbURL = 'styles/'. THEME .'/font-awesome/film.white.90x90.png'; } $videosListURIs[] = $videoURI; $videosList[] = [ 'duration' => $duration, 'thumbURL' => $thumbURL, 'category' => $contentType, 'mime' => $mimeType, 'tags' => $videoTags, 'ipnsHash' => $ipnsHash, 'uri' => $videoURI, 'title' => $videoTitle, 'filename' => $filename, 'videoId' => $videoID, 'videoSource' => $videoSource ]; } } $tagsMenu = array_unique($tagsMenu); $narrowingTags = empty($narrowingTags) ? $tagFilter : array_unique($narrowingTags); $home = true; include('inc/header.php'); echo ' '; // echo '
'; var_dump($videosList); echo '
'; echo ' '; include('inc/footer.php');