This commit is contained in:
deathbybandaid 2020-12-15 11:12:03 -05:00
parent e3abe87b83
commit 1502c5b083
2 changed files with 9 additions and 9 deletions

View File

@ -1,7 +1,7 @@
import datetime import datetime
import time import time
from fHDHR.tools import hours_between_datetime from fHDHR.tools import hours_between_datetime, humanized_time
from .channel import Channel from .channel import Channel
from .chan_ident import Channel_IDs from .chan_ident import Channel_IDs
@ -83,7 +83,11 @@ class Channels():
channel_dict_list = self.origin.get_channels() channel_dict_list = self.origin.get_channels()
self.fhdhr.logger.info("Found %s channels for %s." % (len(channel_dict_list), self.fhdhr.config.dict["main"]["servicename"])) self.fhdhr.logger.info("Found %s channels for %s." % (len(channel_dict_list), self.fhdhr.config.dict["main"]["servicename"]))
self.fhdhr.logger.info("Performing Channel Import, This can take some time, Please wait.")
newchan = 0 newchan = 0
chan_scan_start = time.time()
chan_import_time = None
for channel_info in channel_dict_list: for channel_info in channel_dict_list:
chan_existing = False chan_existing = False
@ -99,6 +103,10 @@ class Channels():
self.list[channel_id] = channel_obj self.list[channel_id] = channel_obj
newchan += 1 newchan += 1
if not chan_import_time:
chan_import_time = time.time()
self.fhdhr.logger.info("Based On first channel import time, estimated time remaining %s" % humanized_time(chan_import_time - chan_scan_start))
if not newchan: if not newchan:
newchan = "no" newchan = "no"
self.fhdhr.logger.info("Found %s NEW channels." % newchan) self.fhdhr.logger.info("Found %s NEW channels." % newchan)

View File

@ -1,7 +1,5 @@
import m3u8 import m3u8
import base64
class OriginChannels(): class OriginChannels():
@ -23,13 +21,7 @@ class OriginChannels():
chan_list_urlopn = self.fhdhr.web.session.get(chan_list_url) chan_list_urlopn = self.fhdhr.web.session.get(chan_list_url)
stirr_chan_list = chan_list_urlopn.json() stirr_chan_list = chan_list_urlopn.json()
image_url = stirr_chan_list["channel"][0]["icon"]["src"].split("?")[0]
image_file = self.fhdhr.web.session.get(image_url).content
image_text = base64.b64encode(image_file)
print(image_text)
channel_list = [] channel_list = []
return channel_list
for channel_dict in stirr_chan_list["channel"]: for channel_dict in stirr_chan_list["channel"]:
chan_item_url = "%s/status/%s" % (self.base_api_url, str(channel_dict["id"])) chan_item_url = "%s/status/%s" % (self.base_api_url, str(channel_dict["id"]))