summaryrefslogtreecommitdiff
path: root/scripts/streaming.py
blob: f82d9c8b958b9e0ec649e850030c35ddf8e9a0cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python

import urllib2
from lxml import etree

doc = urllib2.urlopen('http://void.subsignal.org:9000/sublounge.xsl').read()
tree = etree.fromstring(doc)

sources = tree.findall('source')
sublab_sources = []
for source in sources:
    if 'mount' not in source.attrib:
        continue
    mount = source.attrib['mount']
    if mount.startswith('/subsig'):
        continue
    if mount.startswith('/sub'):
        sublab_sources.append(source)

if not sublab_sources:
    print ".stream-ad { display: none; }"
else:
    print "/* .stream-ad { display: none; } */"