fHDHR_IPTVorg-US/origin/origin_epg.py
deathbybandaid dda6bba135 test
2020-12-09 12:02:45 -05:00

27 lines
803 B
Python

import datetime
class OriginEPG():
def __init__(self, fhdhr):
self.fhdhr = fhdhr
def update_epg(self, fhdhr_channels):
programguide = {}
todaydate = datetime.datetime.utcnow().date()
self.remove_stale_cache(todaydate)
for fhdhr_id in list(fhdhr_channels.list.keys()):
chan_obj = fhdhr_channels.list[fhdhr_id]
filtered_chan_dict = self.get_channel_dict(fhdhr_channels.origin.filtered_chan_list, "name", chan_obj.dict["origin_name"])
if str(chan_obj.dict["number"]) not in list(programguide.keys()):
programguide[str(chan_obj.dict["number"])] = chan_obj.epgdict
if filtered_chan_dict["tvg"]["url"]:
print(filtered_chan_dict["tvg"]["url"])
return programguide