42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60 | 42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63 |
-
+
+
+
+
| base = "http://streema.com/radios"
# takes a while to load
def update_categories(self):
self.categories = []
html = ahttp.get(self.base)
for cat in re.findall('<a href="/radios/main-genre/(\w+)">', html):
main_cats = re.findall('<a href="/radios/main-genre/(\w+)">', html)
for cat in main_cats:
self.progress(main_cats)
html = ahttp.get(self.base + "/main-genre/" + cat)
sub = re.findall('<a href="/radios/genre/(\w+)">', html)
self.categories.append(cat)
self.categories.append(sub)
self.progress(0)
return self.categories
# get streems
def update_streams(self, cat, search=None):
r = []
if cat: |
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101 | 90
91
92
93
94
95
96
97
98
99
100
101
102
103
104 |
-
+
| playing = playing[0],
genre = unhtml(genre[0]),
listeners = to_int(listeners[0])
))
except:
pass #some field missing
# done
# done
return r
# load page and get first download url (there's four, but usually identical)
def resolve_urn(self, row):
if row.get("url", "-").find("urn:streema:") != 0:
return |