# -*- mode: python; encoding: utf-8 -*-
info["owner"] = "root"
info["group"] = "root"
info["mode"] = 0644
import urlparse
import urllib
import tv.radio.config as tv_config
tv_config = reload(tv_config)
out("""
]>
dans l'entête de icecast.xml puis
&radio;
là où l'on souhaite effectivement include le fichier
(quelque part dans )
]]>""")
auth_template = """/%s"""
i=0
for group in tv_config.multicast.keys():
for (title, (name,dst,port,sources)) in tv_config.multicast[group].items():
p=urlparse.urlparse(sources[0])
if ':' in p.netloc:
host=p.netloc.split(':')[0]
port=p.netloc.split(':')[1]
else:
host=p.netloc
port = 80
out("""
%s%s%s/%s11""" % (host, port, p.path, name))
out(auth_template % (name,))