An easy way to have a 24/7 audio stream of music.

Remove YT search

+2 -2
docker-compose.yml
···
services:
icecast:
image: docker.io/mkody/icecast:latest
-
restart: always
+
restart: unless-stopped
ports:
- "${ICECAST_PORT:-8000}:8000"
environment:
···
liquidsoap:
image: docker.io/savonet/liquidsoap:v2.2.2
-
restart: always
+
restart: unless-stopped
command: ["/script.liq"]
environment:
- ICECAST_SOURCE_PASSWORD
+2 -20
status.xsl
···
</xsl:if>
<xsl:value-of select="title" />
</div>
-
<div class="search">
-
<a href="/" onclick="ss('{@mount}'); return false;">(search youtube)</a>
-
</div>
</div>
</div>
</xsl:when>
···
</div>
<script type="text/javascript">
<![CDATA[
-
function ss (mount) {
-
let title = document.querySelector('[data-mount="' + mount + '"] .playing').innerHTML
-
let se = document.querySelector('[data-mount="' + mount + '"] .search a')
-
se.innerHTML = 'Please wait...'
-
fetch('https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=1&safeSearch=none&type=video&videoCategoryId=10&key=AIzaSyB0PbGfWP_AwEXx7_DypkJiB0qIjHxedi0&q=' + encodeURIComponent(title))
-
.then(r => r.json())
-
.then(j => {
-
se.innerHTML = '(search youtube)'
-
if (j.items.length > 0) {
-
window.open('https://www.youtube.com/watch?v=' + j.items[0].id.videoId, '_blank')
-
}
-
})
-
}
-
-
function s () {
+
function np () {
document.querySelectorAll('div[data-mount]').forEach(e => {
fetch('https://radio.rita.moe/status-json.xsl?mount=' + e.dataset.mount)
.then(r => r.json())
···
})
}
-
setInterval(s, 3000)
+
setInterval(np, 3000)
document.querySelectorAll('audio').forEach(e => {
new Plyr(e, {
···
</html>
</xsl:template>
</xsl:stylesheet>
-
-5
style-status.css
···
margin-right: 0;
}
-
.search a {
-
font-size: 0.8em;
-
border-bottom: none;
-
}
-
#footer {
border-top: 1px groove #ACACAC;
font-size: 80%;