def next_action(): valid = ustvnow.Ustvnow(self.get_value('email'), self.get_value('password'))._login() if not valid: xbmcgui.Dialog().ok( 'Login Error', 'Incorrect login.', 'Please check your email and password.', 'Sign up at http://www.ustvnow.com/newuser_usa.php') return False WM.next_page()
if Addon.get_setting('setup') == "false": win = xbmcgui.Window(10000) win.setProperty(addonname + '.setup', "true") xbmc.executebuiltin('RunScript("' + addonid + '", "")') while True: if win.getProperty(addonname + '.setup') == "false": break xbmc.sleep(250) Addon.plugin_url = sys.argv[0] Addon.plugin_handle = int(sys.argv[1]) Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:]) email = Addon.get_setting('email') password = Addon.get_setting('password') ustv = ustvnow.Ustvnow(email, password) Addon.log('plugin url: ' + Addon.plugin_url) Addon.log('plugin queries: ' + str(Addon.plugin_queries)) Addon.log('plugin handle: ' + str(Addon.plugin_handle)) mode = Addon.plugin_queries['mode'] if mode == 'main': Addon.log(mode) Addon.add_directory({'mode': 'live'}, Addon.get_string(30001)) Addon.add_directory({'mode': 'recordings'}, Addon.get_string(30002)) elif mode == 'live': Addon.log(mode) stream_type = ['rtmp', 'rtsp'][int(Addon.get_setting('stream_type'))]
if retval and len(retval) > 0: Addon.set_setting('email', str(retval)) email = Addon.get_setting('email') retval = dlg.input('Enter USTVnow Account Password', type=xbmcgui.INPUT_ALPHANUM) if retval and len(retval) > 0: Addon.set_setting('password', str(retval)) password = Addon.get_setting('password') if dlg.yesno("USTVnow", 'Are you a premium subscriber?'): Addon.set_setting('subscription', 'true') else: Addon.set_setting('subscription', 'false') if premium == False: Addon.set_setting('quality', '0') ustv = ustvnow.Ustvnow(email, password, premium) Addon.log('plugin url: ' + Addon.plugin_url) Addon.log('plugin queries: ' + str(Addon.plugin_queries)) Addon.log('plugin handle: ' + str(Addon.plugin_handle)) mode = Addon.plugin_queries['mode'] if mode == 'main': Addon.log(mode) Addon.add_directory({'mode': 'live'}, Addon.get_string(30001)) if premium == True: Addon.add_directory({'mode': 'recordings'}, Addon.get_string(30002)) elif mode == 'live': Addon.log(mode) stream_type = ['rtmp', 'rtsp'][int(Addon.get_setting('stream_type'))] channels = ustv.get_channels(int(Addon.get_setting('quality')),