Index: channels/shoutcast.py ================================================================== --- channels/shoutcast.py +++ channels/shoutcast.py @@ -3,11 +3,11 @@ # description: Primary list of shoutcast servers (now managed by radionomy). # type: channel # category: radio # author: Mario # original: Jean-Yves Lefort -# version: 1.5 +# version: 1.6 # url: http://www.shoutcast.com/ # config: - # priority: default # png: # iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAelJREFUOI2NU0toE2EYnM12t2wLkhSXSIgEJMHFQ2naQ+kpoPYQoaXH3gRFsegloUhRQTyU2oOgggQUzzlEQomIBzU+EHooBIol0cOGLqFFFiJ5SB5skvFU6ebRduA7/DAz @@ -50,11 +50,11 @@ # within the cache dirs. # class shoutcast(channels.ChannelPlugin): # attrs - base_url = "http://shoutcast.com/" + base_url = "http://directory.shoutcast.com/" listformat = "pls" has_search = False # categories categories = [] @@ -70,11 +70,15 @@ html = ahttp.get(self.base_url) #log.DATA( html ) self.categories = [] # Genre list in sidebar - """
  • Adult
  • """ + """ +
  • + Britpop +
  • + """ rx = re.compile(r"loadStationsByGenre\( '([^']+)' [,\s]* (\d+) [,\s]* (\d+) \)", re.X) subs = rx.findall(html) # group current = [] @@ -92,17 +96,12 @@ # downloads stream list from shoutcast for given category def update_streams(self, cat): - if (cat not in self.catmap): - log.ERR( "Category not in known map.", cat ) - return [] - id = self.catmap[cat] - # page - url = "http://www.shoutcast.com/Home/BrowseByGenre" + url = "http://directory.shoutcast.com/Home/BrowseByGenre" params = { "genrename": cat } referer = None try: json = ahttp.get(url, params=params, referer=referer, post=1, ajax=1) json = json_decode(json)