Skip to content

Instantly share code, notes, and snippets.

@vanclist
Last active June 10, 2017 15:20
Show Gist options
  • Save vanclist/6945ccec8bbbdd84228d73c64fcc064e to your computer and use it in GitHub Desktop.
Save vanclist/6945ccec8bbbdd84228d73c64fcc064e to your computer and use it in GitHub Desktop.
Restream one icecast-compatible stream to multiple streams (can be used for testing purposes)
#!/usr/bin/env liquidsoap
set("harbor.bind_addr", "0.0.0.0")
live = input.harbor("/", port=8008, icy=true, buffer=0.0, user="source", password="root")
files = mksafe(playlist(mode="normal", "jingle.txt"))
radio = fallback(track_sensitive=false, [live,files])
ports = [
40000, 40002, 40004, 40006, 40008,
40010, 40012, 40014, 40016, 40018
]
def cast(port)
output.icecast(
%mp3(bitrate=128, samplerate=44100, stereo=true),
radio,
host = "example.com",
port = port,
password = "root",
mount = string_of(port) ^ ".m3u"
)
end
print(list.map(cast, ports))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment