Internet radio browser GUI for music/video streams from various directory services.

βŒˆβŒ‹ βŽ‡ branch:  streamtuner2


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: e9dc9616e1153bfc5ff39de46ec4445c69798d93
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
83
84
85
86
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
122
123
124
125
126
127
128
129
130
131
132
133
        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, 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("</body>.+?<body>", "", html, 100, re.S)
        self.status("Extracting mixes…")


        """
<div class="mix-item ">
    <div class="mix-item-inner">
        <div class="img-container">
            <a href="/profile/DJ%20RIKKI/play/different-mix-2"><img src="https://static.house-mixes.com/s3/webmixes-images/accounts-152296/profileMain.jpg?width=360&amp;quality=45&amp;crop=true" data-src="https://static.house-mixes.com/s3/webmixes-images/accounts-152296/profileMain.jpg?width=360&amp;quality=45&amp;crop=true" alt="different mix (2)" class="img-responsive unveil-loaded"></a>
        </div>

        <h3><a href="/profile/DJ%20RIKKI/play/different-mix-2" title="different mix (2)"><span>different mix (2)</span></a></h3>
        <h4>By <span itemtype="http://schema.org/MusicGroup"><a href="/profile/DJ%20RIKKI"><span>DJ RIKKI</span></a></span></h4>

        <i class="fa fa-time"></i>&nbsp;<span class="fromNow media-time" title="2021-09-21T01:42:08" data-livestamp="2021-09-21T01:42:08">21/09/2021 01:42:08 +01:00</span>
       
        <div class="mix-item-genre">
            Chicago House
        </div>

        <div class="media-stats">
            <i class="fa fa-play-circle"></i> <a href="/stats/dj%20rikki/different-mix-2/plays/1"><span class="media-plays" data-rel="tooltip" title="" data-original-title="Total Plays: 141 - Weekly Plays: 141">141</span></a>
            <i class="fa fa-download"></i> <a href="/stats/dj%20rikki/different-mix-2/downloads/1"><span class="media-downloads" data-rel="tooltip" title="" data-original-title="Total Downloads: 2 - Weekly Downloads: 9">2</span></a>
            <i class="fa fa-thumbs-up"></i> <a href="/stats/dj%20rikki/different-mix-2/likes/1"><span class="media-likes" data-rel="tooltip" title="" data-original-title="Total Likes: 0 - Weekly Likes: 0">0</span></a>
            <i class="fa fa-heart"></i> <a href="/stats/dj%20rikki/different-mix-2/favourites/1"><span class="media-favourites" data-rel="tooltip" title="" data-original-title="Total Favourites: 0 - Weekly Favourites: 0">0</span></a>
            <i class="fa fa-comments-o"></i> <a href="/profile/DJ%20RIKKI/play/different-mix-2"><span class="media-comments" data-rel="tooltip" title="" data-original-title="Total Comments: 0 - Weekly Comments: 0">0</span></a>
        </div>
        
            <!--<div class="media-tags">
                    <i class="fa fa-folder-close-alt"></i>&nbsp;<span class="media-genre"><a href="/djmixes/chicago-house-dj-mixes" title="View Chicago House Mixes">Chicago House</a></span>

                    <div>
                        <i class="fa fa-tags"></i>
                            <a href="/tags/bad%20boy%20bill">bad boy bill</a>
                    </div>
                </div>-->
    </div>
</div>
        """
        
        # 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(),







|






<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







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(),