def profile_selection(): if not ( generic_utility.get_setting('selected_profile') or (generic_utility.get_setting('single_profile') == 'true')): profiles.choose() elif not (generic_utility.get_setting('single_profile') == 'true') and ( generic_utility.get_setting('show_profiles') == 'true'): profiles.choose() elif not ((generic_utility.get_setting('single_profile') and generic_utility.get_setting('show_profiles')) == 'true'): profiles.load()
def profile_selection(): if generic_utility.get_setting('single_profile') == 'false': if not generic_utility.get_setting('selected_profile') or generic_utility.get_setting('show_profiles') == 'true': profiles.choose() else: profiles.load() profiles.update_displayed()
def profile_selection(): if not ( generic_utility.get_setting('selected_profile') or (generic_utility.get_setting('single_profile') == 'true')): profiles.choose() elif not (generic_utility.get_setting('single_profile') == 'true') and ( generic_utility.get_setting('show_profiles') == 'true'): profiles.choose() elif not ((generic_utility.get_setting('single_profile') and generic_utility.get_setting('show_profiles')) == 'true'): profiles.load() profiles.update_displayed()
def profile_selection(): if generic_utility.get_setting('single_profile') == 'false': if not generic_utility.get_setting( 'selected_profile') or generic_utility.get_setting( 'show_profiles') == 'true': profiles.choose() else: profiles.load() profiles.update_displayed()
def login(): login_progress = xbmcgui.DialogProgress() login_progress.create('Netflix', utility.get_string(30200) + '...') utility.progress_window(login_progress, 25, utility.get_string(30201)) connect.session.cookies.clear() content = utility.decode(connect.load_site(utility.main_url + 'Login')) if not 'Sorry, Netflix ' in content: match = re.compile('name="authURL" value="(.+?)"', re.DOTALL).findall(content) utility.log('Setting authorization url: ' + match[0]) utility.set_setting('authorization_url', match[0]) match = re.compile('locale: "(.+?)"', re.DOTALL).findall(content) utility.set_setting('language', match[0]) post_data = {'authURL': utility.get_setting('authorization_url'), 'email': utility.get_setting('username'), 'password': utility.get_setting('password'), 'RememberMe': 'on'} utility.progress_window(login_progress, 50, utility.get_string(30202)) content = utility.decode(connect.load_site(utility.main_url + 'Login?locale=' + utility.get_setting('language'), post=post_data)) if 'id="page-LOGIN"' in content: utility.notification(utility.get_string(30303)) return False match = re.compile('"apiUrl":"(.+?)",').findall(content) utility.set_setting('api_url', match[0]) post_data = utility.my_list % utility.get_setting('authorization_url') content = utility.decode(connect.load_site(utility.evaluator(), post=post_data)) matches = json.loads(content)['value'] match = matches['lolomos'].keys() utility.set_setting('root_list', match[0]) match = matches['lists'].keys() utility.set_setting('my_list', match[1]) match = matches['lists'][utility.get_setting('my_list')]['trackIds']['trackId'] utility.set_setting('track_id', unicode(match)) connect.save_session() utility.progress_window(login_progress, 75, utility.get_string(30203)) if not (utility.get_setting('selected_profile') or (utility.get_setting('single_profile') == 'true')): profiles.choose() elif not (utility.get_setting('single_profile') == 'true') and (utility.get_setting('show_profiles') == 'true'): profiles.choose() elif not ((utility.get_setting('single_profile') and utility.get_setting('show_profiles')) == 'true'): profiles.load() #if not utility.get_setting('is_kid') == 'true': #match = re.compile('"version":{"app":"(.+?)"').findall(content) #utility.set_setting('lolomos', match[0]) #3a5922fa-a4a9-41d8-a08c-9e84c2d32be4_ROOT if login_progress: if not utility.progress_window(login_progress, 100, utility.get_string(30204)): return False xbmc.sleep(500) login_progress.close() return True else: utility.notification(utility.get_string(30300)) if login_progress: login_progress.close() return False
def profile_selection(): if generic_utility.get_setting("single_profile") == "false": if ( not generic_utility.get_setting("selected_profile") or generic_utility.get_setting("show_profiles") == "true" ): profiles.choose() else: profiles.load() profiles.update_displayed()
def login(): login_progress = xbmcgui.DialogProgress() login_progress.create('Netflix', utility.get_string(30200) + '...') utility.progress_window(login_progress, 25, utility.get_string(30201)) connect.session.cookies.clear() content = utility.decode(connect.load_site(utility.main_url + '/Login')) match = re.compile('"locale":"(.+?)"', re.DOTALL | re.IGNORECASE).findall(content) if match and not utility.get_setting('language'): utility.log('Setting language: ' + match[0]) utility.set_setting('language', match[0]) if not 'Sorry, Netflix ' in content: match = re.compile('id="signout".+?authURL=(.+?)"', re.DOTALL).findall(content) if match: utility.log('Setting authorization url: ' + match[0]) utility.set_setting('authorization_url', match[0]) if 'id="page-LOGIN"' in content: match = re.compile('name="authURL" value="(.+?)"', re.DOTALL).findall(content) utility.log('Setting authorization url: ' + match[0]) utility.set_setting('authorization_url', match[0]) post_data = {'authURL': match[0], 'email': utility.get_setting('username'), 'password': utility.get_setting('password'), 'RememberMe': 'on'} utility.progress_window(login_progress, 50, utility.get_string(30202)) content = utility.decode(connect.load_site(utility.main_url + '/Login?locale=' + utility.get_setting('language'), post=post_data)) if 'id="page-LOGIN"' in content: utility.notification(utility.get_string(30303)) return False match = re.compile('"locale":"(.+?)"', re.DOTALL | re.IGNORECASE).findall(content) if match and not utility.get_setting('language'): utility.log('Setting language: ' + match[0]) utility.set_setting('language', match[0]) match = re.compile('"country":"(.+?)"', re.DOTALL | re.IGNORECASE).findall(content) if match: utility.log('Setting country code: ' + match[0]) utility.set_setting('country_code', match[0]) connect.save_session() utility.progress_window(login_progress, 75, utility.get_string(30203)) if not (utility.get_setting('selected_profile') or (utility.get_setting('single_profile') == 'true')): profiles.choose() elif not (utility.get_setting('single_profile') == 'true') and (utility.get_setting('show_profiles') == 'true'): profiles.choose() elif not ( (utility.get_setting('single_profile') == 'true') and ( utility.get_setting('show_profiles') == 'true')): profiles.load() else: profiles.get_my_list_change_authorisation() if not utility.get_setting('is_kid') == 'true': content = utility.decode(connect.load_site(utility.main_url + '/browse')) match = re.compile('"version":{"app":"(.+?)"').findall(content) netflix_application, netflix_id = match[0].split('-') utility.set_setting('netflix_application', netflix_application) utility.set_setting('netflix_id', netflix_id) if login_progress: if not utility.progress_window(login_progress, 100, utility.get_string(30204)): return False xbmc.sleep(500) login_progress.close() return True else: utility.notification(utility.get_string(30300)) if login_progress: login_progress.close() return False
def choose_profile(): profiles.choose() profiles.update_displayed()
def login(): login_progress = xbmcgui.DialogProgress() login_progress.create('Netflix', utility.get_string(30200) + '...') utility.progress_window(login_progress, 25, utility.get_string(30201)) connect.session.cookies.clear() content = utility.decode(connect.load_site(utility.main_url + 'Login')) if not 'Sorry, Netflix ' in content: match = re.compile('name="authURL" value="(.+?)"', re.DOTALL).findall(content) utility.log('Setting authorization url: ' + match[0]) utility.set_setting('authorization_url', match[0]) match = re.compile('locale: "(.+?)"', re.DOTALL).findall(content) utility.set_setting('language', match[0]) post_data = { 'authURL': utility.get_setting('authorization_url'), 'email': utility.get_setting('username'), 'password': utility.get_setting('password'), 'RememberMe': 'on' } utility.progress_window(login_progress, 50, utility.get_string(30202)) content = utility.decode( connect.load_site(utility.main_url + 'Login?locale=' + utility.get_setting('language'), post=post_data)) if 'id="page-LOGIN"' in content: utility.notification(utility.get_string(30303)) return False match = re.compile('"apiUrl":"(.+?)",').findall(content) utility.set_setting('api_url', match[0]) post_data = utility.my_list % utility.get_setting('authorization_url') content = utility.decode( connect.load_site(utility.evaluator(), post=post_data)) matches = json.loads(content)['value'] match = matches['lolomos'].keys() utility.set_setting('root_list', match[0]) match = matches['lists'].keys() utility.set_setting('my_list', match[1]) match = matches['lists'][utility.get_setting( 'my_list')]['trackIds']['trackId'] utility.set_setting('track_id', unicode(match)) connect.save_session() utility.progress_window(login_progress, 75, utility.get_string(30203)) if not (utility.get_setting('selected_profile') or (utility.get_setting('single_profile') == 'true')): profiles.choose() elif not (utility.get_setting('single_profile') == 'true') and ( utility.get_setting('show_profiles') == 'true'): profiles.choose() elif not ((utility.get_setting('single_profile') and utility.get_setting('show_profiles')) == 'true'): profiles.load() #if not utility.get_setting('is_kid') == 'true': #match = re.compile('"version":{"app":"(.+?)"').findall(content) #utility.set_setting('lolomos', match[0]) #3a5922fa-a4a9-41d8-a08c-9e84c2d32be4_ROOT if login_progress: if not utility.progress_window(login_progress, 100, utility.get_string(30204)): return False xbmc.sleep(500) login_progress.close() return True else: utility.notification(utility.get_string(30300)) if login_progress: login_progress.close() return False
def login(): login_progress = xbmcgui.DialogProgress() login_progress.create('Netflix', utility.get_string(30200) + '...') utility.progress_window(login_progress, 25, utility.get_string(30201)) connect.session.cookies.clear() content = utility.decode(connect.load_site(utility.main_url + '/Login')) match = re.compile('"locale":"(.+?)"', re.DOTALL | re.IGNORECASE).findall(content) if match and not utility.get_setting('language'): utility.log('Setting language: ' + match[0]) utility.set_setting('language', match[0]) if not 'Sorry, Netflix ' in content: match = re.compile('id="signout".+?authURL=(.+?)"', re.DOTALL).findall(content) if match: utility.log('Setting authorization url: ' + match[0]) utility.set_setting('authorization_url', match[0]) if 'id="page-LOGIN"' in content: match = re.compile('name="authURL" value="(.+?)"', re.DOTALL).findall(content) utility.log('Setting authorization url: ' + match[0]) utility.set_setting('authorization_url', match[0]) post_data = { 'authURL': match[0], 'email': utility.get_setting('username'), 'password': utility.get_setting('password'), 'RememberMe': 'on' } utility.progress_window(login_progress, 50, utility.get_string(30202)) content = utility.decode( connect.load_site(utility.main_url + '/Login?locale=' + utility.get_setting('language'), post=post_data)) if 'id="page-LOGIN"' in content: utility.notification(utility.get_string(30303)) return False match = re.compile('"locale":"(.+?)"', re.DOTALL | re.IGNORECASE).findall(content) if match and not utility.get_setting('language'): utility.log('Setting language: ' + match[0]) utility.set_setting('language', match[0]) match = re.compile('"country":"(.+?)"', re.DOTALL | re.IGNORECASE).findall(content) if match: utility.log('Setting country code: ' + match[0]) utility.set_setting('country_code', match[0]) connect.save_session() utility.progress_window(login_progress, 75, utility.get_string(30203)) if not (utility.get_setting('selected_profile') or (utility.get_setting('single_profile') == 'true')): profiles.choose() elif not (utility.get_setting('single_profile') == 'true') and ( utility.get_setting('show_profiles') == 'true'): profiles.choose() elif not ((utility.get_setting('single_profile') == 'true') and (utility.get_setting('show_profiles') == 'true')): profiles.load() else: profiles.get_my_list_change_authorisation() if not utility.get_setting('is_kid') == 'true': content = utility.decode( connect.load_site(utility.main_url + '/browse')) match = re.compile('"version":{"app":"(.+?)"').findall(content) netflix_application, netflix_version = match[0].split('-') utility.set_setting('netflix_application', netflix_application) utility.set_setting('netflix_version', netflix_version) if login_progress: if not utility.progress_window(login_progress, 100, utility.get_string(30204)): return False xbmc.sleep(500) login_progress.close() return True else: utility.notification(utility.get_string(30300)) if login_progress: login_progress.close() return False