Check-in [e9dc9616e1]
Overview
| Comment: | remove docblock, reinstate max_streams for loop. |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
e9dc9616e1153bfc5ff39de46ec4445c |
| User & Date: | mario on 2022-02-16 21:08:59 |
| Other Links: | manifest | tags |
Context
|
2022-02-17
| ||
| 06:17 | Migrate to JSON api check-in: a140e97c02 user: mario tags: trunk | |
|
2022-02-16
| ||
| 21:08 | remove docblock, reinstate max_streams for loop. check-in: e9dc9616e1 user: mario tags: trunk | |
| 08:54 | update selectors for extraction check-in: 1dcb8f6e6b user: mario tags: trunk | |
Changes
Modified contrib/housemixes.py from [b4dd575f14] to [10f6abce3b].
| ︙ | ︙ | |||
76 77 78 79 80 81 82 |
if not cat in self.catmap:
return
# collect
self.status(0.0)
html = ahttp.get(self.base_url + self.catmap[cat])
max = int(conf.max_streams) / 50 # or enable conf.housemixes_pages?
| | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
if not cat in self.catmap:
return
# collect
self.status(0.0)
html = ahttp.get(self.base_url + self.catmap[cat])
max = int(conf.max_streams) / 50 # or enable conf.housemixes_pages?
for i in range(2, int(max)):
self.status(float(i) / max)
if html.find("latest/" + str(i)):
html = html + ahttp.get(self.base_url + self.catmap[cat] + "/latest/%s" % i)
html = re.sub("</body>.+?<body>", "", html, 100, re.S)
self.status("Extracting mixesβ¦")
# extract
for card in pq(html).find(".mix-item"):
print(card)
card = pq(card)
r = {
"title": card("h3 a").attr("title"),
"playing": card("h4 span").text(),
|
| ︙ | ︙ |