52 lines
1.8 KiB
Python
52 lines
1.8 KiB
Python
|
|
|
|
class OriginChannels():
|
|
|
|
def __init__(self, fhdhr, origin):
|
|
self.fhdhr = fhdhr
|
|
self.origin = origin
|
|
|
|
self.base_api_url = "https://ott-gateway-stirr.sinclairstoryline.com/api/rest/v3"
|
|
|
|
"https://ott-gateway-stirr.sinclairstoryline.com/api/rest/v3/channels/stirr?station=abc3340"
|
|
|
|
"https://ott-gateway-stirr.sinclairstoryline.com/api/rest/v3/status/40b80f75-2efc-49af-813b-2a674e69ea59"
|
|
|
|
"https://ott-gateway-stirr.sinclairstoryline.com/api/rest/v3/program/stirr/ott/"
|
|
|
|
def get_channels(self):
|
|
|
|
chan_list_url = "%s/channels/stirr?station=national" % (self.base_api_url)
|
|
chan_list_urlopn = self.fhdhr.web.session.get(chan_list_url)
|
|
stirr_chan_list = chan_list_urlopn.json()
|
|
|
|
channel_list = []
|
|
for channel_dict in stirr_chan_list["channel"]:
|
|
|
|
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()
|
|
|
|
print(stirr_chan_item)
|
|
return []
|
|
|
|
try:
|
|
thumbnail = channel_dict["icon"]["src"].split("?")[0]
|
|
except TypeError:
|
|
thumbnail = None
|
|
|
|
clean_station_item = {
|
|
# "name": stirr_chan_item["channel"]["display-name"],
|
|
"callsign": channel_dict["display-name"],
|
|
# "number": str(channel_dict["number"]),
|
|
"id": str(channel_dict["id"]),
|
|
"thumbnail": thumbnail
|
|
}
|
|
# channel_list.append(clean_station_item)
|
|
|
|
return channel_list
|
|
|
|
def get_channel_stream(self, chandict):
|
|
streamurl = ""
|
|
return streamurl
|