2016-05-08, 09:22
(2016-04-29, 09:56)dodoadoodoo Wrote:(2016-04-28, 20:00)JanneT Wrote: Hi guys,
I use this addon mainly to listen to live radio, and I realised that regardless what quality you selected in the settings, the audio was in the "normal" format 128Kbps. As a reslut, I did some changes to the create_live_channel function:
def create_live_channel(channel):
QUALITIES = ["lo", "normal", "hi"]
FORMATS = ["mp3", "aac"]
quality = plugin.get_setting('quality', choices=QUALITIES)
format = plugin.get_setting('format', choices=FORMATS)
name = channel['name']
id = channel['liveaudio']['id']
if quality == "normal":
url = "http://sverigesradio.se/topsy/direkt/" + str(id) + "." + format
else:
url = "http://sverigesradio.se/topsy/direkt/" + str(id) + "-" + quality + "." + format
logo = channel['image']
item = {'label': name, 'path': url, 'icon': logo, 'is_playable': True}
return item
As you can see from above, I also added the choice of setting the codec mp3 or aac.
And with this it's actually possible to change the quality and codec, at least for the live channels.
- Janne
Hej!
Nice work. Do you mind submitting a PR against my repo?
TIA
/D
Sorry, how do I do that? I'm not that familiar with the procedures