Index: contrib/radionet.py ================================================================== --- contrib/radionet.py +++ contrib/radionet.py @@ -42,12 +42,24 @@ title = r" (?x) \"(?:description|seoTitle)\" \s*:\s* \"([^\"]+)\" ", unesc = "json", ) -# Radio.net extraction relies on HTML grepping, finding an api key required for station details, -# and letting the action module extract the station/stream URL from that JSON format. +# Radio.net +# +# · Uses HTML block-wise regex extraction. +# → +# +# · There's an API key in each page listing, contained in a script block +# as `apiKey: '…'?` +# +# · Which is needed for generating the station info JSON urls: +# → https://api.radio.net/info/v2/search/station?apikey=…&pageindex=1&station=STNAME +# +# · To extract these JSON info targets, a custom extraction recipie is injected +# into the action module. +# → "streamUrl": and "description": are scanned for. # class radionet (ChannelPlugin): # control flags has_search = False @@ -77,35 +89,17 @@ for p in range(2, 4): if html.find('"?p={}">'.format(p)) >= 0: html += ahttp.get(self.genre_url.format(cat) + "?p={}".format(p)) self.set_key(html) r = [] - """ -
Fresh pop music, R'n'B, the newest chart hits and the Top 40 can all be found on this Internet radio station, ANTENNE BAYERN.
-
- - - ANTENNE FRANKFURT 95.1 - - - antenne frankfurt 95.1 - - - Frankfurt am Main, Germany / Charts, News, Pop, Top 40, News, Weather - - - - - - - """ + # split station blocks for row in re.split("""
]+)" .*? ]*>(.*?) .*? ]*>\s*(.*?)\s* .*? """, row, re.X|re.S)