Check-in [644d1b3532]
Overview
Comment: | Add trivial di.fm/sky.fm radio list fetcher. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
644d1b35325bb1ddf9b4999a5f4ead27 |
User & Date: | mario on 2015-05-06 04:02:40 |
Other Links: | manifest | tags |
Context
2015-05-06
| ||
04:27 | Fix JSON serialization. check-in: b2d517502d user: mario tags: trunk | |
04:02 | Add trivial di.fm/sky.fm radio list fetcher. check-in: 644d1b3532 user: mario tags: trunk | |
00:22 | Enable glrp.csv download from repo. check-in: f42cec687d user: mario tags: trunk | |
Changes
Added contrib/di.py version [475bcbba59].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | # encoding: UTF-8 # api: streamtuner2 # title: di.fm / sky.fm # description: # url: http://di.fm/ # version: 0.1 # type: channel # category: radio # config: - # png: # priority: extra # # Just prints the public list of RadioTunes stations. # Premium entries are available, not fetched here. # Free entries use a 64kbit/s AACP audio encoding. # # Alternative JSON list: http://listen.di.fm/public3 # Required unpacking a complex category association, # and only adds a few more descriptions. from config import * from channels import * import ahttp import json # di.fm class di (ChannelPlugin): # control flags has_search = False listformat = "pls" audioformat = "audio/aac" titles = dict(listeners=False, bitrate=False, playing=False) categories = ["di.fm", "sky.fm", "jazzradio.com"] # sky.fm is an alias of "radiotunes.com" # static def update_categories(self): pass # ignore category, because there is just but one def update_streams(self, cat, search=None): ls = json.loads(ahttp.get("http://listen.{}/public1".format(cat))) rows = [ dict(genre=row["key"], title=row["name"], url=row["playlist"], id=row["key"], homepage="http://www.{}/{}".format(cat, row["key"]), bitrate=64) for row in ls ] return rows |