Index: contrib/punkcast.py ================================================================== --- contrib/punkcast.py +++ contrib/punkcast.py @@ -2,11 +2,11 @@ # api: streamtuner2 # title: PunkCast # description: Online video site that covered NYC artists. Not updated anymore. # type: channel # category: video -# version: 0.2 +# version: 0.3 # url: http://www.punkcast.com/ # png: # iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAyxJREFUOI0FwUlvG2UAgOH3++abxfsy2dtmcRsnghpBKyKhQA7lgsShPwEk/gVcKn4HN+6AynKIkEgFUkFF # okrlpEkap2nqxHFsx/bYHs/m4XmE0s1Yyhjf8/niy6/49utv+PPf57x4sk3083cUzZgwZWElE9hL60yyc1zU39A8PsRxhijLMBFahO/5dFotwvGIeDxkOHJwNYvCwgyRYeElslTPu7ivTnFaTU6dkG4E # ytANoskYgMb5W64b51jEuJ6Lq3Rmy2tEUcz1WR1pGGiyiIhMDOlQGHZRQRAQRR4CqJ2eUNvbJcAiEYz45NMtKrdvkc8a1G5M81e1RuiGjDpt1CTASKeQytDxowmmZdLpdDl8+QJLBqTxKSYkc0afbOyz @@ -35,11 +35,14 @@ class punkcast (ChannelPlugin): # keeps category titles->urls catmap = {} categories = ["list"] - titles = dict(playing=False, listeners=False, bitrate=False, homepage=False) + titles = dict(playing=False, listeners=False, bitrate=False, homepage=False) + + img_resize = 196 + fixed_size = [128,32] # don't do anything def update_categories(self): pass @@ -72,20 +75,21 @@ # done return entries # special handler for play - def play(self, row): - + def play(self): + row = self.row() rx_sound = re.compile("""(http://[^"<>]+[.](mp3|ogg|m3u|pls|ram))""") html = ahttp.get(row["homepage"]) # look up ANY audio url for uu in rx_sound.findall(html): log.DATA( uu ) (url, fmt) = uu - action.play(url, mime_fmt(fmt), "srv") + row["url"] = url + action.play(row, mime_fmt(fmt), "srv") return # or just open webpage action.browser(row["homepage"])