Check-in [a18bd89956]
Overview
| Comment: | rm debugging output |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
a18bd899567ffc85643e357364d0e8e5 |
| User & Date: | mario on 2018-01-15 20:06:12 |
| Other Links: | manifest | tags |
Context
|
2018-07-05
| ||
| 03:46 | Fix missing os. import for find_executable fallback. check-in: 2c95973b5a user: mario tags: trunk | |
|
2018-01-15
| ||
| 20:06 | rm debugging output check-in: a18bd89956 user: mario tags: trunk | |
| 20:05 | Update delicast plugin for new q: url scheme check-in: 33053d07d0 user: mario tags: trunk | |
Changes
Modified contrib/radiolist.py from [bca1fb8450] to [1e251d9dec].
| ︙ | ︙ | |||
77 78 79 80 81 82 83 |
# extract stream urls
def update_streams(self, cat):
rx_title = re.compile('<a\s+href="([^">]+)"[^>]+target="_blank"[^>]*>(.+?)</a>', re.I)
rx_urls = re.compile('<a href="([^">]+)">(\d+)(?: Kbps)*</a>', re.I)
rx_genre = re.compile('<td[^>]+>(\w*[^<>]*)</td>\s*<td[^>]+>(\w+[^<>]+)</td>\s*$', re.I)
entries = []
html = ahttp.get("http://radiolist.net/" + self.catmap[cat])
| < < < | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# extract stream urls
def update_streams(self, cat):
rx_title = re.compile('<a\s+href="([^">]+)"[^>]+target="_blank"[^>]*>(.+?)</a>', re.I)
rx_urls = re.compile('<a href="([^">]+)">(\d+)(?: Kbps)*</a>', re.I)
rx_genre = re.compile('<td[^>]+>(\w*[^<>]*)</td>\s*<td[^>]+>(\w+[^<>]+)</td>\s*$', re.I)
entries = []
html = ahttp.get("http://radiolist.net/" + self.catmap[cat])
for block in re.findall("<tr>(.+?)</tr>", html, re.S):
ut = re.findall(rx_title, block) # homepage+title
uu = re.findall(rx_urls, block) # urls+bitrates
lg = re.findall(rx_genre, block) # location+genre
#print ut, uu, lg
if ut and uu and lg:
url, br = self.best_url(uu)
entries.append(dict(
homepage = ut[0][0],
title = unhtml(ut[0][1]),
url = url,
bitrate = br,
format = self.mime_guess(url, "audio/mpeg"),
|
| ︙ | ︙ |