diff --git a/python_apps/pypo/install/pypo-install.py b/python_apps/pypo/install/pypo-install.py index 5c05129e7..3e4b47b15 100755 --- a/python_apps/pypo/install/pypo-install.py +++ b/python_apps/pypo/install/pypo-install.py @@ -9,6 +9,7 @@ import shutil import platform from configobj import ConfigObj from subprocess import Popen +import string if os.geteuid() != 0: print "Please run this as root." @@ -101,6 +102,19 @@ try: # as we don't use it anymore.(CC-2552) os.remove(config["bin_dir"]+"/bin/liquidsoap_scripts/liquidsoap.cfg") + # replace some variables in liquidsoap.cfg + input = open("/etc/airtime/liquidsoap.cfg") + content = input.read() + text = string.replace(content,"%%s1_stream%%", "true") + text = string.replace(text, "%%s2_stream%%", "false") + text = string.replace(text,"%%s3_stream%%", "false") + text = string.replace(text,"%%s1_bitrate%%", "128") + text = string.replace(text,"%%s1_mount_point%%", "airtime.mp3") + text = string.replace(text,"%%s1_description%%", "Airtime Radio!") + text = string.replace(text,"%%s1_genre%%", "genre") + out = open("/etc/airtime/liquidsoap.cfg", 'w') + out.write(text) + print "Setting permissions" os.system("chmod -R 755 "+config["bin_dir"]) os.system("chown -R pypo:pypo "+config["bin_dir"]) diff --git a/python_apps/pypo/liquidsoap_scripts/liquidsoap.cfg b/python_apps/pypo/liquidsoap_scripts/liquidsoap.cfg index ef4b26b62..96fca1dfb 100644 --- a/python_apps/pypo/liquidsoap_scripts/liquidsoap.cfg +++ b/python_apps/pypo/liquidsoap_scripts/liquidsoap.cfg @@ -6,11 +6,14 @@ # Output settings # ########################################### output_sound_device = false -output_icecast_vorbis = true -output_icecast_mp3 = false +output_icecast_s1 = %%s1_stream%% +output_icecast_s2 = %%s2_stream%% +output_icecast_s3 = %%s3_stream%% output_shoutcast = false -#output_bitrate = 128 +output_s1_bitrate = %%s1_bitrate%% +output_s2_bitrate = %%s2_bitrate%% +output_s3_bitrate = %%s3_bitrate%% #output_samplerate = 44100 #output_stereo = true @@ -28,13 +31,18 @@ icecast_port = 8000 icecast_pass = "hackme" # Icecast mountpoint names -mount_point_mp3 = "airtime.mp3" -mount_point_vorbis = "airtime.ogg" +mount_point_s1 = "%%s1_mount_point%%" +mount_point_s2 = "%%s2_mount_point%%" +mount_point_s3 = "%%s3_mount_point%%" # Webstream metadata settings icecast_url = "http://airtime.sourcefabric.org" -icecast_description = "Airtime Radio!" -icecast_genre = "genre" +icecast_s1_description = "%%s1_description%%" +icecast_s2_description = "%%s2_description%%" +icecast_s3_description = "%%s3_description%%" +icecast_s1_genre = "%%s1_genre%%" +icecast_s2_genre = "%%s2_genre%%" +icecast_s3_genre = "%%s3_genre%%" # Audio stream metadata for vorbis/ogg is disabled by default # due to a number of client media players that disconnect diff --git a/python_apps/pypo/liquidsoap_scripts/ls_script.liq b/python_apps/pypo/liquidsoap_scripts/ls_script.liq index 2256bdf57..3de4aed9c 100644 --- a/python_apps/pypo/liquidsoap_scripts/ls_script.liq +++ b/python_apps/pypo/liquidsoap_scripts/ls_script.liq @@ -56,7 +56,7 @@ if output_sound_device then ignore(output.alsa(s)) end -if output_icecast_mp3 then +if output_icecast_s1 then #format = %mp3(bitrate=192, samplerate=44100, stereo=false) ignore(output.icecast(%mp3,