committing live changes

This commit is contained in:
Ben Harris 2020-06-28 03:58:14 +00:00
parent 58bd86fd65
commit 428bdbe0b9
3 changed files with 7 additions and 6 deletions

View File

@ -18,7 +18,7 @@ $dj = basename(__DIR__);
<p><a href="..">&lt; back</a></p>
<hr>
<?php
foreach (glob("/var/www/html/$dj/*.mp3") as $dir) {
foreach (glob("/var/www/archive/$dj/*.mp3") as $dir) {
$name = basename($dir);
?>
<div class="list-group">

View File

@ -14,9 +14,9 @@
<p><a href="https://tilderadio.org">back to tilderadio.org</a> - <a href="https://radio.tildeverse.org/radio/8000/radio.ogg">listen now</a></p>
<hr>
<?php
foreach (glob("/var/www/html/*") as $dir) {
foreach (glob("/var/www/archive/*") as $dir) {
$name = basename($dir);
if ($name == "webhook" || !is_dir($dir)) continue;
if ($name == "webhook" || $name == "log" || !is_dir($dir)) continue;
?>
<div class="list-group">
<a href="<?=$name?>/" class="list-group-item">

View File

@ -10,15 +10,16 @@ if ($json->live->is_live) {
// posix_kill with 0 signal tells you if the process is running
if ($current_pid != "" && posix_kill($current_pid, 0)) die();
$timestamp = date("Y-m-d\TH:i:s");
$timestamp = date("Y-m-d\TH_i_s");
if (!is_dir(__DIR__."/../$streamer")) {
mkdir(__DIR__."/../$streamer");
copy(__DIR__."/../djindex.php", __DIR__."/../$streamer/index.php");
copy(__DIR__."/../djindex.html", __DIR__."/../$streamer/index.html");
}
$standard_stream = "https://radio.tildeverse.org/radio/8000/radio.ogg";
$testing_stream = "https://radio.tildeverse.org/radio/8010/radio.mp3";
$cmd = "/usr/bin/ffmpeg -i $standard_stream ../$streamer/tilderadio-$timestamp.mp3 >out.log 2>&1 & echo $!";
$metadata = "-metadata title=\"tilderadio archive - $timestamp\" -metadata artist=\"$streamer\"";
$cmd = "/usr/bin/ffmpeg -i $standard_stream $metadata ../$streamer/tilderadio-$streamer-$timestamp.mp3 >out.log 2>&1 & echo $!";
$pid = exec($cmd);
echo $pid;