img=xbmc.translatePath( os.path.join(plugin_path, 'resources', 'images', 'freeform_main.png'))) Addon.add_directory({'mode': 'hgtv_main'}, 'HGTV', img=xbmc.translatePath( os.path.join(plugin_path, 'resources', 'images', 'hgtv_main.png'))) Addon.add_directory({'mode': 'travel_main'}, 'Travel Channel', img=xbmc.translatePath( os.path.join(plugin_path, 'resources', 'images', 'travel_main.png'))) if len(Addon.get_setting('notify')) > 0: Addon.set_setting('notify', str(int(Addon.get_setting('notify')) + 1)) else: Addon.set_setting('notify', "1") if int(Addon.get_setting('notify')) == 1: dlg.notification(addonname + ' is provided by:', 'Mr.Blamo', brand_logo, 5000, False) elif int(Addon.get_setting('notify')) == 9: Addon.set_setting('notify', "0") #VPN Message if int(Addon.get_setting('vpn')) != 1: dlg.ok( addonname, "If you are outside the USA, you might want to consider subscribing to a VPN service in order to take full advantage of this addon.[/COLOR]" ) Addon.set_setting('vpn', "1")
email = Addon.get_setting('email') password = Addon.get_setting('password') premium = Addon.get_setting('subscription') == "true" premium_last = Addon.get_setting('subscription_last') == "true" dlg = xbmcgui.Dialog() addon = xbmcaddon.Addon(id='plugin.video.ustvnow') plugin_path = addon.getAddonInfo('path') write_path = xbmc.translatePath(Addon.get_setting('write_folder')) from resources.lib import ustvnow_new ustv = ustvnow_new.Ustvnow(email, password, premium) if premium != premium_last: ustv.clearCache() Addon.set_setting('subscription_last', Addon.get_setting('subscription')) if not email: dlg.ok("USTVnow", "Please visit www.ustvnow.com", "and register for your login credentials") retval = dlg.input('Enter USTVnow Account Email', type=xbmcgui.INPUT_ALPHANUM) 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')
ustv = ustvnow.Ustvnow(email, password) dlg = xbmcgui.Dialog() Addon.log('plugin url: ' + Addon.plugin_url) Addon.log('plugin queries: ' + str(Addon.plugin_queries)) Addon.log('plugin handle: ' + str(Addon.plugin_handle)) quality_type = int(Addon.get_setting('quality')) if setup != 'true': dlg.ok(Addon.get_string(30000),Addon.get_string(20002),Addon.get_string(20003)) # Enter Email retval = dlg.input(Addon.get_string(20004), type=xbmcgui.INPUT_ALPHANUM) if retval and len(retval) > 0: Addon.set_setting('email', str(retval)) email = Addon.get_setting('email') # Enter Password retval = dlg.input(Addon.get_string(20005), type=xbmcgui.INPUT_ALPHANUM, option=xbmcgui.ALPHANUM_HIDE_INPUT) if retval and len(retval) > 0: Addon.set_setting('password', str(retval)) password = Addon.get_setting('password') if len(Addon.get_setting('email')) > 0 and len(Addon.get_setting('password')) > 0: Addon.set_setting('setup', 'true') dlg.ok(Addon.get_string(30000), Addon.get_string(200001), Addon.get_string(200000)) else: dlg.ok(Addon.get_string(30000), Addon.get_string(20002),Addon.get_string(20003)) mode = Addon.plugin_queries['mode'] if mode == 'main':
import urllib import xbmc, xbmcgui, xbmcplugin 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') premium = Addon.get_setting('subscription') == "true" dlg = xbmcgui.Dialog() if not email: retval = dlg.input('Enter USTVnow Account Email', type=xbmcgui.INPUT_ALPHANUM) if retval and len(retval) > 0: Addon.set_setting('email', str(retval)) email = Addon.get_setting('email') if not password: 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 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))
dlg = xbmcgui.Dialog() Addon.log('plugin url: ' + Addon.plugin_url) Addon.log('plugin queries: ' + str(Addon.plugin_queries)) Addon.log('plugin handle: ' + str(Addon.plugin_handle)) quality_type = int(Addon.get_setting('quality')) if setup != 'true': dlg.ok(Addon.get_string(30000), Addon.get_string(20002), Addon.get_string(20003)) # Enter Email retval = dlg.input(Addon.get_string(20004), type=xbmcgui.INPUT_ALPHANUM) if retval and len(retval) > 0: Addon.set_setting('email', str(retval)) email = Addon.get_setting('email') # Enter Password retval = dlg.input(Addon.get_string(20005), type=xbmcgui.INPUT_ALPHANUM, option=xbmcgui.ALPHANUM_HIDE_INPUT) if retval and len(retval) > 0: Addon.set_setting('password', str(retval)) password = Addon.get_setting('password') if len(Addon.get_setting('email')) > 0 and len( Addon.get_setting('password')) > 0: Addon.set_setting('setup', 'true') dlg.ok(Addon.get_string(30000), Addon.get_string(200001), Addon.get_string(200000)) else: dlg.ok(Addon.get_string(30000), Addon.get_string(20002),
email = Addon.get_setting('email') password = Addon.get_setting('password') premium = Addon.get_setting('subscription') == "true" premium_last = Addon.get_setting('subscription_last') == "true" dlg = xbmcgui.Dialog() addon = xbmcaddon.Addon(id='plugin.video.ustvnow') plugin_path = addon.getAddonInfo('path') write_path = xbmc.translatePath(Addon.get_setting('write_folder')) from resources.lib import ustvnow_new ustv = ustvnow_new.Ustvnow(email, password, premium) if premium != premium_last: ustv.clearCache() Addon.set_setting('subscription_last', Addon.get_setting('subscription')) if not email: dlg.ok("USTVnow", "Please visit www.ustvnow.com", "and register for your login credentials") retval = dlg.input('Enter USTVnow Account Email', type=xbmcgui.INPUT_ALPHANUM) 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?'):
import urllib import xbmc, xbmcgui, xbmcplugin 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') premium = Addon.get_setting('subscription') == "true" dlg = xbmcgui.Dialog() if not email: retval = dlg.input('Enter USTVnow Account Email', type=xbmcgui.INPUT_ALPHANUM) if retval and len(retval) > 0: Addon.set_setting('email', str(retval)) email = Addon.get_setting('email') if not password: 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 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))
write_path = xbmc.translatePath(os.path.join(plugin_path, 'resources', 'guide')) setup = Addon.get_setting('setup') setup_new = Addon.get_setting('setup_new') email = Addon.get_setting('email') password = Addon.get_setting('password') ustv = ustvnow_plus.Ustvnow(email, password) dlg = xbmcgui.Dialog() Addon.log('plugin url: ' + Addon.plugin_url) Addon.log('plugin queries: ' + str(Addon.plugin_queries)) Addon.log('plugin handle: ' + str(Addon.plugin_handle)) if int(Addon.get_setting('quality')) < 0: Addon.set_setting('quality', '0') elif int(Addon.get_setting('quality')) > 3: Addon.set_setting('quality', '3') if int(Addon.get_setting('rec_quality')) < 0: Addon.set_setting('rec_quality', '0') elif int(Addon.get_setting('rec_quality')) > 2: Addon.set_setting('rec_quality', '2') quality_type = int(Addon.get_setting('quality')) rec_quality_type = int(Addon.get_setting('rec_quality')) if setup != 'true': dlg.ok(Addon.get_string(30000),Addon.get_string(20002),Addon.get_string(20003)) # Enter Email
import xbmc, xbmcgui, xbmcplugin 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') premium = Addon.get_setting('subscription') == "true" dlg = xbmcgui.Dialog() if not email: dlg.ok("USTVnow", "Please visit www.ustvnow.com", "and register for your login credentials") retval = dlg.input('Enter USTVnow Account Email', type=xbmcgui.INPUT_ALPHANUM) 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)
import xbmc, xbmcgui, xbmcplugin 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') premium = Addon.get_setting('subscription') == "true" dlg = xbmcgui.Dialog() if not email: retval = dlg.input('Enter USTVnow Account Email', type=xbmcgui.INPUT_ALPHANUM) if retval and len(retval) > 0: Addon.set_setting('email', str(retval)) email = Addon.get_setting('email') if not password: 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 premium == False: Addon.set_setting('quality', '0') ustv = ustvnow.Ustvnow(email, password, premium) Addon.log('plugin url: ' + Addon.plugin_url)
addon = xbmcaddon.Addon(id='plugin.video.ustvnow') plugin_path = addon.getAddonInfo('path') THUMB = os.path.join(plugin_path,'icon.png') while (not xbmc.abortRequested): if int(Addon.get_setting('write_type')) != 0: if int(Addon.get_setting('write_type')) in [2,3]: MSG = 'M3U' else: MSG = 'STRM' now = datetime.datetime.today() try: Update_LastRun = Addon.get_setting("Update_NextRun") if not Update_LastRun: raise exception() except: Update_LastRun = "1970-01-01 23:59:00.000000" Addon.set_setting('Update_NextRun', str(Update_LastRun)) try: SyncUpdate = datetime.datetime.strptime(Update_LastRun, "%Y-%m-%d %H:%M:%S.%f") except: SyncUpdate = datetime.datetime.strptime(Update_LastRun, "%Y-%m-%d %H:%M:%S.%f") if now > SyncUpdate: fpath = os.path.join(Addon.get_setting('write_folder'), 'xmltv.xml') xbmc.executebuiltin("XBMC.RunPlugin(plugin://plugin.video.ustvnow/?file=%s&mode=guidedata)" %urllib.quote(fpath)) xbmc.executebuiltin("XBMC.RunPlugin(plugin://plugin.video.ustvnow/?mode=playlist)") xbmc.executebuiltin("Notification( %s, %s, %d, %s)" % ("USTVnow", "%s/XMLTV Updated" %MSG, 1000, THUMB) ) Update_NextRun = ((now + datetime.timedelta(hours=6)).strftime("%Y-%m-%d %H:%M:%S.%f")) Addon.set_setting('Update_NextRun', str(Update_NextRun)) xbmc.sleep(150000)