Check-in [6811f698e7]
Overview
| Comment: | Adapted extraction regex slightly. |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
6811f698e741de06529f9c1c6ccd9c1c |
| User & Date: | mario on 2016-06-27 00:09:02 |
| Other Links: | manifest | tags |
Context
|
2016-06-27
| ||
| 22:43 | di.fm/sky.fm/jazzradio removed, no longer support direct streams (direct access won't work unless audio players also fake a browser user-agent) check-in: 8563285a2b user: mario tags: trunk | |
| 00:09 | Adapted extraction regex slightly. check-in: 6811f698e7 user: mario tags: trunk | |
|
2016-06-23
| ||
| 20:19 | Some types and pluginmanager2 notes (user-local versions vs. sys-wide plugins). check-in: dd6b528646 user: mario tags: trunk | |
Changes
Modified contrib/radionet.py from [fd082e7fa6] to [9e4f869065].
1 2 3 4 5 | # encoding: UTF-8 # api: streamtuner2 # title: radio.net # description: Europe's biggest radio platform # url: http://radio.net/ | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 | # encoding: UTF-8 # api: streamtuner2 # title: radio.net # description: Europe's biggest radio platform # url: http://radio.net/ # version: 0.5 # type: channel # category: radio # png: # iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAt0lEQVR42mNgYGD4r+Ar/F/BDwkD+SBxojBMs1mLPBArgGlFqEEENYMNQNLsukIDYkirAvGu # ABsA1OC6XOP/5f8nwIaYAg0k2gBFsAsgTgcZkvnfDugFEeK9AFKsCPMG0CU6eZJgQ4R1eP8H7LLEivWyFJANQcQCLPBAmkGG4MJohmA6C6QA5gI5OxEUDNII # MwSvASBFIA3ociCxkWQAKMDICkSQIpgh2LDnSmP80YhsCFEJiRIMADpmeUOpqgjRAAAAAElFTkSuQmCC # priority: optional |
| ︙ | ︙ | |||
77 78 79 80 81 82 83 84 85 86 |
if html.find('"?p={}">'.format(p)) >= 0:
html += ahttp.get(self.genre_url.format(cat) + "?p={}".format(p))
self.set_key(html)
r = []
# split station blocks
for row in re.split("""<div class="stationinfo""", html):
# extract text fields
d = re.findall("""
| > | | | | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
if html.find('"?p={}">'.format(p)) >= 0:
html += ahttp.get(self.genre_url.format(cat) + "?p={}".format(p))
self.set_key(html)
r = []
# split station blocks
for row in re.split("""<div class="stationinfo""", html):
print row
# extract text fields
d = re.findall("""
<a\s+href="(//([\w-]+)\.radio\.net/?)" .*?
<img\s+src="([^<">]+)" .*?
<strong[^>]*>(.*?)</strong> .*?
<small[^>]*>\s*(.*?)\s*</small> .*?
""", row, re.X|re.S)
# refurbish extracted strings
if d and len(d) and len(d[0]) == 5:
href, name, img, title, desc = d[0]
r.append(dict(
name = name,
|
| ︙ | ︙ |