forked from tilderadio/archive
Compare commits
15 Commits
Author | SHA1 | Date |
---|---|---|
Ben Harris | 4a46ddc3ab | |
Ben Harris | 2cfef83762 | |
Ben Harris | d451710f2f | |
Ben Harris | 6aa828f2a1 | |
James Tomasino | d2659af09d | |
James Tomasino | 4b24c67dde | |
Ben Harris | 71559124a6 | |
Ben Harris | 48426d4677 | |
buttstuf | 3bd3b72e30 | |
Ben Harris | 62b1a4d29a | |
Ben Harris | 39265c8044 | |
Gregory Meloche | d8b9a17a84 | |
Ben Harris | 40017e7e91 | |
Ben Harris | afefcdb02c | |
dctrud | 09d64865ee |
|
@ -12,15 +12,17 @@
|
|||
<div class="container">
|
||||
<h1>tilderadio archive</h1>
|
||||
<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>
|
||||
<p>here's the archive as an <a href="rss.php">rss feed</a>. source for this archive <a href="https://tildegit.org/tilderadio/archive">here</a></p>
|
||||
<hr>
|
||||
<?php
|
||||
foreach (glob("/var/www/archive/*") as $dir) {
|
||||
$archive_count = count(glob("$dir/*.mp3"));
|
||||
$name = basename($dir);
|
||||
if ($name == "webhook" || $name == "log" || !is_dir($dir)) continue;
|
||||
?>
|
||||
<div class="list-group">
|
||||
<a href="<?=$name?>/" class="list-group-item">
|
||||
<p class="list-group-item-text"><?=$name?></p>
|
||||
<p class="list-group-item-text"><?=$name?> - <?=$archive_count?> archive<?=($archive_count == 1 ? '' : 's')?></p>
|
||||
</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
header('Content-type: text/xml');
|
||||
|
||||
$feedName = "tilderadio archive feed";
|
||||
$feedDesc = "feed of archived shows broadcasted on tilderadio";
|
||||
$feedURL = "https://archive.tilderadio.org/rss.php";
|
||||
$feedBaseURL = "https://archive.tilderadio.org/"; // must end in trailing forward slash (/).
|
||||
|
||||
$allowed_ext = ".mp3,.MP3";
|
||||
?>
|
||||
<?xml version="1.0"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title><?=$feedName?></title>
|
||||
<link><?=$feedURL?></link>
|
||||
<description><?=$feedDesc?></description>
|
||||
<atom:link href="<?=$feedURL?>" rel="self" type="application/rss+xml" />
|
||||
|
||||
<?php
|
||||
$files = glob("*/*.mp3");
|
||||
|
||||
foreach ($files as $file) {
|
||||
$timestamp = filectime($file);
|
||||
$filesize = filesize($file);
|
||||
list($author, $filename) = explode("/", $file, 2);
|
||||
?>
|
||||
<item>
|
||||
<title><?=$filename?></title>
|
||||
<author><?=$author?></author>
|
||||
<link><?=$feedBaseURL?><?=$file?></link>
|
||||
<guid><?=$feedBaseURL?><?=$file?></guid>
|
||||
<pubDate><?=date(DATE_RSS, $timestamp)?></pubDate>
|
||||
<fileSize><?=$filesize?></fileSize>
|
||||
</item>
|
||||
<?php } ?>
|
||||
|
||||
</channel>
|
||||
</rss>
|
|
@ -1 +0,0 @@
|
|||
alrs
|
|
@ -2,11 +2,21 @@
|
|||
|
||||
$json = json_decode(file_get_contents('php://input'), true);
|
||||
|
||||
$excluded_djs = [
|
||||
"alrs",
|
||||
"cat",
|
||||
"dctrud",
|
||||
"epoch",
|
||||
"rawktucc",
|
||||
"ten_forward"
|
||||
"vivi",
|
||||
];
|
||||
|
||||
if ($json["live"]["is_live"]) {
|
||||
// start recording
|
||||
$streamer = $json["live"]["streamer_name"];
|
||||
|
||||
if (!in_array($streamer, file("exclude-djs.txt")) {
|
||||
if (!in_array($streamer, $excluded_djs)) {
|
||||
$current_pid = intval(file_get_contents("ffmpeg.pid"));
|
||||
// posix_kill with 0 signal tells you if the process is running
|
||||
if ($current_pid != "" && posix_kill($current_pid, 0)) die();
|
||||
|
@ -17,8 +27,8 @@ if ($json["live"]["is_live"]) {
|
|||
copy(__DIR__."/../djindex.php", __DIR__."/../$streamer/index.php");
|
||||
}
|
||||
|
||||
$standard_stream = "https://radio.tildeverse.org/radio/8000/radio.ogg";
|
||||
$testing_stream = "https://radio.tildeverse.org/radio/8010/radio.mp3";
|
||||
$standard_stream = "https://azuracast.tilderadio.org/radio/8000/radio.ogg";
|
||||
$testing_stream = "https://azuracast.tilderadio.org/radio/8010/radio.mp3";
|
||||
$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);
|
||||
|
|
Loading…
Reference in New Issue