我想知道liquidsoap 何时回退到emergency_playlist,以便我可以启动系统脚本。也许有一个类似于 on_blank(handler,radio) 的处理程序可以做到这一点,
这是我的代码,
#!/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])