rotate(weights=[1,3,1,4], [jingles, music,jingles,music])
def restart(_) restart() "Done!" end server.register(namespace="usr", description="Restart the application.", usage="restart", "restart", restart)
# The title metadata title = m["title"] # Our addition content = list.hd(get_process_lines("/home/taras/ls/history-title.py")) def update_title(m) = # If title is empty if title == "" then [("artist - title",content)] # Otherwise else [("title","#{title} on #{content}")] end end radio = map_metadata(update_title,radio)
title = m["title"]
def update_title(m) = title = m["title"] # Если тэга нет или там "Unknown" if title == "" or title == "Unknown" then # Получаем имя файла content = m["filename"] # Вырезаем имя файла из пути... content = basename (content) # ...но там осталось ".mp3", что нехорошо. # Как назло, в Liquidsoap нет функции substr(), # поэтому извращаемся и вырезаем расширение средствами bash: content = get_process_output("STR=\""^content^"\"; echo ${STR%.mp3*}") # Задаём новые метаданные [("title", content)] else # Ну а иначе просто посылаем тэг [("title","#{title}")] end end # Применяем изменения к нашему потоку radio = map_metadata(update_title,radio)
liquidsoap /etc/icecast2/retranslator.liq
init: security exit, root euid (user).
# Input the stream, # from an Icecast server or any other source url = "ссылка на поток в виде локалхост:8000/маунт" input = mksafe(input.http(url)) # First transcoder: MP3 192 kbps # We also degrade the samplerate, and encode in mono # Accordingly, a mono conversion is performed on the input stream output.icecast( %mp3(bitrate=128), mount="/128k", host="localhost", port=8000, password="пароль", input) output.icecast( %aacplus(bitrate=32), mount="/32k_aacplus", host="localhost", port=8000, password="пароль", input)
apt-get install libaacplus-ocaml-dynlink
sh: 0: Can't open liquidsoap
apt-get install libaacplus2 Reading package lists... Done Building dependency tree Reading state information... Done libaacplus2 is already the newest version. libaacplus2 set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
su логин_юзера /etc/icecast2/start_silver.sh
<mount-name>/musicc.ogg</mount-name> <password>hackme</password> <stream-name>My super stream</stream-name> <stream-description>Bla-bla</stream-description> <stream-url>http://domain.com</stream-url> <charset>UTF8</charset>