2015-06-23 23:05 GMT-05:00 Eduardo Martinez <[email protected]>:
> Hello,

Hi there!

> I have a series of simple daily playlists named as follows:
> 23062015.m3u
> 24062015.m3u
> 25062015.m3u
>
> I would like liquidsoap to reload to a new playlist every 24 hours based on
> the current date.
> I'm able to use get_process_output function to pass the appropriate playlist
> using the date command.
>
> The part I get stuck on, is setting the reload frequency, and triggering it
> every day at a specific time.
> reload (int – defaults to 0): Amount of time (in seconds or rounds).
> reload_mode (string – defaults to "seconds"): Unit of the reload parameter,
> either 'rounds', 'seconds' or 'watch' (reload the file whenever it is
> changed).
>
> Neither of these seem to be in liquidsoap's time format of 1h (The first
> hour of every day).
> I cant use a reload frequency in seconds, because the timer would then be
> dependent on when I started the script, not a specific time of the day.
>
> Is there a way to load a new playlist at a specific time of the day, based
> on the m3u naming convention provided above?
>
> #!/usr/local/bin/liquidsoap -v
>
> set("log.file.path","/home/ed/liquidsoap/logs/daily.log")
> set("log.stdout",true)
>
> input = playlist(get_process_output("date +%d%m%Y.m3u|tr -d
> '\n'"),mode="normal")
>
> output.icecast(
> %fdkaac(channels=2, samplerate=44100, bitrate=64, aot="mpeg2_he_aac_v2",
> sbr_mode=true),
> mount="/test.aac",
> host="radio.myserver.net", port=80, password="pword",
> mksafe(input))

The simplest solution that I can think of would be to have a symlink this way:

playlist.m3u --> 23062015.m3u

And use it in the playlist operator:

 input = playlist("playlist.m3u",mode="normal",reload_mode="watch")

I haven't tested it but I think it's pretty likely that if you change
the symlink to point to the next playlist, it will count as a change
in the file for the "watch" reload mode and your playlist will be
reloaded.

Hope this helps,
Romain

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to