125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
uu = rx_data.search(div)
if uu:
(url, title, playing, homepage, genres, listeners, bitrate) = uu.groups()
# transform data
r.append({
"url": url,
"genre": self.strip_tags(genres or ""),
"homepage": ahttp.fix_url(homepage or ""),
"title": (title or "").strip().replace("\n", " "),
"playing": (playing or "").strip().replace("\n", " "),
"bitrate": int(bitrate or 0),
"listeners": int(listeners or 0),
"format": "audio/mpeg", # there is no stream info on that, but internet-radio.org.uk doesn't seem very ogg-friendly anyway, so we assume the default here
})
else:
log.DATA("Regex couldn't decipher entry:", div)
return r
|
|
|
|
|
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
uu = rx_data.search(div)
if uu:
(url, title, playing, homepage, genres, listeners, bitrate) = uu.groups()
# transform data
r.append({
"url": url,
"genre": strip_tags(genres or ""),
"homepage": ahttp.fix_url(homepage or ""),
"title": nl(title or ""),
"playing": nl(playing or ""),
"bitrate": int(bitrate or 0),
"listeners": int(listeners or 0),
"format": "audio/mpeg", # there is no stream info on that, but internet-radio.org.uk doesn't seem very ogg-friendly anyway, so we assume the default here
})
else:
log.DATA("Regex couldn't decipher entry:", div)
return r
|