Index: contrib/radionet.py ================================================================== --- contrib/radionet.py +++ contrib/radionet.py @@ -99,11 +99,11 @@ html += ahttp.get(self.genre_url.format(urlcat) + "?p={}".format(p)) self.set_key(html) r = [] # fetch JSON - ls_json = re.findall("__CONTEXT_PROVIDER__\s*=\s*(\{.+\});", html) + ls_json = re.findall("]*>(\{.+?\})[;<]", html) if ls_json: try: return self.from_json(ls_json) except: log.error("JSON extraction failed", traceback.format_exc()) @@ -161,13 +161,14 @@ # process json def from_json(self, ls_json): ls = [] for js in ls_json: - js = json.loads(js)["data"] - print(json.dumps(js, indent=4)) - ls += js["topTenStations"]#["playables"] + js = json.loads(js) + #print(json.dumps(js, indent=4)) + ls += js["props"]["pageProps"]["data"]["stations"]["playables"] + #ls += js[data]["topTenStations"]#["playables"] r = [] for row in ls: href = row["id"] r.append(dict( name = href,