summaryrefslogtreecommitdiff
path: root/scripts/streaming.py
blob: 95367f5a0e40e223e2eafb0db6f4aa604e22e3f3 (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 python2

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; } */"