Index: contrib/housemixes.py ================================================================== --- contrib/housemixes.py +++ contrib/housemixes.py @@ -2,11 +2,11 @@ # api: streamtuner2 # title: house-mixes # description: UK DJs house/techno mixes # type: channel # category: collection -# version: 0.6 +# version: 0.7 # url: http://www.house-mixes.com/ # config: # ( -x-off-name: housemixes_pages, type: int, value: 5, description: maximum number of pages to scan ) # priority: contrib # png: @@ -78,30 +78,69 @@ # 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)): + for i in range(2, 3):#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(".+?", "", html, 100, re.S) self.status("Extracting mixes…") + + + """ +
+
+
+ different mix (2) +
+ +

different mix (2)

+

By DJ RIKKI

+ +  21/09/2021 01:42:08 +01:00 + +
+ Chicago House +
+ +
+ 141 + 2 + 0 + 0 + 0 +
+ + +
+
+ """ # extract - for card in [pq(e) for e in pq(html).find(".card-audio")]: + for card in pq(html).find(".mix-item"): + print(card) + card = pq(card) r = { - "title": card(".card-audio-title span").text(), - "playing": card(".card-audio-user a").text(), - "genre": card(".card-tags a span").text(), - # url will be substitute later - "url": self.base_url + card(".audio-image-link").attr("href"), - "homepage": self.base_url + card(".audio-image-link").attr("href"), + "title": card("h3 a").attr("title"), + "playing": card("h4 span").text(), + "genre": card(".mix-item-genre").text(), + # stream url will later be substituted in .row() access + "url": self.base_url + (card(".img-container a").attr("href") or ""), + "homepage": self.base_url + (card(".img-container a").attr("href") or ""), # standard size 318x318 loads quicker - "img": card(".audio-image-link img").attr("src"), # re.sub("=318&", "=32&", ...) - "listeners": int(card("a.card-plays").text()), - "bitrate": sum(int(a) for a in card(".card-likes, .card-downloads, .card-favs").text().split()), + "img": card(".img-container img").attr("src"), # re.sub("=318&", "=32&", ...) + "listeners": int(card(".media-plays").text() or 0), + "bitrate": sum(int(a or 0) for a in card(".media-likes, .media-downloads, .media-favourites").text().split()), } streams.append(r) #log.DATA( streams ) return streams