for index in seasons_sorted:
for season_id in season_list:
season = season_list[season_id]
- if int(season['id']) == index:
+ if int(season['idx']) == index:
li = xbmcgui.ListItem(label=season['text'])
# add some art to the item
li = self._generate_art_info(entry=season, li=li)
# sort seasons by index by default (they´re coming back unsorted from the api)
seasons_sorted = []
for season_id in season_list:
- seasons_sorted.append(int(season_list[season_id]['id']))
+ seasons_sorted.append(int(season_list[season_id]['idx']))
seasons_sorted.sort()
return self.kodi_helper.build_season_listing(seasons_sorted=seasons_sorted, season_list=season_list, build_url=self.build_url)
if 'memberContext' in dict(item).keys():
for important_field in important_fields:
user_data.update({important_field: item['memberContext']['data']['userInfo'][important_field]})
- print '.............'
- print user_data
- print '.............'
return user_data
def _parse_profile_data (self, netflix_page_data):
for item in netflix_page_data:
if 'hasViewedRatingWelcomeModal' in dict(item).keys():
for profile_id in item:
- print '------------'
- print profile_id
- print '------------'
if self._is_size_key(key=profile_id) == False and type(item[profile_id]) == dict and item[profile_id].get('avatar', False) != False:
profile = {'id': profile_id}
for important_field in important_fields:
self.esn = self._parse_esn_data(netflix_page_data=netflix_page_data)
self.api_data = self._parse_api_base_data(netflix_page_data=netflix_page_data)
self.profiles = self._parse_profile_data(netflix_page_data=netflix_page_data)
- if self.user_data.get('bauthURL', False) == False:
- print '...............'
- print page_soup.text.find('authURL');
- print '...............'
-
def is_logged_in (self, account):
"""Determines if a user is already logged in (with a valid cookie),
for key in videos.keys():
if self._is_size_key(key=key) == False:
video_key = key
+ # get season index
+ sorting = {}
+ for idx in videos[video_key]['seasonList']:
+ if self._is_size_key(key=idx) == False and idx != 'summary':
+ sorting[int(videos[video_key]['seasonList'][idx][1])] = int(idx)
return {
season['summary']['id']: {
+ 'idx': sorting[season['summary']['id']],
'id': season['summary']['id'],
'text': season['summary']['name'],
'shortName': season['summary']['shortName'],