87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121 | path = "land/"
if path is not None:
html = http.get(self.base + path + cat.lower() + ".html")
html = re.sub("&#x?\d+;", "", html)
rx_radio = re.compile(r"""
<a\s+class="navil"\s+href="([^"]+)"[^>]*>([^<>]+)</a></td>
<td\s+class="ort">(.*?)</td>.*?
<td\s+class="ort">(.*?)</td>.*?
<td\s+class="home1"><a\s+class="navil"\s+href="(.+?)"
""", re.X|re.I)
rx_video = re.compile(r"""
<a[^>]+href="([^"]+)"[^>]*>(?:<[^>]+>)*Externer
""", re.X|re.I)
# per-country list
for uu in rx_radio.findall(html):
(homepage, name, genre, stadt, url) = uu
# find mms:// for webtv stations
if is_tv:
m = rx_video.search(http.get(url))
if m:
url = m.group(1)
# just convert /radio/ into /m3u/ link
else:
url = "http://www.surfmusik.de/m3u/" + url[30:-5] + ".m3u",
entries.append({
"title": name,
"homepage": homepage,
"url": url,
"playing": stadt,
"genre": genre, |
>
<
|
|
| 87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121 | path = "land/"
if path is not None:
html = http.get(self.base + path + cat.lower() + ".html")
html = re.sub("&#x?\d+;", "", html)
rx_radio = re.compile(r"""
<td\s+class="home1"><a[^>]*\s+href="(.+?)"[^>]*> .*?
<a\s+class="navil"\s+href="([^"]+)"[^>]*>([^<>]+)</a></td>
<td\s+class="ort">(.*?)</td>.*?
<td\s+class="ort">(.*?)</td>.*?
""", re.X|re.I)
rx_video = re.compile(r"""
<a[^>]+href="([^"]+)"[^>]*>(?:<[^>]+>)*Externer
""", re.X|re.I)
# per-country list
for uu in rx_radio.findall(html):
(url, homepage, name, genre, stadt) = uu
# find mms:// for webtv stations
if is_tv:
m = rx_video.search(http.get(url))
if m:
url = m.group(1)
# just convert /radio/ into /m3u/ link
else:
url = "http://www.surfmusik.de/m3u/" + url[30:-5] + ".m3u"
entries.append({
"title": name,
"homepage": homepage,
"url": url,
"playing": stadt,
"genre": genre, |