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): url = self.base_api_url + "channels/stirr?station=national" urlopn = self.fhdhr.web.session.get(url) stirr_chan_list = urlopn.json() print(stirr_chan_list["channel"][0]) """ { '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' } """ channel_list = [] for channel_dict in stirr_chan_list: try: thumbnail = channel_dict["icon"]["src"].split("?")[0] except TypeError: thumbnail = None clean_station_item = { "name": channel_dict["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