Пример #1
0
def autoUpdate(who):
    if who == 'all':
        for log in TRAKTID:
            if os.path.exists(TRAKTID[log]['path']):
                autoUpdate(log)
    elif TRAKTID[who]:
        if os.path.exists(TRAKTID[who]['path']):
            u = traktUser(who)
            su = wiz.getS(TRAKTID[who]['saved'])
            n = TRAKTID[who]['name']
            if u == None or u == '': return
            elif su == '': traktIt('update', who)
            elif not u == su:
                if DIALOG.yesno(
                        "[COLOR %s]%s[/COLOR]" % (COLOR1, ADDONTITLE),
                        "[COLOR %s]Would you like to save the [COLOR %s]Trakt[/COLOR] data for [COLOR %s]%s[/COLOR]?"
                        % (COLOR2, COLOR1, COLOR1, n),
                        "Addon: [COLOR green][B]%s[/B][/COLOR]" % u,
                        "Saved:[/COLOR] [COLOR red][B]%s[/B][/COLOR]" %
                        su if not su == '' else
                        'Saved:[/COLOR] [COLOR red][B]None[/B][/COLOR]',
                        yeslabel="[B][COLOR %s]Save Trakt[/COLOR][/B]" %
                        COLOR2,
                        nolabel="[B][COLOR %s]No, Cancel[/COLOR][/B]" %
                        COLOR1):
                    traktIt('update', who)
            else:
                traktIt('update', who)
Пример #2
0
def autoUpdate(who):
    if who == 'all':
        for log in DEBRIDID:
            if os.path.exists(DEBRIDID[log]['path']):
                autoUpdate(log)
    elif DEBRIDID[who]:
        if os.path.exists(DEBRIDID[who]['path']):
            u = debridUser(who)
            su = wiz.getS(DEBRIDID[who]['saved'])
            n = DEBRIDID[who]['name']
            if u == None or u == '': return
            elif su == '': debridIt('update', who)
            elif not u == su:
                if DIALOG.yesno(
                        "[COLOR %s]%s[/COLOR]" % (COLOR1, ADDONTITLE),
                        "[COLOR %s]Would you like to save the [COLOR %s]Real Debrid[/COLOR] Info for [COLOR %s]%s[/COLOR]?"
                        % (COLOR2, COLOR1, COLOR1, n),
                        "Addon: [COLOR green][B]%s[/B][/COLOR]" % u,
                        "Saved:[/COLOR] [COLOR red][B]%s[/B][/COLOR]" %
                        su if not su == '' else
                        'Saved:[/COLOR] [COLOR red][B]None[/B][/COLOR]',
                        yeslabel="[B][COLOR %s]Save Debrid[/COLOR][/B]" %
                        COLOR2,
                        nolabel="[B][COLOR %s]No, Cancel[/COLOR][/B]" %
                        COLOR1):
                    debridIt('update', who)
            else:
                debridIt('update', who)
Пример #3
0
		def onInit(self):
			self.title      = 101
			self.okbutton   = 201
			self.trakt      = 301
			self.debrid     = 302
			self.login      = 303
			self.sources    = 304
			self.profiles   = 305
			self.advanced   = 306
			self.favourites = 307
			self.superfav   = 308
			self.repo       = 309
			self.whitelist  = 310
			self.cache      = 311
			self.packages   = 312
			self.thumbs     = 313
			self.showdialog()
			self.controllist     = [self.trakt, self.debrid, self.login, 
									self.sources, self.profiles, self.advanced, 
									self.favourites, self.superfav, self.repo, 
									self.whitelist, self.cache, self.packages, self.thumbs]
			self.controlsettings = ['keeptrakt', 'keepdebrid', 'keeplogin',
									'keepsources', 'keepprofiles', 'keepadvanced',
									'keepfavourites', 'keeprepos', 'keepsuper', 
									'keepwhitelist', 'clearcache', 'clearpackages', 'clearthumbs']
			for item in self.controllist:
				if wiz.getS(self.controlsettings[self.controllist.index(item)]) == 'true':
					self.getControl(item).setSelected(True)
