Check-in [c49eb0e669]
Overview
| Comment: | Stop vTuner page fetching depending on &iCurrPage=+1 presence. |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
c49eb0e6698c59e84124afb64b47176b |
| User & Date: | mario on 2016-08-24 01:22:27 |
| Other Links: | manifest | tags |
Context
|
2016-09-04
| ||
| 13:44 | Prepare for crontab mode check-in: 7f2050ecba user: mario tags: trunk | |
|
2016-08-24
| ||
| 01:22 | Stop vTuner page fetching depending on &iCurrPage=+1 presence. check-in: c49eb0e669 user: mario tags: trunk | |
| 01:21 | Minor text fixes check-in: ac7e0587e9 user: mario tags: trunk | |
Changes
Modified contrib/vtuner.py from [6735daab2e] to [c0139e2833].
1 2 3 4 5 | # encoding: UTF-8 # api: streamtuner2 # title: vTuner # url: http://vtuner.com/ # description: Huge station list by music service provider | | | 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.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 |
# 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))
# 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>
| > > > > | 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>
|
| ︙ | ︙ |