2023-05-03, 21:53
Looks like the channels URL is working again so if you go back to the old way, you should be good.
/lib/menus/channel.py
/lib/menus/channel.py
Code:
def getChannels(self):
success, region = self.auth.getRegionInfo()
if not success:
notificationDialog(LANGUAGE(30016))
return
USER_DMA = region['USER_DMA']
USER_OFFSET = region['USER_OFFSET']
subs = binascii.b2a_base64(str.encode(LEGACY_SUBS.replace('+', ','))).decode().strip()
channels_url = '%s/cms/publish3/domain/channels/v4/%s/%s/%s/1.json' % \
(self.endPoints['cms_url'], USER_OFFSET, USER_DMA, subs)
log('\r%s' % channels_url)
response = requests.get(channels_url, headers=HEADERS, verify=VERIFY)
if response is not None and response.status_code == 200:
response = response.json()
if 'subscriptionpacks' in response:
sub_packs = response['subscriptionpacks']
for sub_pack in sub_packs:
if 'channels' in sub_pack:
channel_names = ''
for channel in sub_pack['channels']:
if channel['network_affiliate_name'] is not None:
if 'Sling' not in channel['network_affiliate_name']:
if channel['channel_guid'] != '' and '"%s"' % channel['network_affiliate_name'] not in channel_names:
if channel['network_affiliate_name'] not in ('FOX', 'ABC', 'NBC', 'CBS'):
channel_names = '%s,"%s"' % (channel_names, channel['network_affiliate_name']) if channel_names != '' else '"%s"' %channel['network_affiliate_name']
temp_channel = Channel(channel['channel_guid'], self.endPoints, self.DB)
if temp_channel.GUID != '':
self.Channels[channel['channel_guid']] = temp_channel
query = "SELECT GUID FROM Channels WHERE Protected = 1"
try:
cursor = self.DB.cursor()
cursor.execute(query)
protected = cursor.fetchall()
for record in protected:
if record[0] not in self.Channels:
self.Channels[record[0]] = Channel(record[0], self.endPoints, self.DB)
except sqlite3.Error as err:
log('setSetting(): Failed retrieve protected records from DB, error => %s' % err)
except Exception as exc:
log('setSetting(): Failed retrieve protected records from DB, exception => %s' % exc)