Index: channels/myoggradio.py ================================================================== --- channels/myoggradio.py +++ channels/myoggradio.py @@ -4,11 +4,11 @@ # description: Open source internet radio directory. # type: channel # category: radio # version: 0.7 # url: http://www.myoggradio.org/ -# depends: json, StringIO, ahttp >= 1.2 +# depends: json, ahttp >= 1.5 # config: # { name: myoggradio_login, type: text, value: "user:password", description: "Account for storing personal favourites." } # { name: myoggradio_morph, type: boolean, value: 0, description: "Convert pls/m3u into direct shoutcast url." } # priority: standard # png: @@ -33,20 +33,19 @@ from uikit import uikit import ahttp import re import json -from compat2and3 import StringIO import copy from uikit import gtk # open source radio sharing stie class myoggradio(ChannelPlugin): # control flags - listformat = "mixed(pls/m3u/srv)" + listformat = "pls,m3u,srv" has_search = False api = "http://www.myoggradio.org/" # hide unused columns titles = dict(playing=False, listeners=False, bitrate=False) @@ -78,17 +77,17 @@ entries = [] # common if (cat == "common"): # fetch - data = ahttp.get(self.api + "common.json") - entries = json.load(StringIO(data)) + data = ahttp.get(self.api + "common.json", encoding="utf-8") + entries = json.loads(data) # bookmarks elif (cat == "personal") and self.user_pw(): - data = ahttp.get(self.api + "favoriten.json?user=" + self.user_pw()[0]) - entries = json.load(StringIO(data)) + data = ahttp.get(self.api + "favoriten.json?user=" + self.user_pw()[0], encoding="utf-8") + entries = json.loads(data) # unknown else: self.parent.status("Unknown category") pass