[tv/radio] Une instance de icecast pour les flux radio http
Ça permet de pouvoir aussi les écouter en wifi, comme la bande passante que prennent les flux audio est faible.
This commit is contained in:
parent
4a06d155d8
commit
39c75f058d
4 changed files with 32 additions and 3 deletions
25
tv/radio/icecast.py
Executable file
25
tv/radio/icecast.py
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf8 -*-
|
||||
import urlparse
|
||||
import urllib
|
||||
from config import *
|
||||
|
||||
i=0
|
||||
for group in multicast.keys():
|
||||
for (title, (name,dst,port,sources)) in 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
|
||||
print """
|
||||
<relay>
|
||||
<server>%s</server>
|
||||
<port>%s</port>
|
||||
<mount>%s</mount>
|
||||
<local-mount>/%s</local-mount>
|
||||
<relay-shoutcast-metadata>1</relay-shoutcast-metadata>
|
||||
<on-demand>1</on-demand>
|
||||
</relay>""" % (host, port, p.path, name)
|
Loading…
Add table
Add a link
Reference in a new issue