Пример #4
0
def updateTrakt(do, who):
    file = TRAKTID[who]['file']
    settings = TRAKTID[who]['settings']
    data = TRAKTID[who]['data']
    addonid = wiz.addonId(TRAKTID[who]['plugin'])
    saved = TRAKTID[who]['saved']
    default = TRAKTID[who]['default']
    user = addonid.getSetting(default)
    suser = wiz.getS(saved)
    name = TRAKTID[who]['name']
    icon = TRAKTID[who]['icon']

    if do == 'update':
        if not user == '':
            try:
                with open(file, 'w') as f:
                    for trakt in data:
                        f.write(
                            '<trakt>\n\t<id>%s</id>\n\t<value>%s</value>\n</trakt>\n'
                            % (trakt, addonid.getSetting(trakt)))
                    f.close()
                user = addonid.getSetting(default)
                wiz.setS(saved, user)
                wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name),
                              '[COLOR %s]Trakt Info: Saved![/COLOR]' % COLOR2,
                              2000, icon)
            except Exception, e:
                wiz.log(
                    "[Trakt Info] Unable to Update %s (%s)" % (who, str(e)),
                    xbmc.LOGERROR)
        else:
            wiz.LogNotify(
                "[COLOR %s]%s[/COLOR]" % (COLOR1, name),
                '[COLOR %s]Trakt Info: Not Registered![/COLOR]' % COLOR2, 2000,
                icon)
Пример #5
0
def importlist(who):
    if who == 'all':
        for log in DEBRIDID:
            if os.path.exists(DEBRIDID[log]['file']):
                importlist(log)
    elif DEBRIDID[who]:
        if os.path.exists(DEBRIDID[who]['file']):
            d = DEBRIDID[who]['default']
            sa = DEBRIDID[who]['saved']
            su = wiz.getS(sa)
            n = DEBRIDID[who]['name']
            f = open(DEBRIDID[who]['file'], mode='r')
            g = f.read().replace('\n', '').replace('\r', '').replace('\t', '')
            f.close()
            m = re.compile('<debrid><id>%s</id><value>(.+?)</value></debrid>' %
                           d).findall(g)
            if len(m) > 0:
                if not m[0] == su:
                    if DIALOG.yesno(
                            "[COLOR %s]%s[/COLOR]" % (COLOR1, ADDONTITLE),
                            "[COLOR %s]Would you like to import the [COLOR %s]Real Debrid[/COLOR] Info for [COLOR %s]%s[/COLOR]?"
                            % (COLOR2, COLOR1, COLOR1, n),
                            "File: [COLOR green][B]%s[/B][/COLOR]" % m[0],
                            "Saved:[/COLOR] [COLOR red][B]%s[/B][/COLOR]" %
                            su if not su == '' else
                            'Saved:[/COLOR] [COLOR red][B]None[/B][/COLOR]',
                            yeslabel="[B][COLOR %s]Import Debrid[/COLOR][/B]" %
                            COLOR2,
                            nolabel="[B][COLOR %s]No, Cancel[/COLOR][/B]" %
                            COLOR1):
                        wiz.setS(sa, m[0])
                        wiz.log('[Import Data] %s: %s' % (who, str(m)),
                                xbmc.LOGNOTICE)
                    else:
                        wiz.log(
                            '[Import Data] Declined Import(%s): %s' %
                            (who, str(m)), xbmc.LOGNOTICE)
                else:
                    wiz.log('[Import Data] Duplicate Entry(%s): %s' %
                            (who, str(m))), xbmc.LOGNOTICE
            else:
                wiz.log('[Import Data] No Match(%s): %s' % (who, str(m)),
                        xbmc.LOGNOTICE)
Пример #6
0
ADDON_ID = uservar.ADDON_ID
ADDON = wiz.addonId(ADDON_ID)
DIALOG = xbmcgui.Dialog()
HOME = xbmc.translatePath('special://home/')
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')
ADDONDATA = os.path.join(USERDATA, 'addon_data', ADDON_ID)
ADDOND = os.path.join(USERDATA, 'addon_data')
REALFOLD = os.path.join(ADDONDATA, 'debrid')
ICON = os.path.join(PLUGIN, 'icon.png')
TODAY = date.today()
TOMORROW = TODAY + timedelta(days=1)
THREEDAYS = TODAY + timedelta(days=3)
KEEPTRAKT = wiz.getS('keepdebrid')
REALSAVE = wiz.getS('debridlastsave')
COLOR1 = uservar.COLOR1
COLOR2 = uservar.COLOR2
ORDER = ['bubbles', 'mrk', 'specto', 'url']

