<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.netflix" name="Netflix" version="0.10.2" provider-name="libdev + jojo + asciidisco">
+<addon id="plugin.video.netflix" name="Netflix" version="0.10.3" provider-name="libdev + jojo + asciidisco">
<requires>
<import addon="xbmc.python" version="2.24.0"/>
<import addon="script.module.beautifulsoup4" version="4.3.2"/>
# Kodi Media Center language file
# Addon Name: Netflix
# Addon id: plugin.video.netflix
-# Addon version: 0.10.2
+# Addon version: 0.10.3
# Addon Provider: libdev + jojo + asciidisco
msgid ""
msgstr ""
# Kodi Media Center language file
# Addon Name: Netflix
# Addon id: plugin.video.netflix
-# Addon version: 0.10.2
+# Addon version: 0.10.3
# Addon Provider: libdev + jojo + asciidisco
msgid ""
msgstr ""
self.call_netflix_service({'method': 'switch_profile', 'profile_id': params['profile_id']})
# check login, in case of main menu
if 'action' not in params:
- self.kodi_helper.log('ES Called - Zeile 428')
self.establish_session(account=credentials)
return options
if 'error' in response:
# check if we do not have a valid session, in case that happens: (re)login
if self._is_expired_session(response=response):
- self.kodi_helper.log('ES Called - Zeile 499')
if self.establish_session(account=self.kodi_helper.get_credentials()):
return True
message = response['message'] if 'message' in response else ''
self.kodi_helper = kodi_helper
self.netflix_session = netflix_session
self.credentials = self.kodi_helper.get_credentials()
+ self.video_list_cache = {}
if self.credentials['email'] != '' and self.credentials['password'] != '':
if self.netflix_session.is_logged_in(account=self.credentials):
else:
self.netflix_session.login(account=self.credentials)
self.profiles = self.netflix_session.profiles
+ self._prefetch_user_video_lists()
else:
self.profiles = []
+ def _prefetch_user_video_lists (self):
+ for profile_id in self.profiles:
+ self.switch_profile({'profile_id': [profile_id]})
+ self.video_list_cache[profile_id] = self.fetch_video_list_ids({})
+ print self.video_list_cache
+
def is_logged_in (self, params):
if self.credentials['email'] == '' or self.credentials['password'] == '':
return False
return self.netflix_session.esn
def fetch_video_list_ids (self, params):
+ cached_list = self.video_list_cache.get(self.netflix_session.user_data['guid'], None)
+ if cached_list != None:
+ self.kodi_helper.log('Serving cached list for user: ' + self.netflix_session.user_data['guid'])
+ return cached_list
video_list_ids_raw = self.netflix_session.fetch_video_list_ids()
if 'error' in video_list_ids_raw:
return video_list_ids_raw
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)
- self.log('Found ESN "' + self.esn)
+ self.log('Found ESN "' + self.esn + '"')
return netflix_page_data