test
This commit is contained in:
parent
1eecd65ceb
commit
05fe02edec
@ -6,7 +6,7 @@ class OriginChannels():
|
||||
self.fhdhr = fhdhr
|
||||
self.origin = origin
|
||||
|
||||
self.base_api_url = "https://ott-gateway-stirr.sinclairstoryline.com/api/rest/v3/"
|
||||
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"
|
||||
|
||||
@ -16,30 +16,26 @@ class OriginChannels():
|
||||
|
||||
def get_channels(self):
|
||||
|
||||
url = self.base_api_url + "channels/stirr?station=national"
|
||||
urlopn = self.fhdhr.web.session.get(url)
|
||||
stirr_chan_list = urlopn.json()
|
||||
|
||||
"""
|
||||
{
|
||||
'display-name': 'dco',
|
||||
'icon': {
|
||||
'src': 'https://komonews.com/resources/media2/16x9/full/180/center/90/44e3adac-d9ed-4f62-b8e7-3bc5d09d94cc-medium16x9_STIRR_LOGO_0220_STIRRCity_1920x1080_EPG.png?1581116303431?cb=eccbc87e4b5ce2fe28308fd9f2a7baf3'
|
||||
},
|
||||
'id': '0cf15df7-1dbc-4dac-bc8d-867e8ab3d3cf'
|
||||
}
|
||||
"""
|
||||
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["channel"])
|
||||
|
||||
try:
|
||||
thumbnail = channel_dict["icon"]["src"].split("?")[0]
|
||||
except TypeError:
|
||||
thumbnail = None
|
||||
|
||||
clean_station_item = {
|
||||
"name": channel_dict["display-name"],
|
||||
# "name": stirr_chan_item["channel"]["display-name"],
|
||||
"callsign": channel_dict["display-name"],
|
||||
# "number": str(channel_dict["number"]),
|
||||
"id": str(channel_dict["id"]),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user