Radio-dodsorfas/web/playlist.php

30 lines
822 B
PHP

<?
include 'common.php';
header('Content-type: audio/x-mpegurl');
$files = scanDir::scan('/playlists/normal', "m3u", false);
$files = array_merge($files, scanDir::scan('/playlists/normal/Daniel', "m3u", false));
$files = array_merge($files, scanDir::scan('/playlists/normal/Joakim', "m3u", false));
$files = array_merge($files, scanDir::scan('/playlists/normal/Oskar', "m3u", false));
$files = array_merge($files, scanDir::scan('/playlists/normal/Cyber', "m3u", false));
$files = array_merge($files, scanDir::scan('/playlists/normal/artists', "m3u", false));
echo "#EXTM3U\n";
foreach($files as $file) {
$filename = $file;
$file = file($file);
$file = array_slice($file, 1);
echo "\n#$filename\n";
foreach($file as $line) {
echo "$line";
if (substr($line, -1) !== "\n")
echo "\n";
}
}
?>