whoami7 - Manager
:
/
home
/
bleuhbh
/
www
/
root
/
public
/
newRadio
/
Upload File:
files >> /home/bleuhbh/www/root/public/newRadio/webradioIndivudiualArchive.php
<?php // $musicDir = "../../../Musique Louis"; // $files = scandir($musicDir); // $audioFiles = array_values(array_filter($files, function($file) { // return preg_match('/\.(mp3|wav|flac)$/i', $file); // })); // // Pick a random file // $fileCount = count($audioFiles); // $a = rand(0, $fileCount - 1); // $randomFile = $musicDir . '/' . $audioFiles[$a]; // // Get duration using ffprobe // $ffprobePath = '../../admin/php/ffmpeg/bin/ffprobe'; // $cmdDuration = sprintf( // '%s -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 %s', // escapeshellcmd($ffprobePath), // escapeshellarg($randomFile) // ); // $test = shell_exec($cmdDuration); // $duration = trim(shell_exec($cmdDuration)); // $duration = is_numeric($duration) ? ceil($duration) : 10; // // Output headers // header('Content-Type: audio/mp3'); // header('Content-Disposition: inline; filename="stream.mp3"'); // header('Cache-Control: no-cache, no-store, must-revalidate'); // header('Pragma: no-cache'); // header('Expires: 0'); // header("Refresh: $duration"); // // Log file setup // $logFile = "./" . date('Y_m_d_H_i_s_') . "streamNewStar.log"; // $userAgent = $_SERVER['HTTP_USER_AGENT']; // function logMessage($message) { // global $logFile; // global $userAgent; // $timestamp = date('Y-m-d H:i:s'); // file_put_contents($logFile, "[$timestamp] $userAgent $message\n", FILE_APPEND); // } // logMessage("Streaming: " . basename($randomFile) . " (duration: $duration seconds)"); // // Stream the audio file as MP3 // $ffmpegPath = '../../admin/php/ffmpeg/bin/ffmpeg'; // $command = sprintf( // '%s -i %s -f mp3 -', // escapeshellcmd($ffmpegPath), // escapeshellarg($randomFile) // ); // passthru($command); // // $musicDir = "../../../Musique Louis"; // $firstTrack = "$musicDir/your_intro_song.mp3"; // <-- Replace with actual intro file // $files = scandir($musicDir); // $audioFiles = array_values(array_filter($files, function($file) use ($firstTrack) { // return preg_match('/\.(mp3|wav|flac)$/i', $file) && $file !== basename($firstTrack); // })); // $isFirstConnection = !isset($_GET['refreshed']) || $_GET['refreshed'] != '1'; // if ($isFirstConnection) { // $fileCount = count($audioFiles); // $a = rand(0, $fileCount - 1); // $randomFile = $musicDir . '/' . $audioFiles[$a]; // // Get duration using ffprobe // $ffprobePath = '../../admin/php/ffmpeg/bin/ffprobe'; // $cmdDuration = sprintf( // '%s -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 %s', // escapeshellcmd($ffprobePath), // escapeshellarg($randomFile) // ); // $duration = trim(shell_exec($cmdDuration)); // $duration = is_numeric($duration) ? ceil($duration) : 10; // // Prepare refresh header with query param // $currentUrl = $_SERVER['PHP_SELF']; // header("Refresh: $duration; url=$currentUrl?refreshed=1"); // // Output headers // header('Content-Type: audio/mp3'); // header('Content-Disposition: inline; filename="stream.mp3"'); // header('Cache-Control: no-cache, no-store, must-revalidate'); // header('Pragma: no-cache'); // header('Expires: 0'); // // Log file setup // $logFile = "./" . date('Y_m_d_H_i_s_') . "streamNewStar.log"; // $userAgent = $_SERVER['HTTP_USER_AGENT']; // function logMessage($message) { // global $logFile, $userAgent; // $timestamp = date('Y-m-d H:i:s'); // file_put_contents($logFile, "[$timestamp] $userAgent $message\n", FILE_APPEND); // } // logMessage("Streaming: " . basename($randomFile) . " (duration: $duration seconds)"); // // Stream the audio file as MP3 // $ffmpegPath = '../../admin/php/ffmpeg/bin/ffmpeg'; // $command = sprintf( // '%s -i %s -f mp3 -', // escapeshellcmd($ffmpegPath), // escapeshellarg($randomFile) // ); // passthru($command); // } else { // $fileCount = count($audioFiles); // $a = rand(0, $fileCount - 1); // $randomFile = $musicDir . '/' . $audioFiles[$a]; // // Get duration using ffprobe // $ffprobePath = '../../admin/php/ffmpeg/bin/ffprobe'; // $cmdDuration = sprintf( // '%s -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 %s', // escapeshellcmd($ffprobePath), // escapeshellarg($randomFile) // ); // $duration = trim(shell_exec($cmdDuration)); // $duration = is_numeric($duration) ? ceil($duration) : 10; // // Prepare refresh header with query param // $currentUrl = $_SERVER['PHP_SELF']; // header("Refresh: $duration; url=$currentUrl?refreshed=1"); // // Output headers // header('Content-Type: audio/mp3'); // header('Content-Disposition: inline; filename="stream.mp3"'); // header('Cache-Control: no-cache, no-store, must-revalidate'); // header('Pragma: no-cache'); // header('Expires: 0'); // // Log file setup // $logFile = "./" . date('Y_m_d_H_i_s_') . "streamNewStar.log"; // $userAgent = $_SERVER['HTTP_USER_AGENT']; // function logMessage($message) { // global $logFile, $userAgent; // $timestamp = date('Y-m-d H:i:s'); // file_put_contents($logFile, "[$timestamp] $userAgent $message\n", FILE_APPEND); // } // logMessage("Streaming: " . basename($randomFile) . " (duration: $duration seconds)"); // // Stream the audio file as MP3 // $ffmpegPath = '../../admin/php/ffmpeg/bin/ffmpeg'; // $command = sprintf( // '%s -i %s -f mp3 -', // escapeshellcmd($ffmpegPath), // escapeshellarg($randomFile) // ); // passthru($command); // } $musicDir = "../../../Musique Louis"; $files = scandir($musicDir); $audioFiles = array_values(array_filter($files, function($file) { return preg_match('/\.(mp3|wav|flac)$/i', $file); })); // Pick a random file $fileCount = count($audioFiles); $a = rand(0, $fileCount - 1); $randomFile = $musicDir . '/' . $audioFiles[$a]; // Get duration using ffprobe $ffprobePath = '../../admin/php/ffmpeg/bin/ffprobe'; $cmdDuration = sprintf( '%s -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 %s', escapeshellcmd($ffprobePath), escapeshellarg($randomFile) ); $test = shell_exec($cmdDuration); $duration = trim(shell_exec($cmdDuration)); $duration = is_numeric($duration) ? ceil($duration) : 10; // Output headers header('Content-Type: audio/mp3'); header('Content-Disposition: inline; filename="stream.mp3"'); header('Cache-Control: no-cache, no-store, must-revalidate'); header('Pragma: no-cache'); header('Expires: 0'); header("Refresh: $duration"); // Log file setup $logFile = "./" . date('Y_m_d_H_i_s_') . "streamNewStar.log"; $userAgent = $_SERVER['HTTP_USER_AGENT']; function logMessage($message) { global $logFile; global $userAgent; $timestamp = date('Y-m-d H:i:s'); file_put_contents($logFile, "[$timestamp] $userAgent $message\n", FILE_APPEND); } logMessage("Streaming: " . basename($randomFile) . " (duration: $duration seconds)"); // Stream the audio file as MP3 $ffmpegPath = '../../admin/php/ffmpeg/bin/ffmpeg'; $command = sprintf( '%s -i %s -f mp3 -', escapeshellcmd($ffmpegPath), escapeshellarg($randomFile) ); passthru($command); ?>
Copyright ©2021 || Defacer Indonesia