DEBRIDID = {
    'bubbles': {
        'name':
        'Bubbles',
        'plugin':
        'plugin.video.bubbles',
        'saved':
        'realbubbles',
        'path':
        os.path.join(ADDONS, 'plugin.video.bubbles'),
Пример #7
0
		def doDismiss(self):
			if not test == True:
				wiz.setS("notedismiss","true")
			wiz.log("[Notification] NotifyID %s Dismissed" % wiz.getS('noteid'), xbmc.LOGNOTICE)
			self.close()
Пример #8
0
		def doRemindMeLater(self):
			if not test == True:
				wiz.setS("notedismiss","false")
			wiz.log("[Notification] NotifyID %s Remind Me Later" % wiz.getS('noteid'), xbmc.LOGNOTICE)
			self.close()
Пример #9
0
def firstRunSettings():
	class firstRun(xbmcgui.WindowXMLDialog):
		def __init__(self,*args,**kwargs):
			self.whitelistcurrent = kwargs['current']
		
		def onInit(self):
			self.title      = 101
			self.okbutton   = 201
			self.trakt      = 301
			self.debrid     = 302
			self.login      = 303
			self.sources    = 304
			self.profiles   = 305
			self.advanced   = 306
			self.favourites = 307
			self.superfav   = 308
			self.repo       = 309
			self.whitelist  = 310
			self.cache      = 311
			self.packages   = 312
			self.thumbs     = 313
			self.showdialog()
			self.controllist     = [self.trakt, self.debrid, self.login, 
									self.sources, self.profiles, self.advanced, 
									self.favourites, self.superfav, self.repo, 
									self.whitelist, self.cache, self.packages, self.thumbs]
			self.controlsettings = ['keeptrakt', 'keepdebrid', 'keeplogin',
									'keepsources', 'keepprofiles', 'keepadvanced',
									'keepfavourites', 'keeprepos', 'keepsuper', 
									'keepwhitelist', 'clearcache', 'clearpackages', 'clearthumbs']
			for item in self.controllist:
				if wiz.getS(self.controlsettings[self.controllist.index(item)]) == 'true':
					self.getControl(item).setSelected(True)

		def showdialog(self):
			self.getControl(self.title).setLabel(ADDONTITLE)
			self.setFocus(self.getControl(self.okbutton))
			
		def onClick(self, controlId):
			if controlId == self.okbutton:
				self.close()

				for item in self.controllist:
					at = self.controllist.index(item)
					if self.getControl(item).isSelected(): wiz.setS(self.controlsettings[at], 'true')
					else: wiz.setS(self.controlsettings[at], 'false')
						
				if self.getControl(self.whitelist).isSelected() and not self.whitelistcurrent == 'true':
					wiz.whiteList('edit')

	fr = firstRun( "FirstRunSaveData.xml" , ADDON.getAddonInfo('path'), 'DefaultSkin', current=wiz.getS('keepwhitelist'))
	fr.doModal()
	del fr
Пример #10
0
ADDONPATH      = wiz.addonInfo(ADDON_ID,'path')
ADDONTITLE     = uservar.ADDONTITLE
DIALOG         = xbmcgui.Dialog()
DP             = xbmcgui.DialogProgress()
HOME           = xbmc.translatePath('special://home/')
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')
ADDONDATA      = os.path.join(USERDATA,  'addon_data', ADDON_ID)
FANART         = os.path.join(ADDONPATH, 'fanart.jpg')
ICON           = os.path.join(ADDONPATH, 'icon.png')
ART            = os.path.join(ADDONPATH, 'resources', 'art')
SKINFOLD       = os.path.join(ADDONPATH, 'resources', 'skins', 'DefaultSkin', 'media')
ADVANCED       = os.path.join(USERDATA,  'advancedsettings.xml')
NOTIFY         = wiz.getS('notify')
NOTEID         = wiz.getS('noteid')
NOTEDISMISS    = wiz.getS('notedismiss')
BUILDNAME      = wiz.getS('buildname')
BUILDVERSION   = wiz.getS('buildversion')
LATESTVERSION  = wiz.checkBuild(BUILDNAME, 'version')
TODAY          = date.today()
KODIV          = float(xbmc.getInfoLabel("System.BuildVersion")[:4])
TOMORROW       = TODAY + timedelta(days=1)
THREEDAYS      = TODAY + timedelta(days=3)
UPDATECHECK    = uservar.UPDATECHECK if str(uservar.UPDATECHECK).isdigit() else 1
NEXTCHECK      = TODAY + timedelta(days=UPDATECHECK)
NOTIFICATION   = uservar.NOTIFICATION
ENABLE         = uservar.ENABLE
HEADERTYPE     = uservar.HEADERTYPE if uservar.HEADERTYPE == 'Image' else 'Text'
HEADERMESSAGE  = uservar.HEADERMESSAGE
Пример #11
0
AUTOUPDATE = plugintools.get_setting("updaterepos")
#SIZE_CHECK          = plugintools.get_setting("startupsize")
AUTOCLEANUP = plugintools.get_setting("acstartup")
AUTOCACHE = plugintools.get_setting("accache")
AUTOPACKAGES = plugintools.get_setting("acpackages")
AUTOTHUMBS = plugintools.get_setting("acthumbs")
AUTOCRASH = plugintools.get_setting("accrash")
#CLEAR_CACHE_SIZE    = plugintools.get_setting("cachemb")
#CLEAR_PACKAGES_SIZE = plugintools.get_setting("packagesmb")
#CLEAR_THUMBS_SIZE   = plugintools.get_setting("thumbsmb")

#AUTOCLEANUP         = wiz.getS('autoclean')
#AUTOCACHE           = wiz.getS('clearcache')
#AUTOPACKAGES        = wiz.getS('clearpackages')
#AUTOTHUMBS          = wiz.getS('clearthumbs')
AUTOFREQ = wiz.getS('autocleanfreq')
AUTONEXTRUN = wiz.getS('nextautocleanup')

AUTOFREQ = int(AUTOFREQ) if AUTOFREQ.isdigit() else 0
TODAY = date.today()
TOMORROW = TODAY + timedelta(days=1)
TWODAYS = TODAY + timedelta(days=2)
THREEDAYS = TODAY + timedelta(days=3)
ONEWEEK = TODAY + timedelta(days=7)

BASEURL = base64.b64decode(b"aHR0cDovL2VjaG9jb2Rlci5jb20v")
nointernet = 0

#Update Information
PICKLE_VERSION = os.path.join(USERDATA, '.pickle_build.txt')
HOME = xbmc.translatePath('special://home/')
Пример #12
0
ADDON_ID = uservar.ADDON_ID
ADDON = wiz.addonId(ADDON_ID)
DIALOG = xbmcgui.Dialog()
HOME = xbmc.translatePath('special://home/')
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')
ADDONDATA = os.path.join(USERDATA, 'addon_data', ADDON_ID)
ADDOND = os.path.join(USERDATA, 'addon_data')
TRAKTFOLD = os.path.join(ADDONDATA, 'trakt')
ICON = os.path.join(PLUGIN, 'icon.png')
TODAY = date.today()
TOMORROW = TODAY + timedelta(days=1)
THREEDAYS = TODAY + timedelta(days=3)
KEEPTRAKT = wiz.getS('keeptrakt')
TRAKTSAVE = wiz.getS('traktlastsave')
COLOR1 = uservar.COLOR1
COLOR2 = uservar.COLOR2
ORDER = [
    'anarchy', 'bubbles', 'covenant', 'death', 'exodus', 'exoshark', 'gurzil',
    'metalliq', 'neptune', 'notsure', 'piranha', 'poseidon', 'resistance',
    'salts', 'saltshd', 'saltsrd', 'specto', 'streamhub', 'thedelorean',
    'trakt', 'ugottoc', 'wtfork'
]

TRAKTID = {
    'anarchy': {
        'name': 'AnArchy',
        'plugin': 'plugin.video.AnArchy',
        'saved': 'anarchy',