#!/usr/bin/liquidsoap set("init.daemon",true) set("init.daemon.pidfile",false) # Log dir set("log.file.path","/tmp/classic-radio.log") # Music classic = playlist("/home/ave/music/classic/classic.m3u") goro = playlist(reload = 600, "/home/ave/prog/goro/goro.m3u") grand = playlist(reload = 600, "/home/ave/prog/grand/grand.m3u") news = playlist(reload = 600, "/home/ave/prog/news/news.m3u") putish = playlist(reload = 600, "/home/ave/prog/putish/putish.m3u") kalend = playlist(reload = 600, "/home/ave/prog/kalend/kalend.m3u") painter = playlist(reload = 600, "/home/ave/prog/painter/painter.m3u") modbook = playlist(reload = 600, "/home/ave/prog/modbook/modbook.m3u") kinoman = playlist(reload = 600, "/home/ave/prog/kinoman/kinoman.m3u") sovet = playlist(reload = 600, "/home/ave/prog/sovet/sovet.m3u") security = single("/home/radio/sec/intro.mp3") # Some jingles jingles = playlist("/home/ave/music/jingles/jingles.m3u") # If something goes wrong, we'll play this classic_non = classic classic_non = fallback(track_sensitive = false, [classic_non, security]) classic_non = switch([ ({ (1w9h) or (3w9h) or (5w9h) or (1w11h30m) or (3w11h30m) or (5w11h30m)}, goro), ({ (1w9h30m) or (3w9h30m) or (5w9h30m) or (1w18h30m) or (3w18h30m) or (5w18h30m)}, grand), ({ (1w10h) or (3w10h) or (5w10h) or (1w13h) or (3w13h) or (5w13h) or (1w17h) or (3w17h) or (5w17h)}, news), ({ (1w10h30m) or (3w10h30m) or (5w10h30m) or (1w12h) or (3w12h) or (5w12h) or (1w16h30m) or (3w16h30m) or (5w16h30m)}, putish), ({ (1w11h) or (3w11h) or (5w11h) or (1w16h) or (3w16h) or (5w16h)}, kalend), ({ (1w12h30m) or (3w12h30m) or (5w12h30m) or (1w14h30m) or (3w14h30m) or (5w14h30m)}, painter), ({ (1w13h) or (3w13h) or (5w13h) or (1w17h30m) or (3w17h30m) or (5w17h30m)}, modbook), ({ (1w14h) or (3w14h) or (5w14h) or (1w19h) or (3w19h) or (5w19h)}, sovet), ({ (1w15h) or (3w15h) or (5w15h) or (1w18h) or (3w18h) or (5w18h)}, kinoman) ]) # Now add some jingles classic_non = random(weights=[1,5],[ jingles, classic ]) # And finally the security # Stream it out output.icecast (%mp3, host = "*********", port = 8000, password = "*******", mount = "/classic-non.mp3", classic_non)
classic_non = switch([
#!/usr/bin/liquidsoap set("init.daemon",true) set("init.daemon.pidfile",false) # ФС wd = "/home/ave" # путь к папке с аудиофайлами pl = "#{wd}/music" # техническая папка tech = "#{wd}/technical" # логи set("log.file.path","#{tech}/liquidsoap.log") # путь к файлу лога set("log.level", 3) # уровень логирования # папка с информационными вставками promo_dir = "#{pl}/promo" # папка с папками рубрик progr_dir = "#{wd}/programs" # папки рубрик goro = "#{progr_dir}/goro" grand = "#{progr_dir}/grand" kalend = "#{progr_dir}/kalend" kinoman = "#{progr_dir}/kinoman" modbook = "#{progr_dir}/modbook" news = "#{progr_dir}/news" painter = "#{progr_dir}/painter" putish = "#{progr_dir}/putish" sovet = "#{progr_dir}/sovet" # папки с музыкой mus = "#{pl}/classic" # папки с джинглами jin = "#{pl}/jingles" # плейлисты с программами. Обратите внимание - до этого указывались пути к папкам, а здесь - к простым текстовым файлам. goro_pl = "#{goro}/goro.m3u" grand_pl = "#{grand}/grand.m3u" kalend_pl = "#{kalend}/kalend.m3u" kinoman_pl = "#{kinoman}/kinoman.m3u" modbook_pl = "#{modbook}/modbook.m3u" news_pl = "#{news}/news.m3u" painter_pl = "#{painter}/painter.m3u" putish_pl = "#{putish}/putish.m3u" sovet_pl = "#{sovet}/sovet.m3u" # _____________________________________ # Создаём объекты типа "source", в нашем случае это аудиоисточники. # Здесь атрибут "reload" позволяет раз в 360 секунд перечитывать плейлист по пути, указанному далее. # По умолчанию, музыка проигрывается рандомно, атрибут <code>mode = "normal"</code> указывает на проигрывание по порядку. # загружаем плейлисты, джинглы, вставки, программы mus_pl = playlist (reload = 360, "#{mus}") jin_pl = playlist (reload = 360, "#{jin}") promo = playlist (reload = 360, "#{promo_dir}") p_goro = playlist (reload = 360, "#{goro_pl}", mode = "normal") p_grand = playlist (reload = 360, "#{grand_pl}", mode = "normal") p_kalend = playlist (reload = 360, "#{kalend_pl}", mode = "normal") p_kinoman = playlist (reload = 360, "#{kinoman_pl}", mode = "normal") p_modbook = playlist (reload = 360, "#{modbook_pl}", mode = "normal") p_news = playlist (reload = 360, "#{news_pl}", mode = "normal") p_painter = playlist (reload = 360, "#{painter_pl}", mode = "normal") p_putish = playlist (reload = 360, "#{putish_pl}", mode = "normal") p_sovet = playlist (reload = 360, "#{sovet_pl}", mode = "normal") # смешиваем вставки ins = rotate (weights = [2, 1], [jin_pl, promo]) mus_ins = rotate (weights = [3, 1], [mus_pl, ins]) #_______________________________________________________________________ # конфигурируем расписание эфира radio = switch (track_sensitive = true, [ ({ (1w9h) or (3w9h) or (5w9h) or (1w11h30m) or (3w11h30m) or (5w11h30m)}, p_goro), ({ (1w9h30m) or (3w9h30m) or (5w9h30m) or (1w18h30m) or (3w18h30m) or (5w18h30m)}, p_grand), ({ (1w10h) or (3w10h) or (5w10h) or (1w13h) or (3w13h) or (5w13h) or (1w17h) or (3w17h) or (5w17h)}, p_news), ({ (1w10h30m) or (3w10h30m) or (5w10h30m) or (1w12h) or (3w12h) or (5w12h) or (1w16h30m) or (3w16h30m) or (5w16h30m)}, p_putish), ({ (1w11h) or (3w11h) or (5w11h) or (1w16h) or (3w16h) or (5w16h)}, p_kalend), ({ (1w12h30m) or (3w12h30m) or (5w12h30m) or (1w14h30m) or (3w14h30m) or (5w14h30m)}, p_painter), ({ (1w13h) or (3w13h) or (5w13h) or (1w17h30m) or (3w17h30m) or (5w17h30m)}, p_modbook), ({ (1w14h) or (3w14h) or (5w14h) or (1w19h) or (3w19h) or (5w19h)}, p_sovet), ({ (1w15h) or (3w15h) or (5w15h) or (1w18h) or (3w18h) or (5w18h)}, p_kinoman) ]) # добавляем crossfade radio = crossfade(start_next=1., fade_out=1., fade_in=1., radio) # Stream it out output.icecast (%mp3, host = "*************", port = 8000, password = "********", mount = "/classic-non.mp3", mksafe(radio) )
mus_ins = rotate (weights = [3, 1], [mus_pl, ins])
At line 78, character 9: The variable mus_ins defined here is not used anywhere in its scope. Use ignore(...) instead of mus_ins = ... if you meant to not use it. Otherwise, this may be a typo or a sign that your script does not do what you intend.
default = single("~/radio/default.ogg") day = playlist("~/radio/day.pls") night = playlist("~/radio/night.pls") jingles = playlist("~/radio/jingles.pls") clock = single("~/radio/clock.ogg") start = single("~/radio/live_start.ogg") stop = single("~/radio/live_stop.ogg") # Play user requests if there are any, # otherwise one of our playlists, # and the default file if anything goes wrong. radio = fallback([ request.queue(id="request"), switch([({ 6h-22h }, day), ({ 22h-6h }, night)]), default]) # Add the normal jingles radio = random(weights=[1,5],[ jingles, radio ]) # And the clock jingle radio = add([radio, switch([({0m0s},clock)])]) # Add the ability to relay live shows full = fallback(track_sensitive=false, [input.http("http://localhost:8000/live.ogg"), radio])
mus_pl = fallback([ request.queue(id="request"), switch ([ ({ (1w9h) or (3w9h) or (7w9h) or (1w11h30m) or (3w11h30m) or (7w11h30m)}, p_goro), ({ (1w9h30m) or (3w9h30m) or (5w9h30m) or (1w18h30m) or (3w18h30m) or (5w18h30m)}, p_grand), ({ (1w10h) or (3w10h) or (7w10h) or (1w13h) or (3w13h) or (7w13h) or (1w17h) or (3w17h) or (7w17h)}, p_news), ({ (1w10h30m) or (3w10h30m) or (5w10h30m) or (1w12h) or (3w12h) or (5w12h) or (1w16h30m) or (3w16h30m) or (5w16h30m)}, p_putish), ({ (1w11h) or (3w11h) or (5w11h) or (1w16h) or (3w16h) or (5w16h)}, p_kalend), ({ (1w12h30m) or (3w12h30m) or (5w12h30m) or (1w14h30m) or (3w14h30m) or (5w14h30m)}, p_painter), ({ (1w13h) or (3w13h) or (5w13h) or (1w17h30m) or (3w17h30m) or (5w17h30m)}, p_modbook), ({ (1w14h) or (3w14h) or (5w14h) or (1w19h) or (3w19h) or (5w19h)}, p_sovet), ({ (1w15h) or (3w15h) or (5w15h) or (1w18h) or (3w18h) or (5w18h)}, p_kinoman), ]), mus_pl])