Compare commits

...

15 Commits

Author SHA1 Message Date
Ben Harris 4a46ddc3ab update urls 2021-09-13 01:42:10 +00:00
Ben Harris 2cfef83762 add count of archives per user 2021-08-04 16:48:35 +00:00
Ben Harris d451710f2f add rawktucc to exclude list 2021-05-09 21:39:53 +00:00
Ben Harris 6aa828f2a1 Merge pull request 'tenforward added to archive-free list' (#6) from tomasino/archive:master into master
Reviewed-on: tilderadio/archive#6
2021-03-25 02:31:43 +00:00
James Tomasino d2659af09d ten_forward username corrected 2021-03-24 21:48:35 +00:00
James Tomasino 4b24c67dde tenforward added to archive-free list
tenforward is a repetitive drone show. there's no reason to archive it.
2021-03-24 21:46:31 +00:00
Ben Harris 71559124a6 exclude cat's archives 2021-03-24 14:29:41 +00:00
Ben Harris 48426d4677 Merge pull request 'Update 'rss.php'' (#5) from buttstuf/archive:master into master
Reviewed-on: tilderadio/archive#5
2021-02-28 03:24:56 +00:00
buttstuf 3bd3b72e30 Update 'rss.php'
Update 'rss.php' to include filesize in XML data
2021-02-28 02:14:48 +00:00
Ben Harris 62b1a4d29a add epoch to exclude list 2020-12-11 05:07:14 +00:00
Ben Harris 39265c8044 Merge pull request 'Nobody wants to ever have to endure listening to this guy a second time.' (#4) from vivi/archive:master into master
Reviewed-on: tilderadio/archive#4
2020-12-03 05:48:43 +00:00
Gregory Meloche d8b9a17a84 Nobody wants to ever have to endure listening to this guy a second time. 2020-12-03 00:45:41 -05:00
Ben Harris 40017e7e91 hopefully fix archiving... exclude list is not a literal array 2020-07-21 14:02:26 +00:00
Ben Harris afefcdb02c add rss feed - closes #1 2020-07-18 01:58:55 +00:00
dctrud 09d64865ee Add dctrud to exclude list 2020-07-15 22:28:54 -04:00
4 changed files with 54 additions and 5 deletions

View File

@ -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 } ?>

38
rss.php Normal file
View 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>

View File

@ -1 +0,0 @@
alrs

View File

@ -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);