def PARENTAL_CONTROLS_PIN(): vq = common._get_keyboard(heading="Please Set Password") if (not vq): dialog.ok(AddonTitle, "Sorry, no password was entered.") sys.exit(0) pass_one = vq vq = common._get_keyboard(heading="Please Confirm Your Password") if (not vq): dialog.ok(AddonTitle, "Sorry, no password was entered.") sys.exit(0) pass_two = vq if not os.path.exists(PARENTAL_FILE): if not os.path.exists(PARENTAL_FOLDER): os.makedirs(PARENTAL_FOLDER) open(PARENTAL_FILE, 'w') if pass_one == pass_two: #writeme = base64.b64encode(pass_one) writeme = hashlib.sha256(pass_one).hexdigest() f = open(PARENTAL_FILE, 'w') f.write('<password>' + str(writeme) + '</password>') f.close() dialog.ok( AddonTitle, 'Your password has been set and parental controls have been enabled.' ) xbmc.executebuiltin("Container.Refresh") else: dialog.ok(AddonTitle, 'The passwords do not match, please try again.') sys.exit(0) else: os.remove(PARENTAL_FILE) if pass_one == pass_two: #writeme = base64.b64encode(pass_one) writeme = hashlib.sha256(pass_one).hexdigest() f = open(PARENTAL_FILE, 'w') f.write('<password>' + str(writeme) + '</password>') f.close() dialog.ok( AddonTitle, 'Your password has been set and parental controls have been enabled.' ) xbmc.executebuiltin("Container.Refresh") else: dialog.ok(AddonTitle, 'The passwords do not match, please try again.') sys.exit(0)
def PARENTAL_CONTROLS_OFF(): vq = common._get_keyboard(heading="Please Enter Your Password") if (not vq): dialog.ok(AddonTitle, "Sorry, no password was entered.") sys.exit(0) pass_one = hashlib.sha256(vq).hexdigest() vers = open(PARENTAL_FILE, "r") regex = re.compile(r'<password>(.+?)</password>') for line in vers: file = regex.findall(line) for password in file: if not password == pass_one: vers.close() dialog.ok(AddonTitle, "Sorry, the password you entered was incorrect.") quit() vers.close() try: os.remove(PARENTAL_FILE) dialog.ok(AddonTitle, 'Parental controls have been disabled.') xbmc.executebuiltin("Container.Refresh") except: dialog.ok(AddonTitle, 'There was an error disabling the parental controls.') xbmc.executebuiltin("Container.Refresh")
def SHOWPROTECTEDBUILDS(name, url, description): desca = description developer = desca.split(',')[0] hidden = desca.split(',')[1] try: youtube_id = desca.split(',')[2] except: youtube_id = "null" try: link = Common.OPEN_URL(url).replace('\n', '').replace('\r', '') match = re.compile('notice="(.+?)"').findall(link) for notice in match: dialog.ok(AddonTitle, '[COLOR red][B]' + notice + '[/B][/COLOR]') except: pass vq = Common._get_keyboard(heading="Please Enter Your Password") if (not vq): return False, 0 title = vq if "http" not in hidden: AUTH = BASEURL + "community/protected/" + hidden + '.txt' else: AUTH = hidden passed = 0 link = Common.OPEN_URL(AUTH).replace('\n', '').replace('\r', '') match = re.compile('passkey="(.+?)"').findall(link) for passkey in match: if title == passkey: passed = 1 if passed == 0: dialog.ok(AddonTitle, "Sorry the password entered was not found.", '[COLOR smokewhite]Thank you for using ECHO Wizard[/COLOR]') sys.exit(0) link = Common.OPEN_URL(url).replace('\n', '').replace('\r', '') match = re.compile( 'name="(.+?)".+?rl="(.+?)".+?mg="(.+?)".+?anart="(.+?)"').findall(link) for name, url, iconimage, fanart in match: description = "null" + "," + developer + "," + youtube_id name2 = name url = name2 + "," + url name = "[COLOR silver][B]" + name + "[/B][/COLOR]" bname = "- [COLOR white]Week:[/COLOR] [COLOR yellowgreen][B]" + count + "[/B][/COLOR][COLOR white] - Total:[/COLOR] [COLOR yellowgreen][B]" + total + "[/B][/COLOR]" Common.addDir(name + bname, url, 97, iconimage, fanart, description) try: f = open(COM_NOTICE, mode='r') msg = f.read() f.close() Common.TextBox( '[COLOR yellowgreen][B]ECHO Wizard Community Builds[/B][/COLOR]', "%s" % msg) except: pass
def SHOWCOMMUNITYBUILDS(name, url, description): try: contact = description.split(',')[2] except: contact = "Unknown" if not contact == "Unknown": Common.addItem( "[COLOR white][B]Contact Details: [/COLOR][COLOR yellowgreen]" + str(contact) + "[/B][/COLOR]", "url", 999, ICON, FANART, description) try: url, ua = url.split("|SPLIT|") except: passed = 0 try: hidden, url, ua = url.split("|SPLIT|") except: dialog.ok( AddonTitle, 'Sorry, an error occured! You are using a shortcut, please go through the wizards main menu to get to your desired location. If you do not know how to update from the wizard main menu please ask your build maker for assistence as I cannot help with this issue.' ) quit() vq = Common._get_keyboard(heading="Please Enter Your Password") title = vq if len(title) == 0: quit() if title == hidden: passed = 1 if passed == 0: dialog.ok( AddonTitle, "Sorry the password entered was not found.", '[COLOR smokewhite]Thank you for using ECHO Wizard[/COLOR]') sys.exit(0) original = url xbmc_version = xbmc.getInfoLabel("System.BuildVersion") version = float(xbmc_version[:4]) codename = "Decline" i = 0 dp.create( AddonTitle, "[COLOR blue]We are getting the list of builds from our server.[/COLOR]", '[COLOR yellow]Please Wait...[/COLOR]', '') dp.update(0) if version >= 16.0 and version < 17.0: codename = 'Jarvis' if version >= 17.0 and version < 18.0: codename = 'Krypton' v = str(version) vv = v.split(".")[0] vvv = vv + ".9" www = vv + ".0" version_start = float(www) version_end = float(vvv) if 'endlessflix' in url: protected_wizards.Endless_Install() if 'CALL_THE_BEAST' in url: protected_wizards.Beast_Install() url = url.replace('CALL_THE_BEAST', '') i = 0 dp.create( AddonTitle, "[COLOR blue]We are getting the list of developers from our server.[/COLOR]", '[COLOR yellow]Please Wait...[/COLOR]', '') dp.update(0) namelist = [] urllist = [] countlist = [] deslist = [] iconlist = [] fanartlist = [] totallist = [] combinedlists = [] desca = description developer = desca.split(',')[0] hidden = desca.split(',')[1] a = 0 b = 0 link = Common.OPEN_URL_CUSTOM(url, ua).replace('\n', '').replace('\r', '').replace(',', '') link = link.replace("<notice></notice>", "<notice>null</notice>").replace( "<platform></platform>", "<platform>16.1</platform>").replace( "<youtube></youtube>", "<youtube>null</youtube>").replace( "<thumbnail></thumbnail>", "<thumbnail>null</thumbnail>").replace( "<fanart></fanart>", "<fanart>null</fanart>").replace( "<version></version>", "<version>null</version>").replace( "<build_image></build_image>", "<build_image>null</build_image>") match = re.compile('<item>(.+?)</item>').findall(link) match2 = re.compile( 'name="(.+?)".+?rl="(.+?)".+?mg="(.+?)".+?anart="(.+?)"').findall(link) dis_links1 = len(match) dis_links2 = len(match2) dis_links = dis_links1 + dis_links2 for item in match: name = re.compile('<title>(.+?)</title>').findall(item)[0] url = re.compile('<link>(.+?)</link>').findall(item)[0] try: build_version = re.compile('<version>(.+?)</version>').findall( item)[0] except: build_version = "null" try: notice = re.compile('<notice>(.+?)</notice>').findall(item)[0] except: notice = "null" try: platform = re.compile('<platform>(.+?)</platform>').findall( item)[0] except: platform = "16.1" tubes = re.compile('<youtube>(.+?)</youtube>').findall(item) if len(tubes) > 1: youtube_id = "multi" else: try: youtube_id = re.compile('<youtube>(.+?)</youtube>').findall( item)[0] except: youtube_id = "null" try: iconimage = re.compile('<thumbnail>(.+?)</thumbnail>').findall( item)[0] except: iconimage = ICON try: fanart = re.compile('<fanart>(.+?)</fanart>').findall(item)[0] except: fanart = FANART try: build_image = re.compile( '<build_image>(.+?)</build_image>').findall(item)[0] except: build_image = "null" if iconimage.lower() == "null": iconimage = ICON if fanart.lower() == "null": fanart = FANART if platform == "16": platform = "16.1" if "16.0" in platform: platform = "16.1" if not "." in platform: platform = platform + ".0" platform = float(platform) else: platform = float(platform) i = i + 1 dis_count = str(i) progress = 100 * int(i) / int(dis_links) dp.update( progress, "Getting details for developer " + str(dis_count) + " of " + str(dis_links), '', "[COLOR white][B]FOUND - [/B] " + name + "[/COLOR]") found = 1 description = "null" + "," + developer + "," + youtube_id + "," + notice + "," + build_image + "," + contact name2 = name url = name2 + "," + url + "," + original name = name.lower() name = name.replace('(krypton)', '').replace('(jarvis)', '').replace( 'jarvis ', '').replace('krypton ', '') if build_version.lower() == "null": name = "[COLOR silver][B]" + name.title() + "[/B][/COLOR]" else: name = "[COLOR silver][B]" + name.title( ) + "[/COLOR] - [COLOR yellowgreen]Ver: " + build_version + "[/B][/COLOR] " if platform >= version_start and platform < version_end: namelist.append(name) urllist.append(url) countlist.append(str(Common.count(name2, TEMP_FILE))) totallist.append( str(Common.count(name2 + "TOTAL_COUNT", TEMP_FILE))) deslist.append(description) iconlist.append(iconimage) fanartlist.append(fanart) combinedlists = list( zip(countlist, totallist, namelist, urllist, deslist, iconlist, fanartlist)) for name, url, iconimage, fanart in match2: i = i + 1 dis_count = str(i) progress = 100 * int(i) / int(dis_links) dp.update( progress, "Getting details for developer " + str(dis_count) + " of " + str(dis_links), '', "[COLOR white][B]FOUND - [/B] " + name + "[/COLOR]") found = 1 description = "null" + "," + developer + "," + contact name2 = name url = name2 + "," + url name = name.lower() name = name.replace('(krypton)', '').replace('(jarvis)', '').replace( 'jarvis ', '').replace('krypton ', '') name = "[COLOR silver][B]" + name.title() + "[/B][/COLOR]" if codename.lower() == "jarvis": if not "krypton" in name2.lower(): namelist.append(name) urllist.append(url) countlist.append(str(Common.count(name2, TEMP_FILE))) totallist.append( str(Common.count(name2 + "TOTAL_COUNT", TEMP_FILE))) deslist.append(description) iconlist.append(iconimage) fanartlist.append(fanart) combinedlists = list( zip(countlist, totallist, namelist, urllist, deslist, iconlist, fanartlist)) else: if codename.lower() in name2.lower(): namelist.append(name) urllist.append(url) countlist.append(str(Common.count(name2, TEMP_FILE))) totallist.append( str(Common.count(name2 + "TOTAL_COUNT", TEMP_FILE))) deslist.append(description) iconlist.append(iconimage) fanartlist.append(fanart) combinedlists = list( zip(countlist, totallist, namelist, urllist, deslist, iconlist, fanartlist)) tup = sorted(combinedlists, key=lambda x: int(x[0]), reverse=True) for count, total, name, url, description, iconimage, fanart in tup: countfail = count try: count2 = int(count) count3 = "{:,}".format(count2) count = str(count3) except: count = countfail a = a + 1 if "skip" in name.lower(): name = name.replace('skip', '') Common.addItem(name, url, 999, iconimage, fanart, description) else: bname = "- [COLOR white]Week:[/COLOR] [COLOR yellowgreen][B]" + count + "[/B][/COLOR][COLOR white] - Total:[/COLOR] [COLOR yellowgreen][B]" + total + "[/B][/COLOR]" Common.addDir(name + bname, url, 97, iconimage, fanart, description) if a == 0: dialog.ok( AddonTitle, "[COLOR white]Sorry, no builds were found for " + codename + "![/COLOR]") sys, exit(1) try: f = open(COM_NOTICE, mode='r') msg = f.read() f.close() Common.TextBox( '[COLOR yellowgreen][B]ECHO Wizard Community Builds[/B][/COLOR]', "%s" % msg) except: pass
def GetMenu(): if not os.path.exists(PARENTAL_FOLDER): choice = xbmcgui.Dialog().yesno( AddonTitle, "[COLOR white]Would you like to enable the parental controls now?[/COLOR]", "", yeslabel='[COLOR orangered]NO[/COLOR]', nolabel='[COLOR lime]YES[/COLOR]') if choice == 0: PARENTAL_CONTROLS_PIN() else: os.makedirs(PARENTAL_FOLDER) elif os.path.exists(PARENTAL_FILE): vq = common._get_keyboard(heading="Please Enter Your Password") if (not vq): dialog.ok(AddonTitle, "Sorry, no password was entered.") sys.exit(0) pass_one = vq vers = open(PARENTAL_FILE, "r") regex = re.compile(r'<password>(.+?)</password>') for line in vers: file = regex.findall(line) for current_pin in file: password = base64.b64decode(current_pin) if not password == pass_one: if not current_pin == pass_one: dialog.ok( AddonTitle, "Sorry, the password you entered was incorrect.") sys.exit(0) a = open(GET_VERSION).read() b = a.replace('\n', ' ').replace('\r', ' ') match = re.compile( 'name=".+?".+?version="(.+?)".+?provider-name=".+?">').findall(str(b)) for item in match: addon_version = float(item) a = open(GET_REPO_VERSION).read() b = a.replace('\n', ' ').replace('\r', ' ') match = re.compile( 'name=".+?".+?version="(.+?)".+?provider-name=".+?">').findall(str(b)) for item in match: repo_version = float(item) common.addDir("[COLOR white]SEARCH XXX-O-DUS[/COLOR]", "url", 1, icon, fanart) common.addDir("[COLOR white]Live[/COLOR]", "url", 3, icon, fanart) common.addDir("[COLOR white]Videos[/COLOR]", "url", 2, icon, fanart) common.addDir("[COLOR white]Photos[/COLOR]", "url", 4, icon, fanart) common.addDir("[COLOR white]Stories[/COLOR]", "url", 5, icon, fanart) common.addLink("[COLOR darkgray]#################################[/COLOR]", "url", 999, icon, fanart) common.addDir("[COLOR deeppink]Your History[/COLOR]", BASE, 101, icon, fanart) common.addDir("[COLOR deeppink]Your Favourites[/COLOR]", BASE, 102, icon, fanart) common.addDir("[COLOR deeppink]Your Downloads[/COLOR]", BASE, 105, icon, fanart) common.addLink("[COLOR deeppink]Your Settings[/COLOR]", BASE, 106, icon, fanart) if not os.path.exists(PARENTAL_FILE): common.addDir( "[COLOR orangered]PARENTAL CONTROLS - [COLOR orangered]OFF[/COLOR][/COLOR]", "url", 900, icon, fanart) else: common.addDir( "[COLOR orangered]PARENTAL CONTROLS - [COLOR lime]ON[/COLOR][/COLOR]", "url", 900, icon, fanart) common.addLink( "[COLOR white]#####################################[/COLOR]", BASE, 999, icon, fanart) common.addLink( "[COLOR pink]Twitter Support: [/COLOR][COLOR white]@EchoCoder[/COLOR]", BASE, 999, icon, fanart) common.addLink("[COLOR white]View Disclaimer[/COLOR]", TERMS, 998, icon, fanart) common.addLink("[COLOR white]View Addon Information[/COLOR]", INFO, 998, icon, fanart) common.addLink("[COLOR orangered]RESET XXX-O-DUS[/COLOR]", 'url', 997, icon, fanart) common.addLink( "[COLOR deeppink]Addon Version:[/COLOR] [COLOR white]" + str(addon_version) + "[/COLOR]", 'url', 999, icon, fanart) common.addLink( "[COLOR deeppink]Repository Version:[/COLOR] [COLOR white]" + str(repo_version) + "[/COLOR]", 'url', 999, icon, fanart) kodi_name = common.GET_KODI_VERSION() if kodi_name == "Jarvis": xbmc.executebuiltin('Container.SetViewMode(50)') elif kodi_name == "Krypton": xbmc.executebuiltin('Container.SetViewMode(55)') else: xbmc.executebuiltin('Container.SetViewMode(50)')
new = False if not os.path.exists(PARENTAL_CHECK_FILE): file = open(PARENTAL_CHECK_FILE, 'w') file.close() new = True fileCreation = os.path.getmtime(PARENTAL_CHECK_FILE) now = time.time() check = now - 60 * 30 if (fileCreation < check or new == True): vq = common._get_keyboard( heading= "Please Enter Your Password - [B][COLOR red](30 Minute Session)[/COLOR][/B]" ) if (not vq): dialog.ok(AddonTitle, "Sorry, no password was entered.") sys.exit(0) pass_one = hashlib.sha256(vq).hexdigest() vers = open(PARENTAL_FILE, "r") regex = re.compile(r'<password>(.+?)</password>') for line in vers: file = regex.findall(line) for password in file: if not password == pass_one: dialog.ok( AddonTitle, "Sorry, the password you entered was incorrect.")