我想知道liquidsoap何时回退到emergency_playlist,以便我可以启动系统脚本。也许有一个处理程序可以执行类似on_blank(处理程序,无线电),
这是我的代码,
#!/home/ubuntu/.opam/system/bin/liquidsoap
myplaylist = playlist("~/backup_playlist/playlist/Emergency-list.m3u",mode="normal")
backup_playlist = audio_to_stereo(myplaylist)
liveset = input.http("http://listen.qkradio.com.au:8382/main_test.mp3")
radio = fallback(track_sensitive=false,
[strip_blank(max_blank=120.,liveset), backup_playlist])
radio = on_blank(handler,radio)
# Stream it out
output.icecast(
%mp3(bitrate=64),
host="localhost", port=8382, password="xxxxxxxx",
mount="test.mp3", radio)
更新
以下代码执行系统脚本但是只有在脚本启动时才会执行,但我希望每次启动回退时执行此操作
def fall()
system("./scripts/pushover.py")
backup_playlist
end
radio = fallback(track_sensitive=false,
[strip_blank(max_blank=10.,liveset), fall() , security])