From: Samuel M. <sm...@gm...> - 2013-05-23 16:28:36
|
A small remark, why not simply using playlist(reload_mode="watch", ...)? Doesn't is precisely do what you are trying to achieve by hand? ++ Sam. On Sat, May 18, 2013 at 1:11 AM, Romain Beauxis <to...@ra...> wrote: > Hi, > > I think I kinda see what you want to do but it's going to be more > tricky than you expect.. > > Could you describe more in details your requirements? > > Thanks! > Romain > > 2013/5/17 Isabel Van Rooyen <is...@sp...>: >> Hey guys, >> >> Just to give you an idea of what I am attempting, here is the code I have so >> far: >> >> set("log.file.path","liquidsoap.log") >> set( "log.level", 5 ) >> radio = fallback() >> >> def create_dynamic_request(param) >> request.dynamic({ >> request.create("bar:foo", >> indicators=get_process_lines("cat "^quote(param))) >> }) >> end >> >> def reload_all_streams() >> >> indicators=list.hd(get_process_lines("cat "^quote("playlist.txt"))) >> log(indicators) >> param = string.split(separator="\|",indicators) >> uri = list.nth(param,0) >> param1 = list.nth(param,1) >> param2 = list.nth(param,2) >> param3 = list.nth(param,3) >> stream1=input.http() >> stream2=input.http() >> stream3=input.http() >> if (string.match(pattern="http://",param1)) then >> stream1=strip_blank(input.http(param1)) >> else >> file.watch(param1, create_dynamic_request) >> end >> >> if (string.match(pattern="http://",param2)) then >> stream2=strip_blank(input.http(param2)) >> else >> file.watch(param2, create_dynamic_request) >> end >> >> if (string.match(pattern="http://",param3)) then >> stream3=strip_blank(input.http(param3)) >> else >> file.watch(param3, create_dynamic_request) >> end >> >> radio=fallback(track_sensitive=false,[stream1,stream2,stream3]) >> end >> >> file.watch("playlist.txt",reload_all_streams()) >> >> output.shoutcast(%mp3(bitrate=64,samplerate=44100,stereo=false),host="sc4.spacialnet.com",port=32104,password="test1",radio) >> output.shoutcast(%mp3(bitrate=16,samplerate=44100,stereo=false),host="sc6.spacialnet.com",port=31354,password="test1",radio) >> output.shoutcast(%mp3(bitrate=64,samplerate=44100,stereo=false),host="sc4.spacialnet.com",port=30682,password="test1",radio) >> >> Any help you could offer would be greatly appreciated. >> >> Kindest Regards >> Isabel >> >> >> >> On Thu, May 16, 2013 at 4:08 PM, Isabel Van Rooyen <is...@sp...> >> wrote: >>> >>> Hi, >>> >>> I'm trying to dynamically build a fallback from a file. >>> >>> The file will be updated regularly with new relays, I then want to be >>> alerted (using file.watch) and then I want to read the file, line by line, >>> and rebuild my list of sources, place them into a fallback, and start >>> streaming again from the top down. >>> >>> Could you guys maybe help me out on how to read the file line by line? >>> After that I think I can do it. >>> >>> Kindest Regards >>> Isabel >> >> >> >> ------------------------------------------------------------------------------ >> AlienVault Unified Security Management (USM) platform delivers complete >> security visibility with the essential security capabilities. Easily and >> efficiently configure, manage, and operate all of your security controls >> from a single console and one unified framework. Download a free trial. >> http://p.sf.net/sfu/alienvault_d2d >> _______________________________________________ >> Savonet-users mailing list >> Sav...@li... >> https://lists.sourceforge.net/lists/listinfo/savonet-users >> > > ------------------------------------------------------------------------------ > AlienVault Unified Security Management (USM) platform delivers complete > security visibility with the essential security capabilities. Easily and > efficiently configure, manage, and operate all of your security controls > from a single console and one unified framework. Download a free trial. > http://p.sf.net/sfu/alienvault_d2d > _______________________________________________ > Savonet-users mailing list > Sav...@li... > https://lists.sourceforge.net/lists/listinfo/savonet-users |