PK (rR7]B B " plugin.program.cMaN/.gitattributes# Auto detect text files and perform LF normalization
* text=auto
PK (rR3 plugin.program.cMaN/addon.xml
executable
cMaN Wizard
There is everything you need in this Wizard, A huge thanks to everyone who made it possible, Enjoy your stay.
all
PK (rR;ߩ# # plugin.program.cMaN/autoexec.py################################################################################
# Copyright (C) 2015 Surfacingx/NaN #
# #
# This Program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2, or (at your option) #
# any later version. #
# #
# This Program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with XBMC; see the file COPYING. If not, write to #
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. #
# http://www.gnu.org/copyleft/gpl.html #
################################################################################
# Credits
# ----------
# Tobias Ussing And Henrik Mosgaard Jensen for parseDOM
# WhiteCream thread for clicking yes on dialog for unknown sources
import xbmc, xbmcvfs, xbmcaddon, xbmcgui,re, os, glob, thread
from datetime import datetime
try: from sqlite3 import dbapi2 as database
except: from pysqlite2 import dbapi2 as database
def main():
class enableAll():
def __init__(self):
self.databasepath = xbmc.translatePath('special://database/')
self.addons = xbmc.translatePath('special://home/addons/')
self.dbfilename = self.latestDB()
self.dbfilename = os.path.join(self.databasepath, self.dbfilename)
self.swapUS()
if not os.path.exists(os.path.join(self.databasepath, self.dbfilename)):
xbmcgui.Dialog().notification("AutoExec.py", "No Addons27.db file")
self.log("DB File not found.")
return False
self.addonlist = glob.glob(os.path.join(self.addons, '*/'))
self.disabledAddons = []
for folder in sorted(self.addonlist, key = lambda x: x):
addonxml = os.path.join(folder, 'addon.xml')
if os.path.exists(addonxml):
fold = folder.replace(self.addons, '')[1:-1]
f = open(addonxml)
a = f.read()
aid = parseDOM(a, 'addon', ret='id')
f.close()
try:
if len(aid) > 0: add = aid[0]
else: add = fold
xadd = xbmcaddon.Addon(id=add)
except:
try:
self.disabledAddons.append(add)
except:
self.log("Unabled to enable: %s" % folder, xbmc.LOGERROR)
if len(self.disabledAddons) > 0:
self.addonDatabase(self.disabledAddons, 1, True)
xbmc.executebuiltin('UpdateAddonRepos()')
xbmc.executebuiltin('UpdateLocalAddons()')
xbmc.executebuiltin("ReloadSkin()")
def log(self, msg, level=xbmc.LOGNOTICE):
try:
if isinstance(msg, unicode):
msg = '%s' % (msg.encode('utf-8'))
xbmc.log('[AutoExec.py]: %s' % msg, level)
except Exception as e:
try: xbmc.log('[AutoExec.py] Logging Failure: %s' % (e), xbmc.LOGERROR)
except: pass
def latestDB(self, DB="Addons"):
match = glob.glob(os.path.join(self.databasepath,'%s*.db' % DB))
comp = '%s(.+?).db' % DB[1:]
highest = 0
for file in match:
try: check = int(re.compile(comp).findall(file)[0])
except Exception, e: check = 0; self.log(str(e))
if highest < check:
highest = check
return '%s%s.db' % (DB, highest)
def swapUS(self):
new = '"addons.unknownsources"'
value = 'true'
query = '{"jsonrpc":"2.0", "method":"Settings.GetSettingValue","params":{"setting":%s}, "id":1}' % (new)
response = xbmc.executeJSONRPC(query)
self.log("Unknown Sources Get Settings: %s" % str(response), xbmc.LOGDEBUG)
if 'false' in response:
thread.start_new_thread(self.dialogWatch, ())
xbmc.sleep(200)
query = '{"jsonrpc":"2.0", "method":"Settings.SetSettingValue","params":{"setting":%s,"value":%s}, "id":1}' % (new, value)
response = xbmc.executeJSONRPC(query)
xbmcgui.Dialog().notification("AutoExec.py", "Unknown Sources: Enabled")
self.log("Unknown Sources Set Settings: %s" % str(response), xbmc.LOGDEBUG)
def dialogWatch(self):
x = 0
while not xbmc.getCondVisibility("Window.isVisible(yesnodialog)") and x < 100:
x += 1
xbmc.sleep(100)
if xbmc.getCondVisibility("Window.isVisible(yesnodialog)"):
xbmc.executebuiltin('SendClick(11)')
def addonDatabase(self, addon=None, state=1, array=False):
installedtime = str(datetime.now())[:-7]
if os.path.exists(self.dbfilename):
try:
textdb = database.connect(self.dbfilename)
textexe = textdb.cursor()
except Exception, e:
self.log("DB Connection Error: %s" % str(e), xbmc.LOGERROR)
return False
else: return False
try:
if array == False:
textexe.execute('INSERT or IGNORE into installed (addonID , enabled, installDate) VALUES (?,?,?)', (addon, state, installedtime,))
textexe.execute('UPDATE installed SET enabled = ? WHERE addonID = ? ', (state, addon,))
else:
for item in addon:
textexe.execute('INSERT or IGNORE into installed (addonID , enabled, installDate) VALUES (?,?,?)', (item, state, installedtime,))
textexe.execute('UPDATE installed SET enabled = ? WHERE addonID = ? ', (state, item,))
textdb.commit()
textexe.close()
except Exception, e:
self.log("Erroring enabling addon: %s" % addon, xbmc.LOGERROR)
try:
xbmcgui.Dialog().notification("AutoExec.py", "Starting Script...")
firstRun = enableAll()
xbmcgui.Dialog().notification("AutoExec.py", "All Addons Enabled")
xbmcvfs.delete('special://userdata/autoexec.py')
except Exception, e:
xbmcgui.Dialog().notification("AutoExec.py", "Error Check LogFile")
xbmc.log(str(e), xbmc.LOGERROR)
xbmcvfs.delete('special://userdata/autoexec.py')
def parseDOM(html, name=u"", attrs={}, ret=False):
# Copyright (C) 2010-2011 Tobias Ussing And Henrik Mosgaard Jensen
if isinstance(html, str):
try:
html = [html.decode("utf-8")]
except:
html = [html]
elif isinstance(html, unicode):
html = [html]
elif not isinstance(html, list):
return u""
if not name.strip():
return u""
ret_lst = []
for item in html:
temp_item = re.compile('(<[^>]*?\n[^>]*?>)').findall(item)
for match in temp_item:
item = item.replace(match, match.replace("\n", " "))
lst = []
for key in attrs:
lst2 = re.compile('(<' + name + '[^>]*?(?:' + key + '=[\'"]' + attrs[key] + '[\'"].*?>))', re.M | re.S).findall(item)
if len(lst2) == 0 and attrs[key].find(" ") == -1:
lst2 = re.compile('(<' + name + '[^>]*?(?:' + key + '=' + attrs[key] + '.*?>))', re.M | re.S).findall(item)
if len(lst) == 0:
lst = lst2
lst2 = []
else:
test = range(len(lst))
test.reverse()
for i in test:
if not lst[i] in lst2:
del(lst[i])
if len(lst) == 0 and attrs == {}:
lst = re.compile('(<' + name + '>)', re.M | re.S).findall(item)
if len(lst) == 0:
lst = re.compile('(<' + name + ' .*?>)', re.M | re.S).findall(item)
if isinstance(ret, str):
lst2 = []
for match in lst:
attr_lst = re.compile('<' + name + '.*?' + ret + '=([\'"].[^>]*?[\'"])>', re.M | re.S).findall(match)
if len(attr_lst) == 0:
attr_lst = re.compile('<' + name + '.*?' + ret + '=(.[^>]*?)>', re.M | re.S).findall(match)
for tmp in attr_lst:
cont_char = tmp[0]
if cont_char in "'\"":
if tmp.find('=' + cont_char, tmp.find(cont_char, 1)) > -1:
tmp = tmp[:tmp.find('=' + cont_char, tmp.find(cont_char, 1))]
if tmp.rfind(cont_char, 1) > -1:
tmp = tmp[1:tmp.rfind(cont_char)]
else:
if tmp.find(" ") > 0:
tmp = tmp[:tmp.find(" ")]
elif tmp.find("/") > 0:
tmp = tmp[:tmp.find("/")]
elif tmp.find(">") > 0:
tmp = tmp[:tmp.find(">")]
lst2.append(tmp.strip())
lst = lst2
else:
lst2 = []
for match in lst:
endstr = u"" + name
start = item.find(match)
end = item.find(endstr, start)
pos = item.find("<" + name, start + 1 )
while pos < end and pos != -1:
tend = item.find(endstr, end + len(endstr))
if tend != -1:
end = tend
pos = item.find("<" + name, pos + 1)
if start == -1 and end == -1:
temp = u""
elif start > -1 and end > -1:
temp = item[start + len(match):end]
elif end > -1:
temp = item[:end]
elif start > -1:
temp = item[start + len(match):]
if ret:
endstr = item[end:item.find(">", item.find(endstr)) + 1]
temp = match + temp + endstr
item = item[item.find(temp, item.find(match)) + len(temp):]
lst2.append(temp)
lst = lst2
ret_lst += lst
return ret_lst
if __name__ == '__main__':
main()PK (rRPަ$ $ ! plugin.program.cMaN/changelog.txtv1.2.5 - Beta
-Added Zlib to correct kodi 18 not extracting zip
-Change all mods to reflect this change: >17 import zlib- default, wizard and extract
v1.2.4 - Beta
-Lots of layout changes and put each catagory to its own module to quicken the load time
v1.2.3 - Beta
-Added PyXBMCt Layout
-Changed default startup options to none
####FTG MODS####
v0.1.8-Beta 2
-Added Skin type to addon installer that extracts to special://home/
-Fixed SkinSwap issue in addon installer
-Fixed Install Method Issue
-Fixed Meta/forks issue with build installs
-todo
add sections to builds menu
add minor updates
add youtube Playlist and channel scraper
v0.1.8
-Added 'Packs' to addon installer and back up options
-Added Back up Addon Packs
-Added 'Roms' to APK Menu
-Added Enable unknown sources in maint menu
-Added Clear /Archive_Cache/ to maint menu
-Added Speed test window
-Added Zen to video cache
-Added Alluc section to Save Data Menu
-Added Mr Know URL Resolver to debrid
-Added Open Subtitles to Login
-Added Info into build text files and create info file with backup zip
-Added Text File Caching
-Rem Real Debrid from Exodus
-Mod Theme backup includes dependencies for addons if they are added
-Mod Improved speed of enable all addons.
-Fixed Bug in clear cache for video addons
-Fixed Bug in backup build and guifix
-Fixed Bug in kodi 17 for addon installer
-Fixed Bug in theme install where addons didnt enable
v0.1.7a
-Mod tweaked code to prevent 2nd startup
-Fixed bug where started with second char in notifications
-Fixed bug when only 1 build is avaliable and shows kodi version and save data twice
-Fixed bug in backup build
v0.1.7
-Added First Run Save Data Window
-Added New Window for Viewing Log Files
-Added Custom window for TextBoxes
-Added Install build without force close
-Added Install method to Settings (Always Ask, Reload Profile, Force Close)
-Added 'Remove Advanced Settings' in menu's
-Added Keep Repo's, Keep Super Favorities and WhiteList
-Added Import and Export Save Data/WhiteList
-Added PVR plugin in whitelist will re-enable on startup after install
-Added Video Preview for builds
-Added Test Builds only appear in developer mode(any build with the word test in the name)
-Added Sections for APK, Addon Installer, Advanced Settings, and Youtube Videos
-Added Adult attribute to Themes List
-Added 3rd Party Wizard support
-Added More support for Kodi 17 and Addons27.db
-Added Exception for 'meta_cache' and 'archive_cache' in clear cache(watched items)
-Added Ability to change the icon and fanart for the contact window
-Added Scraper for SPMC and Kodi Apks.
-Added Convert text to 0.1.7 text files
-Added Fix for meta and forks when installed from build
-Added Convert to Special on Backup guiFix and Themes
-Added Reinstall addon to addoninstaller
-Added Kodi 18 to build menu
-Added Addon support to theme backups
-Mod Redid how the remove addons worked.
-Mod Working url check now tries 3 times before returning a bad url
-Mod Clear packages on startup reduced to 3 minutes(down from 5)
-Mod If skin is set to 50 default, it uses 55 on 'skin.estuary'
-Mod Converted all custom windows except advanced settings to .xml files
-Mod Convert to special on guifix and theme
-Mod Tweaks to addon installer
-Fixed Bugs in downloader.py and save data.
-Fixed Bug in SmoothStreams Login Data
-Fixed Bug in Trakt, Debrid, Login - clear addon data
-Fixed Bug in removing old thumbnails
-Fixed Bug in Kodi 17 Builds showing Kodi 16 count
-Fixed Bug in Kodi 17 causing startup to run twice
-Fixed Bugs in Backup/Restore when using external and network locations
-Rem Header and message font size in uservar.py
v0.1.6
-Added Auto Clean Up Fequency on Startup
-Added Remove Old Thumbnails on startup
-Added Enable/Disable Addons in maintenance
-Added Enable/Disable Adult Addons
-Added Email support added back to upload kodi log
-Added Adult into text files.(builds, apk, addons)-Show/Hide Adult in Settings
-Added Description into text files.(builds, themes, apk, youtube, addons)
-Added Addon installer
-Added YouTube Video Sections
-Added Added Krypton Section to Builds List
-Added Scan Sources for bad urls
-Added Check for broken Repository
-Added View Errors in Log File
-Added Help window for installing APK's
-Added New build information on view build page and in builds list context menu.
-Added New Windowxml for Auto Config Advanced Settings
-Added Advanced Settings text file.
-Added Ability to setup backup location
-Added Logging Levels inside the Settings Menu
-Added Auto Cleaning of wizard.log by date, size, lines
-Added Ability to set SPACER in uservar for menu items.
-Added Convert text files from 0.1.5 to 0.1.6
-Added Disable update notifications in settings.
-Fixed changed the way ADDON_ID vs Addon Folder is checked
-Fixed Plugin Sorting on Remove Addon Data page
-Fixed Minor bug for default icon for login and real debrid in menus
-Fixed Bug in Apk Installer for official Kodi/SPMC
-Fixed Losing Font style and other skin settings on theme skinswap
-Fixed No working fanart/icons when using wizard in Official Kodi Folder
-Mod GUI Changes to progress dialog for extract
-Mod All Dialog Windows and Popups Run off COLOR1 and COLOR2
-Mod Rework on maintenance menu.
-Mod Clear Cache now clears cache for several movie addons(If Enabled)
-Mod Changed code for identifying which Log file to read.
-Mod Now the AutoUpdate trakt, login, debrid details will always update data if usernames(addon and saved) match
-Mod Made the view errors on extract easier to read.
-Mod Added Exceptions to Backing up Builds and Extracting Zips
-Mod Moved Backup, Restore, Convert to Special, Ascii Check to Maint Menu
-Mod Rearranged the settings menu
-Mod If the wizard is stored in the Official Kodi folder, moves it to /Kodi/addons/
-Mod Clear Packages on startup doesnt effect files created in the last 5 minutes
v0.1.5
-Added MetalliQ & Meta support for trakt data
-Added Import Data for trakt, debrid, login *
-Added Login Data with several addons to Saved Data Menu
-Added Open Settings for addons in trakt, debrid, login
-Added More debugging for startup.py and default.py
-Added Developer Menu: Backup Theme, guiFix, and build zip
-Added Developer Menu: Restore local zip and guifix
-Added Developer Menu: Restore external zip and guifix(IE: hosted on site)
-Added Developer Menu: Remove non ASCII file names
-Added Check for skin set back to default on startup
-Added More support for .log files
-Added New Window for build update, contact and first run
-Added Hide/Unhide Passwords and remove crash logs to maintenance menu
-Mod Complete recoded of the trakt, debrid, and login files and menus.
-Mod Apk Installer menu now always appears when developer menu is turned on.
-Fixed Minor bug in real debrid save menu
-Fixed UploadLog has been fixed
-Fixed Force close for Android
-Fixed Bug for Notifications Window selecting both dismiss and remind me later(mainly with nvidea shield)
* Note: If you switch between one wizard using aftermath wizard to another, you can copy the 3 folders in addon_data(trakt, debrid, login) to the other wizard then import the data.
v0.1.4
-Mod Minor changes to Notify on startup
-Mod Extract.py now excludes wizard folder if contained in build.
-Mod New Clear Cache Code ignores .log files.
-Mod Fixed Error check log on viewing log file when doesnt exists.
-Rem For the time being 'skin.estuary' has been removed from skin swap.
-Bug Fixes
v0.1.3
-Added Debugging on check for build update
-Added Wizard.log to view only messages from wizard itself
-Added Text File to add your own APK's
-Added Auto Clean on startup[Cache and Packages]
-Mod Clear Cache works better than before
-Mod Made a seperate window for the test Notifications window
v0.1.2
-Added RemoveAddon and RemoveAddonData menus
-Added Developer menu with Test Notifications Window, Convert Paths to Special
-Added Save Data Menu with Real debrid, Trakt support, and keep files
-Added AutoConfig form on the website to autocreate wizard file.
-Added Auto Install repo if not installed
-Added APK Installer for spmc and kodi on android
-Mod Auto Save of trakt and debrid is alot better on fresh start/build install
-Mod Notifications Window now has either Image header or Text Header support
-Mod If no Isengard and below builds hide the [-] Isengard and below and vice versa
-Mod If only one build is avaliable it skips to view build instead of view build list
-Fixed bug in trakt menu if exodus, etc was installed
-Improved Code
v0.1.1
-Added support for custom main menu icons
-Added ability to hide seperators in the menu(======='s)
-Added the ability to decide how often it checks for build updates
-Added purgeDB for all db files(Multiselect for Kodi 16+ and SingleSelect for below)
-Added auto removal of chars from zip name that arent allowed
-Added if a db file doesnt delete it will purge it
-Added in Settings Do not seperate builds by version
-Fixed trakt addons now will show the addon icon/fanart if the addon is installed
-Fixed error in the Auto Update
-Fixed dialogs covering up the 'View Errors' textbox
v0.1.0
-Various bug fixes
-Add skinSwap to force skin back to confluence
v0.0.1c
-Fixed the errors on extract message
-Relocated add user edit variables to uservar.py
-Seperated builds by kodi version
v0.0.1
-Initial ReleasePK (rR[ plugin.program.cMaN/credits.txtCredits to all developers that some of the code came from
][NT3L][G3NC][ :
For APK Install code and Force Close Fix
Kodi Team :
Kodi Log Uploader(Added support for forks and email log url)
Sean Poyser :
YouTube module
EchoCoder :
Help with Addons27.db
Fire TV Guru :
PyXBMXt Layout, Kodi 18 Zip Fix -zlib
Surfacingx :
Creator of the Wizard
MetalKettle/Original Dev of speed test
Special Thanks to the NaN Team for giving me a home when i was first starting out coding python and helping me out along the way.
This wizard wouldn't be no where near as good as it is today if it wasnt for them.
WhufcLee, OpenEleq, Midraal :
Various coding help
Barroni :
Artwork for Advanced Settings Auto ConfiguratorPK (rRߒ plugin.program.cMaN/default.py############################################################################
# /T /I #
# / |/ | .-~/ #
# T\ Y I |/ / _ #
# /T | \I | I Y.-~/ #
# I l /I T\ | | l | T / #
# T\ | \ Y l /T | \I l \ ` l Y If your going to copy #
# __ | \l \l \I l __l l \ ` _. | this addon just #
# \ ~-l `\ `\ \ \ ~\ \ `. .-~ | give credit! #
# \ ~-. "-. ` \ ^._ ^. "-. / \ | #
#.--~-._ ~- ` _ ~-_.-"-." ._ /._ ." ./ Stop Deleting the #
# >--. ~-. ._ ~>-" "\ 7 7 ] credits file! #
#^.___~"--._ ~-{ .-~ . `\ Y . / | #
# <__ ~"-. ~ /_/ \ \I Y : | #
# ^-.__ ~(_/ \ >._: | l______ #
# ^--.,___.-~" /_/ ! `-.~"--l_ / ~"-. #
# (_/ . ~( /' "~"--,Y -=b-. _) #
# (_/ . \ : / l c"~o \ #
# \ / `. . .^ \_.-~"~--. ) #
# (_/ . ` / / ! )/ #
# / / _. '. .': / ' #
# ~(_/ . / _ ` .-<_ #
# /_/ . ' .-~" `. / \ \ ,z=. Surfacingx #
# ~( / ' : | K "-.~-.______// Original Author #
# "-,. l I/ \_ __{--->._(==. #
# //( \ < ~"~" // #
# /' /\ \ \ ,v=. (( Fire TV Guru #
# .^. / /\ " }__ //===- ` PyXBMCt LaYOUt #
# / / ' ' "-.,__ {---(==- #
# .^ ' : T ~" ll #
# / . . . : | :! \ #
# (_/ / | | j-" ~^ #
# ~-<_(_.^-~" #
# #
# Copyright (C) One of those Years.... #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
############################################################################
import xbmc, xbmcaddon, xbmcgui, xbmcplugin, os, sys, xbmcvfs, glob
import shutil
import urllib2,urllib
import re
import zipfile
import uservar
import fnmatch
try: from sqlite3 import dbapi2 as database
except: from pysqlite2 import dbapi2 as database
from datetime import date, datetime, timedelta
from urlparse import urljoin
from resources.libs import extract, downloader, notify, debridit, traktit, allucit, loginit, net, skinSwitch, uploadLog, yt, speedtest, wizard as wiz, addonwindow as pyxbmct
ADDON_ID = uservar.ADDON_ID
ADDONTITLE = uservar.ADDONTITLE
ADDON = wiz.addonId(ADDON_ID)
VERSION = wiz.addonInfo(ADDON_ID,'version')
ADDONPATH = wiz.addonInfo(ADDON_ID, 'path')
DIALOG = xbmcgui.Dialog()
DP = xbmcgui.DialogProgress()
HOME = xbmc.translatePath('special://home/')
LOG = xbmc.translatePath('special://logpath/')
PROFILE = xbmc.translatePath('special://profile/')
TEMPDIR = xbmc.translatePath('special://temp')
ADDONS = os.path.join(HOME, 'addons')
USERDATA = os.path.join(HOME, 'userdata')
PLUGIN = os.path.join(ADDONS, ADDON_ID)
PACKAGES = os.path.join(ADDONS, 'packages')
ADDOND = os.path.join(USERDATA, 'addon_data')
ADDONDATA = os.path.join(USERDATA, 'addon_data', ADDON_ID)
ADVANCED = os.path.join(USERDATA, 'advancedsettings.xml')
SOURCES = os.path.join(USERDATA, 'sources.xml')
FAVOURITES = os.path.join(USERDATA, 'favourites.xml')
PROFILES = os.path.join(USERDATA, 'profiles.xml')
GUISETTINGS = os.path.join(USERDATA, 'guisettings.xml')
THUMBS = os.path.join(USERDATA, 'Thumbnails')
DATABASE = os.path.join(USERDATA, 'Database')
FANART = os.path.join(PLUGIN, 'fanart.jpg')
ICON = os.path.join(PLUGIN, 'icon.png')
ART = os.path.join(PLUGIN, 'resources', 'art')
WIZLOG = os.path.join(ADDONDATA, 'wizard.log')
SPEEDTESTFOLD = os.path.join(ADDONDATA, 'SpeedTest')
ARCHIVE_CACHE = os.path.join(TEMPDIR, 'archive_cache')
SKIN = xbmc.getSkinDir()
BUILDNAME = wiz.getS('buildname')
DEFAULTSKIN = wiz.getS('defaultskin')
DEFAULTNAME = wiz.getS('defaultskinname')
DEFAULTIGNORE = wiz.getS('defaultskinignore')
BUILDVERSION = wiz.getS('buildversion')
BUILDTHEME = wiz.getS('buildtheme')
BUILDLATEST = wiz.getS('latestversion')
SHOW15 = wiz.getS('show15')
SHOW16 = wiz.getS('show16')
SHOW17 = wiz.getS('show17')
SHOW18 = wiz.getS('show18')
SHOWADULT = wiz.getS('adult')
SHOWMAINT = wiz.getS('showmaint')
AUTOCLEANUP = wiz.getS('autoclean')
AUTOCACHE = wiz.getS('clearcache')
AUTOPACKAGES = wiz.getS('clearpackages')
AUTOTHUMBS = wiz.getS('clearthumbs')
AUTOFEQ = wiz.getS('autocleanfeq')
AUTONEXTRUN = wiz.getS('nextautocleanup')
INCLUDEVIDEO = wiz.getS('includevideo')
INCLUDEALL = wiz.getS('includeall')
INCLUDEBOB = wiz.getS('includebob')
INCLUDEPHOENIX = wiz.getS('includephoenix')
INCLUDESPECTO = wiz.getS('includespecto')
INCLUDEGENESIS = wiz.getS('includegenesis')
INCLUDEEXODUS = wiz.getS('includeexodus')
INCLUDEONECHAN = wiz.getS('includeonechan')
INCLUDESALTS = wiz.getS('includesalts')
INCLUDESALTSHD = wiz.getS('includesaltslite')
SEPERATE = wiz.getS('seperate')
NOTIFY = wiz.getS('notify')
NOTEID = wiz.getS('noteid')
NOTEDISMISS = wiz.getS('notedismiss')
TRAKTSAVE = wiz.getS('traktlastsave')
REALSAVE = wiz.getS('debridlastsave')
ALLUCSAVE = wiz.getS('alluclastsave')
LOGINSAVE = wiz.getS('loginlastsave')
KEEPFAVS = wiz.getS('keepfavourites')
FAVSsave = wiz.getS('favouriteslastsave')
KEEPSOURCES = wiz.getS('keepsources')
KEEPPROFILES = wiz.getS('keepprofiles')
KEEPADVANCED = wiz.getS('keepadvanced')
KEEPREPOS = wiz.getS('keeprepos')
KEEPSUPER = wiz.getS('keepsuper')
KEEPWHITELIST = wiz.getS('keepwhitelist')
KEEPTRAKT = wiz.getS('keeptrakt')
KEEPREAL = wiz.getS('keepdebrid')
KEEPALLUC = wiz.getS('keepalluc')
KEEPLOGIN = wiz.getS('keeplogin')
DEVELOPER = wiz.getS('developer')
THIRDPARTY = wiz.getS('enable3rd')
THIRD1NAME = wiz.getS('wizard1name')
THIRD1URL = wiz.getS('wizard1url')
THIRD2NAME = wiz.getS('wizard2name')
THIRD2URL = wiz.getS('wizard2url')
THIRD3NAME = wiz.getS('wizard3name')
THIRD3URL = wiz.getS('wizard3url')
BACKUPLOCATION = ADDON.getSetting('path') if not ADDON.getSetting('path') == '' else 'special://home/'
BACKUPROMS = wiz.getS('rompath')
MYBUILDS = os.path.join(BACKUPLOCATION, 'My_Builds', '')
AUTOFEQ = int(float(AUTOFEQ)) if AUTOFEQ.isdigit() else 0
TODAY = date.today()
TOMORROW = TODAY + timedelta(days=1)
THREEDAYS = TODAY + timedelta(days=3)
KODIV = float(xbmc.getInfoLabel("System.BuildVersion")[:4])
if KODIV > 17:
from resources.libs import zfile as zipfile #FTG mod for Kodi 18
else:
import zipfile
MCNAME = wiz.mediaCenter()
EXCLUDES = uservar.EXCLUDES
CACHETEXT = uservar.CACHETEXT
CACHEAGE = uservar.CACHEAGE if str(uservar.CACHEAGE).isdigit() else 30
BUILDFILE = uservar.BUILDFILE
ADDONPACK = uservar.ADDONPACK
APKFILE = uservar.APKFILE
YOUTUBETITLE = uservar.YOUTUBETITLE
YOUTUBEFILE = uservar.YOUTUBEFILE
ADDONFILE = uservar.ADDONFILE
ADVANCEDFILE = uservar.ADVANCEDFILE
UPDATECHECK = uservar.UPDATECHECK if str(uservar.UPDATECHECK).isdigit() else 1
NEXTCHECK = TODAY + timedelta(days=UPDATECHECK)
NOTIFICATION = uservar.NOTIFICATION
ENABLE = uservar.ENABLE
HEADERMESSAGE = uservar.HEADERMESSAGE
AUTOUPDATE = uservar.AUTOUPDATE
BUILDERNAME = uservar.BUILDERNAME
WIZARDFILE = uservar.WIZARDFILE
HIDECONTACT = uservar.HIDECONTACT
CONTACT = uservar.CONTACT
CONTACTICON = uservar.CONTACTICON if not uservar.CONTACTICON == 'http://' else ICON
CONTACTFANART = uservar.CONTACTFANART if not uservar.CONTACTFANART == 'http://' else FANART
HIDESPACERS = uservar.HIDESPACERS
COLOR1 = uservar.COLOR1
COLOR2 = uservar.COLOR2
THEME1 = uservar.THEME1
THEME2 = uservar.THEME2
THEME3 = uservar.THEME3
THEME4 = uservar.THEME4
THEME5 = uservar.THEME5
THEME6 = uservar.THEME6
ICONBUILDS = uservar.ICONBUILDS if not uservar.ICONBUILDS == 'http://' else ICON
ICONMAINT = uservar.ICONMAINT if not uservar.ICONMAINT == 'http://' else ICON
ICONAPK = uservar.ICONAPK if not uservar.ICONAPK == 'http://' else ICON
ICONADDONS = uservar.ICONADDONS if not uservar.ICONADDONS == 'http://' else ICON
ICONYOUTUBE = uservar.ICONYOUTUBE if not uservar.ICONYOUTUBE == 'http://' else ICON
ICONSAVE = uservar.ICONSAVE if not uservar.ICONSAVE == 'http://' else ICON
ICONTRAKT = uservar.ICONTRAKT if not uservar.ICONTRAKT == 'http://' else ICON
ICONREAL = uservar.ICONREAL if not uservar.ICONREAL == 'http://' else ICON
ICONLOGIN = uservar.ICONLOGIN if not uservar.ICONLOGIN == 'http://' else ICON
ICONCONTACT = uservar.ICONCONTACT if not uservar.ICONCONTACT == 'http://' else ICON
ICONSETTINGS = uservar.ICONSETTINGS if not uservar.ICONSETTINGS == 'http://' else ICON
Images = xbmc.translatePath(os.path.join('special://home','addons',ADDON_ID,'resources','images/'));
LOGFILES = wiz.LOGFILES
TRAKTID = traktit.TRAKTID
DEBRIDID = debridit.DEBRIDID
LOGINID = loginit.LOGINID
ALLUCID = allucit.ALLUCID
MODURL = 'http://tribeca.tvaddons.ag/tools/maintenance/modules/'
MODURL2 = 'http://mirrors.kodi.tv/addons/jarvis/'
INSTALLMETHODS = ['Always Ask', 'Reload Profile', 'Force Close']
DEFAULTPLUGINS = ['metadata.album.universal', 'metadata.artists.universal', 'metadata.common.fanart.tv', 'metadata.common.imdb.com', 'metadata.common.musicbrainz.org', 'metadata.themoviedb.org', 'metadata.tvdb.com', 'service.xbmc.versioncheck']
#FTG MOD##
ROMPACK = uservar.ROMPACK
EMUAPKS = uservar.EMUAPKS
ROMPATH = ADDON.getSetting('rompath') if not ADDON.getSetting('rompath') == '' else 'special://home/'
ROMLOC = os.path.join(ROMPATH, 'Roms', '')
try:
INSTALLMETHOD = int(float(wiz.getS('installmethod')))
except:
INSTALLMETHOD = 0
###########################
###### Menu Items #######
###########################
#addDir (display,mode,name=None,url=None,menu=None,overwrite=True,fanart=FANART,icon=ICON, themeit=None)
#addFile(display,mode,name=None,url=None,menu=None,overwrite=True,fanart=FANART,icon=ICON, themeit=None)
def index():
errors = int(errorChecking(count=True))
err = str(errors)
errorsfound = '[COLOR red]%s[/COLOR] Error(s) Found' % (err) if errors > 0 else 'None Found'
if AUTOUPDATE == 'Yes':
wizfile = wiz.textCache(WIZARDFILE)
if not wizfile == False:
ver = wiz.checkWizard('version')
if ver > VERSION: addFile('%s [v%s] [COLOR red][B][UPDATE v%s][/B][/COLOR]' % (ADDONTITLE, VERSION, ver), 'wizardupdate', themeit=THEME2)
else: addFile('%s [v%s]' % (ADDONTITLE, VERSION), '', themeit=THEME2)
else: addFile('%s [v%s]' % (ADDONTITLE, VERSION), '', themeit=THEME2)
else: addFile('%s [v%s]' % (ADDONTITLE, VERSION), '', themeit=THEME2)
if len(BUILDNAME) > 0:
version = wiz.checkBuild(BUILDNAME, 'version')
build = '%s (v%s)' % (BUILDNAME, BUILDVERSION)
if version > BUILDVERSION: build = '%s [COLOR red][B][UPDATE v%s][/B][/COLOR]' % (build, version)
addDir(build,'viewbuild',BUILDNAME, themeit=THEME4)
themefile = wiz.themeCount(BUILDNAME)
if not themefile == False:
addFile('None' if BUILDTHEME == "" else BUILDTHEME, 'theme', BUILDNAME, themeit=THEME5)
else: addDir('None', 'builds', themeit=THEME4)
if HIDESPACERS == 'No': addFile(wiz.sep(), '', themeit=THEME3)
addDir ('Builds', 'builds', icon=ICONBUILDS, themeit=THEME1)
addDir ('Maintenance', 'maint', icon=ICONMAINT, themeit=THEME1)
addDir ('Internet Tools' ,'net', icon=ICONCONTACT, themeit=THEME1)
if wiz.platform() == 'android' or DEVELOPER == 'true': addDir ('Apk Installer' ,'apk', icon=ICONAPK, themeit=THEME1)
if wiz.platform() == 'android' or wiz.platform() == 'windows' or DEVELOPER == 'true': addDir ('Retro Gaming Zone' ,'retromenu', icon=ICONSAVE, themeit=THEME1)
if not ADDONFILE == 'http://': addDir ('Addon Installer' ,'addons', icon=ICONADDONS, themeit=THEME1)
if not YOUTUBEFILE == 'http://' and not YOUTUBETITLE == '': addDir (YOUTUBETITLE ,'youtube', icon=ICONYOUTUBE, themeit=THEME1)
addDir ('Save Login Data / Favs Options', 'savedata', icon=ICONSAVE, themeit=THEME1)
addDir ('Backup/Restore Data Options' ,'backup', icon=ICONSAVE, themeit=THEME1)
if HIDECONTACT == 'No': addFile('Contact' ,'contact', icon=ICONCONTACT, themeit=THEME1)
if HIDESPACERS == 'No': addFile(wiz.sep(), '', themeit=THEME3)
addFile('Upload Log File', 'uploadlog', icon=ICONMAINT, themeit=THEME1)
addFile('View Errors in Log: %s' % (errorsfound), 'viewerrorlog', icon=ICONMAINT, themeit=THEME1)
if errors > 0: addFile('View Last Error In Log', 'viewerrorlast', icon=ICONMAINT, themeit=THEME1)
if HIDESPACERS == 'No': addFile(wiz.sep(), '', themeit=THEME3)
addFile('Settings', 'settings', icon=ICONSETTINGS, themeit=THEME1)
addFile('Force Update Text Files', 'forcetext', icon=ICONMAINT, themeit=THEME1)
if DEVELOPER == 'true': addDir('Developer Menu', 'developer', icon=ICON, themeit=THEME1)
setView('files', 'viewType')
def KodiVer():
if KODIV >= 16.0 and KODIV <= 16.9:vername = 'Jarvis'
elif KODIV >= 17.0 and KODIV <= 17.9:vername = 'Krypton'
elif KODIV >= 18.0 and KODIV <= 18.9:vername = 'Leia'
else: vername = "Unknown"
return vername
def buildMenu():
kodi_ver = KodiVer()
bf = wiz.textCache(BUILDFILE)
if bf == False:
WORKINGURL = wiz.workingURL(BUILDFILE)
addFile('%s Version: %s' % (MCNAME, KODIV), '', icon=ICONBUILDS, themeit=THEME3)
addDir ('Save Data Menu' ,'savedata', icon=ICONSAVE, themeit=THEME3)
if HIDESPACERS == 'No': addFile(wiz.sep(), '', themeit=THEME3)
addFile('Url for txt file not valid', '', icon=ICONBUILDS, themeit=THEME3)
addFile('%s' % WORKINGURL, '', icon=ICONBUILDS, themeit=THEME3)
return
total, count15, count16, count17, count18, adultcount, hidden = wiz.buildCount()
third = False; addin = []
if THIRDPARTY == 'true':
if not THIRD1NAME == '' and not THIRD1URL == '': third = True; addin.append('1')
if not THIRD2NAME == '' and not THIRD2URL == '': third = True; addin.append('2')
if not THIRD3NAME == '' and not THIRD3URL == '': third = True; addin.append('3')
link = bf.replace('\n','').replace('\r','').replace('\t','').replace('gui=""', 'gui="http://"').replace('theme=""', 'theme="http://"').replace('adult=""', 'adult="no"').replace('url2=""', 'url2="http://"').replace('url3=""', 'url3="http://"').replace('preview=""', 'preview="http://"')
match = re.compile('name="(.+?)".+?ersion="(.+?)".+?rl="(.+?)".+?rl2="(.+?)".+?rl3="(.+?)".+?ui="(.+?)".+?odi="(.+?)".+?heme="(.+?)".+?con="(.+?)".+?anart="(.+?)".+?dult="(.+?)".+?escription="(.+?)".+?review="(.+?)"').findall(link)
if total == 1 and third == False:
for name, version, url, url2, url3, gui, kodi, theme, icon, fanart, adult, description, preview in match:
if not SHOWADULT == 'true' and adult.lower() == 'yes': continue
if not DEVELOPER == 'true' and wiz.strTest(name): continue
viewBuild(match[0][0])
return
addFile('%s Version: %s' % (MCNAME, KODIV), '', icon=ICONBUILDS, themeit=THEME3)
addDir ('Save Data Menu' ,'savedata', icon=ICONSAVE, themeit=THEME3)
addDir ('[COLOR yellow]---[B][COLOR lime]Addon Packs [COLOR blue]/ [COLOR red]Fixes[/COLOR][/B][COLOR yellow]---[/COLOR]' ,'viewpack', icon=ICONMAINT, themeit=THEME1)
if HIDESPACERS == 'No': addFile(wiz.sep(), '', themeit=THEME3)
if third == True:
for item in addin:
name = eval('THIRD%sNAME' % item)
addDir ("[B]%s[/B]" % name, 'viewthirdparty', item, icon=ICONBUILDS, themeit=THEME3)
if len(match) >= 1:
if SEPERATE == 'true':
for name, version, url, url2, url3, gui, kodi, theme, icon, fanart, adult, description, preview in match:
if not SHOWADULT == 'true' and adult.lower() == 'yes': continue
if not DEVELOPER == 'true' and wiz.strTest(name): continue
menu = createMenu('install', '', name)
addDir('[%s] %s (v%s)' % (float(kodi), name, version), 'viewbuild', name, description=description, fanart=fanart,icon=icon, menu=menu, themeit=THEME2)
elif DEVELOPER == 'true':
if count15 > 0:
addFile('[B]Test builds[/B]', 'togglesetting', 'show15', themeit=THEME3)
for name, version, url, url2, url3, gui, kodi, theme, icon, fanart, adult, description, preview in match:
if not SHOWADULT == 'true' and adult.lower() == 'yes': continue
if not DEVELOPER == 'true' and wiz.strTest(name): continue
kodiv = int(float(kodi))
if kodiv <= 15:
menu = createMenu('install', '', name)
addDir(' %s (v%s)' % (name, version), 'viewbuild', name, description=description, fanart=fanart,icon=icon, menu=menu, themeit=THEME2)
if count18 > 0:
state = '+' if SHOW18 == 'false' else '-'
addFile('[B]%s Leia Builds(%s)[/B]' % (state, count18), 'togglesetting', 'show18', themeit=THEME3)
if SHOW18 == 'true':
for name, version, url, url2, url3, gui, kodi, theme, icon, fanart, adult, description, preview in match:
if not SHOWADULT == 'true' and adult.lower() == 'yes': continue
if not DEVELOPER == 'true' and wiz.strTest(name): continue
kodiv = int(float(kodi))
if kodiv == 18:
menu = createMenu('install', '', name)
addDir('[%s] %s (v%s)' % (float(kodi), name, version), 'viewbuild', name, description=description, fanart=fanart,icon=icon, menu=menu, themeit=THEME2)
if count17 > 0:
state = '+' if SHOW17 == 'false' else '-'
addFile('[B]%s Krypton Builds(%s)[/B]' % (state, count17), 'togglesetting', 'show17', themeit=THEME3)
if SHOW17 == 'true':
for name, version, url, url2, url3, gui, kodi, theme, icon, fanart, adult, description, preview in match:
if not SHOWADULT == 'true' and adult.lower() == 'yes': continue
if not DEVELOPER == 'true' and wiz.strTest(name): continue
kodiv = int(float(kodi))
if kodiv == 17:
menu = createMenu('install', '', name)
addDir('[%s] %s (v%s)' % (float(kodi), name, version), 'viewbuild', name, description=description, fanart=fanart,icon=icon, menu=menu, themeit=THEME2)
if count16 > 0:
state = '+' if SHOW16 == 'false' else '-'
addFile('[B]%s Jarvis Builds(%s)[/B]' % (state, count16), 'togglesetting', 'show16', themeit=THEME3)
if SHOW16 == 'true':
for name, version, url, url2, url3, gui, kodi, theme, icon, fanart, adult, description, preview in match:
if not SHOWADULT == 'true' and adult.lower() == 'yes': continue
if not DEVELOPER == 'true' and wiz.strTest(name): continue
kodiv = int(float(kodi))
if kodiv == 16:
menu = createMenu('install', '', name)
addDir('[%s] %s (v%s)' % (float(kodi), name, version), 'viewbuild', name, description=description, fanart=fanart,icon=icon, menu=menu, themeit=THEME2)
else:
if kodi_ver == "Leia":
state = '+' if SHOW18 == 'false' else '-'
addFile('[B]%s Leia Builds(%s)[/B]' % (state, count18), 'togglesetting', 'show18', themeit=THEME3)
if SHOW18 == 'true':
for name, version, url, url2, url3, gui, kodi, theme, icon, fanart, adult, description, preview in match:
if not SHOWADULT == 'true' and adult.lower() == 'yes': continue
if not DEVELOPER == 'true' and wiz.strTest(name): continue
kodiv = int(float(kodi))
if kodiv == 18:
menu = createMenu('install', '', name)
addDir('[%s] %s (v%s)' % (float(kodi), name, version), 'viewbuild', name, description=description, fanart=fanart,icon=icon, menu=menu, themeit=THEME2)
elif kodi_ver == "Krypton":
state = '+' if SHOW17 == 'false' else '-'
addFile('[B]%s Krypton Builds(%s)[/B]' % (state, count17), 'togglesetting', 'show17', themeit=THEME3)
if SHOW17 == 'true':
for name, version, url, url2, url3, gui, kodi, theme, icon, fanart, adult, description, preview in match:
if not SHOWADULT == 'true' and adult.lower() == 'yes': continue
if not DEVELOPER == 'true' and wiz.strTest(name): continue
kodiv = int(float(kodi))
if kodiv == 17:
menu = createMenu('install', '', name)
addDir('[%s] %s (v%s)' % (float(kodi), name, version), 'viewbuild', name, description=description, fanart=fanart,icon=icon, menu=menu, themeit=THEME2)
elif kodi_ver == "Jarvis":
state = '+' if SHOW16 == 'false' else '-'
addFile('[B]%s Jarvis Builds(%s)[/B]' % (state, count16), 'togglesetting', 'show16', themeit=THEME3)
if SHOW16 == 'true':
for name, version, url, url2, url3, gui, kodi, theme, icon, fanart, adult, description, preview in match:
if not SHOWADULT == 'true' and adult.lower() == 'yes': continue
if not DEVELOPER == 'true' and wiz.strTest(name): continue
kodiv = int(float(kodi))
if kodiv == 16:
menu = createMenu('install', '', name)
addDir('[%s] %s (v%s)' % (float(kodi), name, version), 'viewbuild', name, description=description, fanart=fanart,icon=icon, menu=menu, themeit=THEME2)
elif hidden > 0:
if adultcount > 0:
addFile('There is currently only Adult builds', '', icon=ICONBUILDS, themeit=THEME3)
addFile('Enable Show Adults in Addon Settings > Misc', '', icon=ICONBUILDS, themeit=THEME3)
else:
addFile('Currently No Builds Offered from %s' % ADDONTITLE, '', icon=ICONBUILDS, themeit=THEME3)
else: addFile('Text file for builds not formated correctly.', '', icon=ICONBUILDS, themeit=THEME3)
setView('files', 'viewType')
def viewBuild(name):
bf = wiz.textCache(BUILDFILE)
if bf == False:
WORKINGURL = wiz.workingURL(BUILDFILE)
addFile('Url for txt file not valid', '', themeit=THEME3)
addFile('%s' % WORKINGURL, '', themeit=THEME3)
return
if wiz.checkBuild(name, 'version') == False:
addFile('Error reading the txt file.', '', themeit=THEME3)
addFile('%s was not found in the builds list.' % name, '', themeit=THEME3)
return
link = bf.replace('\n','').replace('\r','').replace('\t','').replace('gui=""', 'gui="http://"').replace('theme=""', 'theme="http://"').replace('url2=""', 'url2="http://"').replace('url3=""', 'url3="http://"').replace('preview=""', 'preview="http://"').replace('"https://"', 'preview="http://"')
match = re.compile('name="%s".+?ersion="(.+?)".+?rl="(.+?)".+?rl2="(.+?)".+?rl3="(.+?)".+?ui="(.+?)".+?odi="(.+?)".+?heme="(.+?)".+?con="(.+?)".+?anart="(.+?)".+?dult="(.+?)".+?escription="(.+?)".+?review="(.+?)"' % name).findall(link)
for version, url, url2, url3, gui, kodi, themefile, icon, fanart, adult, description, preview in match:
icon = icon
fanart = fanart
build = '%s (v%s)' % (name, version)
if BUILDNAME == name and version > BUILDVERSION:
build = '%s [COLOR red][CURRENT v%s][/COLOR]' % (build, BUILDVERSION)
addFile(build, '', description=description, fanart=fanart, icon=icon, themeit=THEME4)
if HIDESPACERS == 'No': addFile(wiz.sep(), '', themeit=THEME3)
addDir ('Save Data Menu', 'savedata', icon=ICONSAVE, themeit=THEME3)
addFile('Build Information', 'buildinfo', name, description=description, fanart=fanart, icon=icon, themeit=THEME3)
if not preview == "http://": addFile('View Video Preview', 'buildpreview', name, description=description, fanart=fanart, icon=icon, themeit=THEME3)
temp1 = int(float(KODIV)); temp2 = int(float(kodi))
if not temp1 == temp2:
if temp1 == 16 and temp2 <= 15: warning = False
else: warning = True
else: warning = False
if warning == True:
addFile('BUILD DESIGNED FOR KODI VERSION %s [COLOR yellow](INSTALLED: %s)[/COLOR]' % (str(kodi), str(KODIV)), '', fanart=fanart, icon=icon, themeit=THEME6)
addFile(wiz.sep('INSTALL'), '', fanart=fanart, icon=icon, themeit=THEME3)
addFile('Fresh Start then Install' , 'install', name, 'fresh' , description=description, fanart=fanart, icon=icon, themeit=THEME1)
addFile('Standard Install', 'install', name, 'normal' , description=description, fanart=fanart, icon=icon, themeit=THEME1)
if not gui == 'http://': addFile('Apply guiFix' , 'install', name, 'gui' , description=description, fanart=fanart, icon=icon, themeit=THEME1)
if not themefile == 'http://':
themecheck = wiz.textCache(themefile)
if not themecheck == False:
addFile(wiz.sep('THEMES'), '', fanart=fanart, icon=icon, themeit=THEME3)
link = themecheck.replace('\n','').replace('\r','').replace('\t','')
match = re.compile('name="(.+?)".+?rl="(.+?)".+?con="(.+?)".+?anart="(.+?)".+?escription="(.+?)"').findall(link)
for themename, themeurl, themeicon, themefanart, description in match:
themeicon = themeicon if themeicon == 'http://' else icon
themefanart = themefanart if themefanart == 'http://' else fanart
addFile(themename if not themename == BUILDTHEME else "[B]%s (Installed)[/B]" % themename, 'theme', name, themename, description=description, fanart=themefanart, icon=themeicon, themeit=THEME3)
setView('files', 'viewType')
def viewThirdList(number):
name = eval('THIRD%sNAME' % number)
url = eval('THIRD%sURL' % number)
work = wiz.workingURL(url)
if not work == True:
addFile('Url for txt file not valid', '', icon=ICONBUILDS, themeit=THEME3)
addFile('%s' % WORKINGURL, '', icon=ICONBUILDS, themeit=THEME3)
else:
type, buildslist = wiz.thirdParty(url)
addFile("[B]%s[/B]" % name, '', themeit=THEME3)
if HIDESPACERS == 'No': addFile(wiz.sep(), '', themeit=THEME3)
if type:
for name, version, url, kodi, icon, fanart, adult, description in buildslist:
if not SHOWADULT == 'true' and adult.lower() == 'yes': continue
addFile("[%s] %s v%s" % (kodi, name, version), 'installthird', name, url, icon=icon, fanart=fanart, description=description, themeit=THEME2)
else:
for name, url, icon, fanart, description in buildslist:
addFile(name, 'installthird', name, url, icon=icon, fanart=fanart, description=description, themeit=THEME2)
def editThirdParty(number):
name = eval('THIRD%sNAME' % number)
url = eval('THIRD%sURL' % number)
name2 = wiz.getKeyboard(name, 'Enter the Name of the Wizard')
url2 = wiz.getKeyboard(url, 'Enter the URL of the Wizard Text')
wiz.setS('wizard%sname' % number, name2)
wiz.setS('wizard%surl' % number, url2)
def apkScraper(name=""):
if name == 'kodi':
kodiurl1 = 'http://mirrors.kodi.tv/releases/android/arm/'
kodiurl2 = 'http://mirrors.kodi.tv/releases/android/arm/old/'
url1 = wiz.openURL(kodiurl1).replace('\n', '').replace('\r', '').replace('\t', '')
url2 = wiz.openURL(kodiurl2).replace('\n', '').replace('\r', '').replace('\t', '')
x = 0
match1 = re.compile('
(.+?) | (.+?) | (.+?) |
').findall(url1)
match2 = re.compile('(.+?) | (.+?) | (.+?) |
').findall(url2)
addFile("Official Kodi Apk\'s", themeit=THEME1)
rc = False
for url, name, size, date in match1:
if url in ['../', 'old/']: continue
if not url.endswith('.apk'): continue
if not url.find('_') == -1 and rc == True: continue
try:
tempname = name.split('-')
if not url.find('_') == -1:
rc = True
name2, v2 = tempname[2].split('_')
else:
name2 = tempname[2]
v2 = ''
title = "[COLOR %s]%s v%s%s %s[/COLOR] [COLOR %s]%s[/COLOR] [COLOR %s]%s[/COLOR]" % (COLOR1, tempname[0].title(), tempname[1], v2.upper(), name2, COLOR2, size.replace(' ', ''), COLOR1, date)
download = urljoin(kodiurl1, url)
addFile(title, 'apkinstall', "%s v%s%s %s" % (tempname[0].title(), tempname[1], v2.upper(), name2), download)
x += 1
except:
wiz.log("Error on: %s" % name)
for url, name, size, date in match2:
if url in ['../', 'old/']: continue
if not url.endswith('.apk'): continue
if not url.find('_') == -1: continue
try:
tempname = name.split('-')
title = "[COLOR %s]%s v%s %s[/COLOR] [COLOR %s]%s[/COLOR] [COLOR %s]%s[/COLOR]" % (COLOR1, tempname[0].title(), tempname[1], tempname[2], COLOR2, size.replace(' ', ''), COLOR1, date)
download = urljoin(kodiurl2, url)
addFile(title, 'apkinstall', "%s v%s %s" % (tempname[0].title(), tempname[1], tempname[2]), download)
x += 1
except:
wiz.log("Error on: %s" % name)
if x == 0: addFile("Error Kodi Scraper Is Currently Down.")
elif name == 'spmc':
spmcurl1 = 'https://github.com/koying/SPMC/releases'
url1 = wiz.openURL(spmcurl1).replace('\n', '').replace('\r', '').replace('\t', '')
x = 0
match1 = re.compile('