Check-in [4723508e41]
Overview
Comment: | Fix association of surfmusik.de stream URLs to station titles. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
4723508e412b8642e2a3ee7c8289d2bf |
User & Date: | mario on 2014-05-13 22:12:22 |
Other Links: | manifest | tags |
Context
2014-05-13
| ||
23:55 | narrower options in settings dialog check-in: d6fb6f5d65 user: mario tags: trunk | |
22:12 | Fix association of surfmusik.de stream URLs to station titles. check-in: 4723508e41 user: mario tags: trunk | |
22:11 | Convert string to bytes for gzip-json writing (Python3) check-in: 77c8394885 user: mario tags: trunk | |
Changes
Modified channels/surfmusik.py from [d41a2be92b] to [6db3b80654].
︙ | ︙ | |||
87 88 89 90 91 92 93 94 95 96 | path = "land/" if path is not None: html = http.get(self.base + path + cat.lower() + ".html") html = re.sub("&#x?\d+;", "", html) rx_radio = re.compile(r""" <a\s+class="navil"\s+href="([^"]+)"[^>]*>([^<>]+)</a></td> <td\s+class="ort">(.*?)</td>.*? <td\s+class="ort">(.*?)</td>.*? | > < | | | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | path = "land/" if path is not None: html = http.get(self.base + path + cat.lower() + ".html") html = re.sub("&#x?\d+;", "", html) rx_radio = re.compile(r""" <td\s+class="home1"><a[^>]*\s+href="(.+?)"[^>]*> .*? <a\s+class="navil"\s+href="([^"]+)"[^>]*>([^<>]+)</a></td> <td\s+class="ort">(.*?)</td>.*? <td\s+class="ort">(.*?)</td>.*? """, re.X|re.I) rx_video = re.compile(r""" <a[^>]+href="([^"]+)"[^>]*>(?:<[^>]+>)*Externer """, re.X|re.I) # per-country list for uu in rx_radio.findall(html): (url, homepage, name, genre, stadt) = uu # find mms:// for webtv stations if is_tv: m = rx_video.search(http.get(url)) if m: url = m.group(1) # just convert /radio/ into /m3u/ link else: url = "http://www.surfmusik.de/m3u/" + url[30:-5] + ".m3u" entries.append({ "title": name, "homepage": homepage, "url": url, "playing": stadt, "genre": genre, |
︙ | ︙ |