Index: channels/internet_radio.py ================================================================== --- channels/internet_radio.py +++ channels/internet_radio.py @@ -61,13 +61,15 @@ # load genres def update_categories(self): html = http.get(self.homepage) - rx = re.compile("""]+value="/stations/[-+&.\w\s%]+/">([^<]+)""") - - self.categories = rx.findall(html) + rx = re.compile("""="/stations/[-+&.\w\s%]+/">([^<]+)<""") + cats = rx.findall(html) + cats = list(set(cats)) + cats = [s.capitalize() for s in cats] + self.categories = sorted(cats) # fetch station lists def update_streams(self, cat): @@ -88,11 +90,11 @@ 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]): break self.parent.status(float(page)/float(max_pages+1))