Index: channels/liveradio.py ================================================================== --- channels/liveradio.py +++ channels/liveradio.py @@ -104,11 +104,11 @@ ="country">([^<]+)< .*? itemprop="name">]+>([^<]+) .*? class="genre">([^<]+)< """, html, re.X|re.S) for row in ls: - log.DATA(row) + #log.DATA(row) id, img, country, title, genre = row r.append(dict( homepage = self.base + "stations/" + id, url = "urn:liveradio:" + id, playing = unhtml(country), @@ -129,22 +129,23 @@
Soulconnexion Radio
Funk, Soul
""" def pq_extract(self, html): r = [] - for radio in pq(html).find("*[itemscope][itemtype='http://schema.org/RadioStation']"): - log.DATA(radio) + html = pq(html).make_links_absolute(self.base) + for radio in html.find("*[itemscope][itemtype='http://schema.org/RadioStation']"): + #log.DATA(radio) radio = pq(radio) href = radio.find("*[itemprop='name'] a").attr("href") id = re.search("/([\w-]+)$", href).group(1) r.append(dict( homepage = self.base + "stations/" + id, url = "urn:liveradio:" + id, playing = radio.find("*.country").text(), title = radio.find("*[itemprop='name']").text(), genre = radio.find("*.genre").text(), - img = self.base + re.sub("^/", "", radio.find("img[itemprop='image']").attr("src")) + img = radio.find("img[itemprop='image']").attr("src") )) return r # Update `url` on station data access (incurs a delay for playing or recording)