59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
def update_streams(self, cat, search=None):
# fetch page
wiki = ahttp.get(self.base[cat])
f = "audio/mpeg" if cat == "stations" else "video/mp4"
# split on headlines
return itertools.chain(
self.join(src, f) for src in re.split("^==+", wiki, 0, re.M)
)
# Extract individual stations
def join(self, src, f):
# regexp lists out, just one srv url per entry
ls = re.findall(r"""
|
|
|
<
>
>
|
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
def update_streams(self, cat, search=None):
# fetch page
wiki = ahttp.get(self.base[cat])
f = "audio/mpeg" if cat == "stations" else "video/mp4"
# split on headlines
r = []
for src in re.split("^==+", wiki, 0, re.M):
r += self.join(src, f)
return r
# Extract individual stations
def join(self, src, f):
# regexp lists out, just one srv url per entry
ls = re.findall(r"""
|