(.*?)
', html, re.S) + listeners = re.findall('(\d+) Listen\w*s
', html) + + # catch absent fields + try: + r.append(dict( + url = "urn:streema:" + url[0], + homepage = self.base + "/" + homepage[0], + title = title[0], + img = img[0], + img_resize = 24, + playing = playing[0], + genre = unhtml(genre[0]), + listeners = to_int(listeners[0]) + )) + except: + pass #some field missing + + # 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 + id = row["url"][12:] + html = ahttp.get("http://streema.com/radios/play/%s" % id) + url = re.findall('