Index: channels/icast.py ================================================================== --- channels/icast.py +++ channels/icast.py @@ -82,15 +82,20 @@ # fetch multiple pages def api(self, method, path, params): r = [] while len(r) < int(conf.max_streams): - data = json.loads(ahttp.get( self.base + method + path, params)) + try: + data = ahttp.get(self.base + method + path, params) + data = json.loads(data) + except Exception as e: + log.ERR("No data/json received.", e) + return r r += data["stations"] if len(r) >= data["meta"]["total_count"] or len(data["stations"]) < 10: break else: params["page"] = int(data["meta"]["current_page"]) + 1 self.parent.status(params["page"] * 9.5 / float(conf.max_streams)) #log.DATA(data) return r