forked from tilderadio/archive
Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
4a46ddc3ab | |||
2cfef83762 | |||
d451710f2f | |||
6aa828f2a1 | |||
d2659af09d | |||
4b24c67dde | |||
71559124a6 | |||
48426d4677 | |||
3bd3b72e30 | |||
62b1a4d29a | |||
39265c8044 | |||
|
d8b9a17a84 | ||
40017e7e91 | |||
afefcdb02c | |||
09d64865ee |
|
@ -12,15 +12,17 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>tilderadio archive</h1>
|
<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><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>
|
<hr>
|
||||||
<?php
|
<?php
|
||||||
foreach (glob("/var/www/archive/*") as $dir) {
|
foreach (glob("/var/www/archive/*") as $dir) {
|
||||||
|
$archive_count = count(glob("$dir/*.mp3"));
|
||||||
$name = basename($dir);
|
$name = basename($dir);
|
||||||
if ($name == "webhook" || $name == "log" || !is_dir($dir)) continue;
|
if ($name == "webhook" || $name == "log" || !is_dir($dir)) continue;
|
||||||
?>
|
?>
|
||||||
<div class="list-group">
|
<div class="list-group">
|
||||||
<a href="<?=$name?>/" class="list-group-item">
|
<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>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
38
rss.php
Normal file
38
rss.php
Normal file
|
@ -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);
|
$json = json_decode(file_get_contents('php://input'), true);
|
||||||
|
|
||||||
|
$excluded_djs = [
|
||||||
|
"alrs",
|
||||||
|
"cat",
|
||||||
|
"dctrud",
|
||||||
|
"epoch",
|
||||||
|
"rawktucc",
|
||||||
|
"ten_forward"
|
||||||
|
"vivi",
|
||||||
|
];
|
||||||
|
|
||||||
if ($json["live"]["is_live"]) {
|
if ($json["live"]["is_live"]) {
|
||||||
// start recording
|
// start recording
|
||||||
$streamer = $json["live"]["streamer_name"];
|
$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"));
|
$current_pid = intval(file_get_contents("ffmpeg.pid"));
|
||||||
// posix_kill with 0 signal tells you if the process is running
|
// posix_kill with 0 signal tells you if the process is running
|
||||||
if ($current_pid != "" && posix_kill($current_pid, 0)) die();
|
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");
|
copy(__DIR__."/../djindex.php", __DIR__."/../$streamer/index.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
$standard_stream = "https://radio.tildeverse.org/radio/8000/radio.ogg";
|
$standard_stream = "https://azuracast.tilderadio.org/radio/8000/radio.ogg";
|
||||||
$testing_stream = "https://radio.tildeverse.org/radio/8010/radio.mp3";
|
$testing_stream = "https://azuracast.tilderadio.org/radio/8010/radio.mp3";
|
||||||
$metadata = "-metadata title=\"tilderadio archive - $timestamp\" -metadata artist=\"$streamer\"";
|
$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 $!";
|
$cmd = "/usr/bin/ffmpeg -i $standard_stream $metadata ../$streamer/tilderadio-$streamer-$timestamp.mp3 >out.log 2>&1 & echo $!";
|
||||||
$pid = exec($cmd);
|
$pid = exec($cmd);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user