test
This commit is contained in:
parent
802c016ee1
commit
f2399e8d35
@ -6,6 +6,17 @@ class OriginChannels():
|
|||||||
self.fhdhr = fhdhr
|
self.fhdhr = fhdhr
|
||||||
self.origin = origin
|
self.origin = origin
|
||||||
|
|
||||||
|
"""
|
||||||
|
{
|
||||||
|
'name': '23 ABC (KERO)',
|
||||||
|
'logo': 'https://scripps.com/wp-content/uploads/2019/01/local_media_23_abc.png',
|
||||||
|
'url': 'https://content.uplynk.com/channel/ff809e6d9ec34109abfb333f0d4444b5.m3u8',
|
||||||
|
'category': 'Local',
|
||||||
|
'language': [{'code': 'eng', 'name': 'English'}],
|
||||||
|
'country': {'code': 'us', 'name': 'United States'},
|
||||||
|
'tvg': {'id': None, 'name': None, 'url': None}}
|
||||||
|
"""
|
||||||
|
|
||||||
def get_channels(self):
|
def get_channels(self):
|
||||||
|
|
||||||
channel_list = []
|
channel_list = []
|
||||||
@ -19,16 +30,12 @@ class OriginChannels():
|
|||||||
self.fhdhr.logger.info("Found %s Channels after applying filters." % len(filtered_chan_list))
|
self.fhdhr.logger.info("Found %s Channels after applying filters." % len(filtered_chan_list))
|
||||||
|
|
||||||
for channel_dict in filtered_chan_list:
|
for channel_dict in filtered_chan_list:
|
||||||
print(channel_dict["name"])
|
|
||||||
"""
|
|
||||||
clean_station_item = {
|
clean_station_item = {
|
||||||
"name": channel_dict["name"],
|
"name": channel_dict["name"],
|
||||||
"callsign": channel_dict["config"]["callsign"],
|
"id": channel_dict["name"],
|
||||||
"id": channel_dict["identifier"],
|
"thumbnail": channel_dict["logo"],
|
||||||
"thumbnail": channel_dict["icon"],
|
|
||||||
}
|
}
|
||||||
channel_list.append(clean_station_item)
|
channel_list.append(clean_station_item)
|
||||||
"""
|
|
||||||
|
|
||||||
return channel_list
|
return channel_list
|
||||||
|
|
||||||
@ -78,5 +85,11 @@ class OriginChannels():
|
|||||||
return filtered_chan_list
|
return filtered_chan_list
|
||||||
|
|
||||||
def get_channel_stream(self, chandict):
|
def get_channel_stream(self, chandict):
|
||||||
streamurl = ""
|
urlopn = self.fhdhr.web.session.get(self.origin.channels_json_url)
|
||||||
|
chan_json = urlopn.json()
|
||||||
|
streamdict = self.get_channel_dict(chan_json, "name", chandict["origin_name"])
|
||||||
|
streamurl = streamdict["url"]
|
||||||
return streamurl
|
return streamurl
|
||||||
|
|
||||||
|
def get_channel_dict(self, chanlist, keyfind, valfind):
|
||||||
|
return next(item for item in chanlist if item[keyfind] == valfind) or None
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user