test
This commit is contained in:
parent
7fb52ba55e
commit
a7ff4acc16
@ -8,19 +8,22 @@ class OriginChannels():
|
|||||||
|
|
||||||
def get_channels(self):
|
def get_channels(self):
|
||||||
|
|
||||||
print(self.origin.channels_json_url)
|
self.fhdhr.logger.info("Pulling Unfiltered Channels Lists: %s" % self.origin.channels_json_url)
|
||||||
|
|
||||||
urlopn = self.fhdhr.web.session.get(self.origin.channels_json_url)
|
urlopn = self.fhdhr.web.session.get(self.origin.channels_json_url)
|
||||||
unfiltered_chan_json = urlopn.json()
|
unfiltered_chan_json = urlopn.json()
|
||||||
|
self.fhdhr.logger.info("Found %s Total Channels Lists" % len(unfiltered_chan_json))
|
||||||
print(unfiltered_chan_json[0])
|
|
||||||
print(len(unfiltered_chan_json))
|
|
||||||
|
|
||||||
filtered_chan_json = unfiltered_chan_json.copy()
|
filtered_chan_json = unfiltered_chan_json.copy()
|
||||||
for filter in ["country"]:
|
for filter in ["country", "language"]:
|
||||||
|
|
||||||
filterconf = self.fhdhr.config.dict["origin"]["filter_%s" % filter]
|
filterconf = self.fhdhr.config.dict["origin"]["filter_%s" % filter]
|
||||||
print(filterconf)
|
if filterconf:
|
||||||
|
if isinstance(filterconf, str):
|
||||||
|
filterconf = [filterconf]
|
||||||
|
self.fhdhr.logger.info("Found %s Enabled %s Filters" % (len(filterconf), filter))
|
||||||
|
print(filterconf)
|
||||||
|
else:
|
||||||
|
self.fhdhr.logger.info("Found No Enabled %s Filters" % (filter))
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user