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