Overview
Context
Changes
Modified channels/radionomy.py
from [b2195e3fad]
to [df5905438c] .
1
2
3
4
5
6
7
8
9
10
11
12 1
2
3
4
5
6
7
8
9
10
11
-
# encoding: UTF-8
# api: streamtuner2
# title: Radionomy
# description: Modern radio directory and streaming provider
# color: #ffcc77
# url: http://radionomy.com/
# version: 0.5
# type: channel
# category: radio
# config: -
# { name: radionomy_pages, type: int, value: 3, category: limit, description: Number of pages per category to scan. }
# { name: radionomy_update, type: boolean, value: 1, description: Also fetch OnAir updates about currently playing songs. }
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137 120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
-
+
-
-
-
-
+
+
+
+
+
+
# Retrieve en/OnAir/Update for per-UID song titles
def onair_update ( self , req ):
if conf . radionomy_update :
try :
d = json . loads (
ahttp . get ( "https://www.radionomy.com/en/OnAir/Update" , post = 1 , referer = req )
ahttp . get ( "https://www.radionomy.com/en/OnAir/Update" , post = 1 , referer = req )
)
if d :
self . playing . update (
{ row [ "RadioUID" ]: "{Title} - {Artist}" . format (** row ) for row in d }
)
if not d :
return
print d
self . playing . update (
{ row [ "RadioUID" ]: "{Title} - {Artist}" . format (** row ) for row in d }
)
except Exception as e :
log . ERR ( "Radionomy title update:" , e )