Skip to content

Instantly share code, notes, and snippets.

@ZiTAL
Last active March 6, 2025 09:22
Show Gist options
  • Save ZiTAL/6bf9052ad643392dc75077e9f7e5268e to your computer and use it in GitHub Desktop.
Save ZiTAL/6bf9052ad643392dc75077e9f7e5268e to your computer and use it in GitHub Desktop.
liquidsoap: reload playlist manually using external connection
settings.server.telnet.set(true)
settings.server.telnet.port.set(1234)
settings.server.telnet.bind_addr.set("0.0.0.0")
host = "localhost"
port = 8000
passwd = "passwd"
mount = "/stream.mp3"
p = playlist("radio.m3u", reload_mode="manual")
silence = blank()
radio = fallback(track_sensitive = false, [p, silence])
radio = normalize(radio)
def reload_playlist(_) =
log("Reloading playlist...")
p.reload()
"Reloading playlist..."
end
server.register("reload_playlist", reload_playlist)
output.icecast(
%mp3(bitrate=128, samplerate=44100, stereo=true),
host=host,
port=port,
password=passwd,
mount=mount,
name="radio",
description="radio desc",
genre="Various",
url="http://radio.localhost",
public=true,
radio
)
#EXTM3U
#EXTINF:120, Sample Video 1
a.mp4
#EXTINF:120, Sample Audio 1
a.mp3
@ZiTAL
Copy link
Author

ZiTAL commented Mar 6, 2025

to reaload playlist from bash:

echo "reload_playlist" | nc localhost 1234

to install netcat:

apt-get install netcat-traditional

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment