Index: contrib/radionet.py ================================================================== --- contrib/radionet.py +++ contrib/radionet.py @@ -1,11 +1,11 @@ # encoding: UTF-8 # api: streamtuner2 # title: radio.net # description: Europe's biggest radio platform # url: http://radio.net/ -# version: 1.1 +# version: 1.2 # type: channel # category: radio # png: # iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAt0lEQVR42mNgYGD4r+Ar/F/BDwkD+SBxojBMs1mLPBArgGlFqEEENYMNQNLsukIDYkirAvGu # ABsA1OC6XOP/5f8nwIaYAg0k2gBFsAsgTgcZkvnfDugFEeK9AFKsCPMG0CU6eZJgQ4R1eP8H7LLEivWyFJANQcQCLPBAmkGG4MJohmA6C6QA5gI5OxEUDNII @@ -112,36 +112,25 @@ imgs = dict(re.findall('\],"id":"(\w+)","logo100x100":"(htt[^"]+)",', html)) #log.DATA(imgs) # top 100 of the most horrible html serializations """ -
RDS - Radio - Dimensione Suono
Rome, Italy / Hits, Pop, Top 40 & Charts
- -
102.7 KIIS FM
Los Angeles, USA / Top 40 & Charts, - Hits
+
1LIVE
Cologne, + Pop
""" rx = re.compile(""" - ]*\\bhref="(?:https?:)?(?://(?:[\w-]+)\.radio\.net)?/s/([^"]+)/?"> .*? - ]+> (\w[^<]+)
\s* - ]+> (\w[^/]+) \s+ / \s+ (\w.+?) + ]*\\bhref="(?:https?:)?(?://(?:[\w-]+)\.radio\.net)?/s/([^"]+)/?"> .{0,500}? + ]+> (\w[^<]+) .*? + ]+> (\w[^/,]+) \s* [,/] \s+ (\w.+?) """, re.X|re.S ) # extract text fields for d in re.findall(rx, html): #log.DATA_ROW(d) @@ -164,11 +153,11 @@ ls = [] for js in ls_json: js = json.loads(js) #print(json.dumps(js, indent=4)) ls += js["props"]["pageProps"]["data"]["stations"]["playables"] - #ls += js[data]["topTenStations"]#["playables"] + #ls += js["data"]["stations"]["playables"] r = [] for row in ls: href = row["id"] r.append(dict( name = href,