test
This commit is contained in:
parent
2d5ca0d90d
commit
6234bc25bc
@ -1,4 +1,5 @@
|
||||
import m3u8
|
||||
import json
|
||||
|
||||
|
||||
class OriginChannels():
|
||||
@ -50,22 +51,27 @@ class OriginChannels():
|
||||
|
||||
chan_item_url = "%s/status/%s" % (self.base_api_url, str(channel_dict["id"]))
|
||||
chan_item_urlopn = self.fhdhr.web.session.get(chan_item_url)
|
||||
stirr_chan_item = chan_item_urlopn.json()
|
||||
|
||||
channel_ids.append(str(channel_dict["id"]))
|
||||
|
||||
try:
|
||||
thumbnail = channel_dict["icon"]["src"].split("?")[0]
|
||||
except TypeError:
|
||||
thumbnail = None
|
||||
stirr_chan_item = chan_item_urlopn.json()
|
||||
except json.JSONDecodeError:
|
||||
stirr_chan_item = None
|
||||
|
||||
clean_station_item = {
|
||||
"name": stirr_chan_item['rss']["channel"]["title"],
|
||||
"callsign": channel_dict["display-name"],
|
||||
"id": str(channel_dict["id"]),
|
||||
"thumbnail": thumbnail
|
||||
}
|
||||
channel_list.append(clean_station_item)
|
||||
if stirr_chan_item:
|
||||
|
||||
channel_ids.append(str(channel_dict["id"]))
|
||||
|
||||
try:
|
||||
thumbnail = channel_dict["icon"]["src"].split("?")[0]
|
||||
except TypeError:
|
||||
thumbnail = None
|
||||
|
||||
clean_station_item = {
|
||||
"name": stirr_chan_item['rss']["channel"]["title"],
|
||||
"callsign": channel_dict["display-name"],
|
||||
"id": str(channel_dict["id"]),
|
||||
"thumbnail": thumbnail
|
||||
}
|
||||
channel_list.append(clean_station_item)
|
||||
|
||||
return channel_list
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user