1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
# encoding: UTF-8
# api: streamtuner2
# title: vTuner
# url: http://vtuner.com/
# description: Huge station list by music service provider
# version: 0.3
# version: 0.4
# type: channel
# category: radio
# config:
# { name: vtuner_pages, value: 1, type: int, description: "Number of pages to fetch." }
# { name: vtuner_order, value: POP, type: select, select: "POP=Popularity|AA=Alphabetically|HBR=Quality|RELI=Uptime|OP=Country", description: "Station sorting order." }
# priority: contrib
# png:
|
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
+
+
+
+
|
# fetchy fetch
def update_streams(self, cat):
entries = []
html = ""
for i in xrange(1, int(conf.vtuner_pages) + 1):
html = html + ahttp.get(self.base_url % (cat, conf.vtuner_order, i))
# cancel page scan if no further result links
if not re.search(r"""<A HREF="[^>]+&iCurrPage=%s">""" % (i + 1), html, re.I):
log.DATA("No further results at page %s" % i)
break
# crude <tr> extraction
rx_radio = re.compile(r"""
<a\s+href="\.\./func/dynampls.asp\?link=1&id=(\d+)">([^<>]+)</a>
.+? "middle">([^<>]+)</td>
.+? Category.+?>([^<>]+)</td>
.+? <td.+?>(\w+) (\d+)K</td>
|