test
This commit is contained in:
parent
e3abe87b83
commit
1502c5b083
@ -1,7 +1,7 @@
|
||||
import datetime
|
||||
import time
|
||||
|
||||
from fHDHR.tools import hours_between_datetime
|
||||
from fHDHR.tools import hours_between_datetime, humanized_time
|
||||
|
||||
from .channel import Channel
|
||||
from .chan_ident import Channel_IDs
|
||||
@ -83,7 +83,11 @@ class 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("Performing Channel Import, This can take some time, Please wait.")
|
||||
|
||||
newchan = 0
|
||||
chan_scan_start = time.time()
|
||||
chan_import_time = None
|
||||
for channel_info in channel_dict_list:
|
||||
|
||||
chan_existing = False
|
||||
@ -99,6 +103,10 @@ class Channels():
|
||||
self.list[channel_id] = channel_obj
|
||||
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:
|
||||
newchan = "no"
|
||||
self.fhdhr.logger.info("Found %s NEW channels." % newchan)
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
import m3u8
|
||||
|
||||
import base64
|
||||
|
||||
|
||||
class OriginChannels():
|
||||
|
||||
@ -23,13 +21,7 @@ class OriginChannels():
|
||||
chan_list_urlopn = self.fhdhr.web.session.get(chan_list_url)
|
||||
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 = []
|
||||
return channel_list
|
||||
for channel_dict in stirr_chan_list["channel"]:
|
||||
|
||||
chan_item_url = "%s/status/%s" % (self.base_api_url, str(channel_dict["id"]))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user