37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56 |
# streams and gui
class internet_radio (ChannelPlugin):
# control data
listformat = "pls"
categories = []
# load genres
def update_categories(self):
html = http.get(self.homepage)
rx = re.compile("""="/stations/[-+&.\w\s%]+/">([^<]+)<""")
cats = rx.findall(html)
cats = list(set(cats))
cats = [s.capitalize() for s in cats]
self.categories = sorted(list(set(cats)))
|
>
|
| 37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57 |
# streams and gui
class internet_radio (ChannelPlugin):
# control data
listformat = "pls"
categories = []
base_url = "http://www.internet-radio.com/"
# load genres
def update_categories(self):
html = http.get(self.base_url)
rx = re.compile("""="/stations/[-+&.\w\s%]+/">([^<]+)<""")
cats = rx.findall(html)
cats = list(set(cats))
cats = [s.capitalize() for s in cats]
self.categories = sorted(list(set(cats)))
|
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81 | html = []
max_pages = max(int(conf.internetradio_max_pages), 1)
for page in range(1, max_pages):
# Append HTML source
html.append(
http.get(
self.homepage + "stations/" +
cat.lower().replace(" ", "%20") +
"/" + ("page"+str(page) if page>1 else "")
)
)
# Is there a next page?
if str(page+1) not in rx_pages.findall(html[-1]): |
|
| 68
69
70
71
72
73
74
75
76
77
78
79
80
81
82 | html = []
max_pages = max(int(conf.internetradio_max_pages), 1)
for page in range(1, max_pages):
# Append HTML source
html.append(
http.get(
self.base_url + "stations/" +
cat.lower().replace(" ", "%20") +
"/" + ("page"+str(page) if page>1 else "")
)
)
# Is there a next page?
if str(page+1) not in rx_pages.findall(html[-1]): |