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

⌈⌋ ⎇ branch:  streamtuner2


Check-in [405eaaa660]

Overview
Comment:Use shorter entity_decode() call. Strip example content.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 405eaaa660b19616b9400145c22418c32d27e089
User & Date: mario on 2015-05-02 19:53:57
Other Links: manifest | tags
Context
2015-05-02
19:54
Added default icons to dialog windows, and st2 logo to main window. Introduce more keyboard shortcuts (F6 favicons, Alt-F5 category reload, etc..) check-in: f18582ae4d user: mario tags: trunk
19:53
Use shorter entity_decode() call. Strip example content. check-in: 405eaaa660 user: mario tags: trunk
19:53
Allow to add custom statusmsg for lengthier HTTP requests. check-in: 4f285c3b31 user: mario tags: trunk
Changes

Modified channels/radionomy.py from [3d7226d120] to [b2195e3fad].

109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
        return r


    # Extracts the data- attribute JSON blob
    @use_rx
    def data_play_stream(self, html, use_rx):
        if use_rx:
            return [self.entity_decode(j) for j in re.findall('data-play-stream="({.*?})"', html)]
        else:
            # fix up for PyQuery, else ignores appended content
            html = re.sub("</html>|</body>", "", html) + "</body></html>"
            return [div.attrib["data-play-stream"] for div in pq(html)(".browseRadioWrap .radioPlayBtn")]


    # Retrieve en/OnAir/Update for per-UID song titles







|







109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
        return r


    # Extracts the data- attribute JSON blob
    @use_rx
    def data_play_stream(self, html, use_rx):
        if use_rx:
            return [entity_decode(j) for j in re.findall('data-play-stream="({.*?})"', html)]
        else:
            # fix up for PyQuery, else ignores appended content
            html = re.sub("</html>|</body>", "", html) + "</body></html>"
            return [div.attrib["data-play-stream"] for div in pq(html)(".browseRadioWrap .radioPlayBtn")]


    # Retrieve en/OnAir/Update for per-UID song titles
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
                    self.playing.update(
                      {row["RadioUID"]: "{Title} - {Artist}".format(**row) for row in d}
                    )
            except Exception as e:
                log.ERR("Radionomy title update:", e)

                


"""
<div id="tile-4f60d666-c9af-4e86-9ed1-7d4d488df430" class="browseRadioWrap">
	<a href="/en/radio/w1rs-blues--rock-s-radio/index" rel="internal"><img class="radioCover" src="https://i.radionomy.com/document/radios/4/4f60/4f60d666-c9af-4e86-9ed1-7d4d488df430.s67.jpg" alt="W1RS blues &amp; Rock&#39;s Radio" width="67" height="67"></a>
	<div class="radioInfo">
		<p class="radioName">W1RS blues &amp; Rock&#39;s Radio</p>
		<p class="nowPlaying" style="display: none;">
			<span class="artist">
				
			</span>
			<span class="separator">-</span>
			<span class="title">
				
			</span>
		</p>

		<div class="radioRating">
			<img src="/images/icons/icon-radioRatings-one.png" width="82" height="13" alt="Ratings">
			<a href="#" onclick="AddFavorite(&#39;4f60d666-c9af-4e86-9ed1-7d4d488df430&#39;, event); return false;" class="fav-icon addToFav">
				<img src="/images/icons/icon-radioActionsUnfav.png" width="13" height="13">
			</a>
		</div>
	</div>

	<div class="radioPlay">
		<div class="radioPlayBtn" data-play-stream="{
		&quot;mp3&quot;:
		&quot;http://listen.radionomy.com/w1rs-blues--rock-s-radio&quot;,
		&quot;title&quot;: &quot;W1RS blues &amp; Rock&#39;s
		Radio&quot;, &quot;isFavorite&quot;: false, &quot;url&quot;:
		&quot;w1rs-blues--rock-s-radio&quot;, &quot;logo&quot;:
		&quot;https://i.radionomy.com/document/radios/4/4f60/4f60d666-c9af-4e86-9ed1-7d4d488df430.s400.jpg&quot;,
		&quot;song&quot;: &quot; - &quot;, &quot;radioUID&quot;:
		&quot;4f60d666-c9af-4e86-9ed1-7d4d488df430&quot; }"></div>
		<!-- StopBtn -->
	</div>
</div>
"""        











<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
131
132
133
134
135
136
137











































                    self.playing.update(
                      {row["RadioUID"]: "{Title} - {Artist}".format(**row) for row in d}
                    )
            except Exception as e:
                log.ERR("Radionomy title update:", e)