Beispiel #1
0
 def do_dismiss(self):
     if not test:
         CONFIG.set_setting('notedismiss', 'true')
     logging.log('[Notifications] Notification {0} Dismissed'.format(
         CONFIG.get_setting('noteid')))
     self.close()
     if 57 - 57: i11iIiiIii.I1ii11iIi11i - Ii1I - oO0o + OoOoOO00
Beispiel #2
0
def debrid_it(do, who):
    if not os.path.exists(CONFIG.ADDON_DATA):
        os.makedirs(CONFIG.ADDON_DATA)
    if not os.path.exists(CONFIG.DEBRIDFOLD):
        os.makedirs(CONFIG.DEBRIDFOLD)
    if who == 'all':
        for log in ORDER:
            if os.path.exists(DEBRIDID[log]['path']):
                try:
                    addonid = tools.get_addon_by_id(DEBRIDID[log]['plugin'])
                    default = DEBRIDID[log]['default']
                    user = addonid.getSetting(default)

                    update_debrid(do, log)
                except:
                    pass
            else:
                logging.log('[Debrid Info] {0}({1}) is not installed'.format(
                    DEBRIDID[log]['name'], DEBRIDID[log]['plugin']),
                            level=xbmc.LOGERROR)
        CONFIG.set_setting('debridnextsave',
                           tools.get_date(days=3, formatted=True))
    else:
        if DEBRIDID[who]:
            if os.path.exists(DEBRIDID[who]['path']):
                update_debrid(do, who)
        else:
            logging.log('[Debrid Info] Invalid Entry: {0}'.format(who),
                        level=xbmc.LOGERROR)
 def do_ignore(self):
     logging.log("[Current Build Check] [User Selected: Ignore Build Menu] [Next Check: {0}]".format(CONFIG.BUILDCHECK),
                 level=xbmc.LOGINFO)
     CONFIG.set_setting('nextbuildcheck', tools.get_date(days=CONFIG.UPDATECHECK, formatted=True))
     CONFIG.set_setting('installed', 'ignored')
     
     self.close()
def addon_updates(do=None):
    setting = '"general.addonupdates"'
    if do == 'set':
        query = '{{"jsonrpc":"2.0", "method":"Settings.GetSettingValue","params":{{"setting":{0}}}, "id":1}}'.format(
            setting)
        response = xbmc.executeJSONRPC(query)
        match = re.compile('{"value":(.+?)}').findall(response)
        if len(match) > 0:
            default = match[0]
        else:
            default = 0
        CONFIG.set_setting('default.addonupdate', str(default))
        query = '{{"jsonrpc":"2.0", "method":"Settings.SetSettingValue","params":{{"setting":{0},"value":{1}}}, "id":1}}'.format(
            setting, '2')
        response = xbmc.executeJSONRPC(query)
    elif do == 'reset':
        try:
            value = int(float(CONFIG.get_setting('default.addonupdate')))
        except:
            value = 0
        if value not in [0, 1, 2]:
            value = 0
        query = '{{"jsonrpc":"2.0", "method":"Settings.SetSettingValue","params":{{"setting":{0},"value":{1}}}, "id":1}}'.format(
            setting, value)
        response = xbmc.executeJSONRPC(query)
Beispiel #5
0
def trakt_it(do, who):
    if not os.path.exists(CONFIG.ADDON_DATA):
        os.makedirs(CONFIG.ADDON_DATA)
    if not os.path.exists(CONFIG.TRAKTFOLD):
        os.makedirs(CONFIG.TRAKTFOLD)
    if who == 'all':
        for log in ORDER:
            if os.path.exists(TRAKTID[log]['path']):
                try:
                    addonid = tools.get_addon_by_id(TRAKTID[log]['plugin'])
                    default = TRAKTID[log]['default']
                    user = addonid.getSetting(default)

                    update_trakt(do, log)
                except:
                    pass
            else:
                logging.log('[Trakt Data] {0}({1}) is not installed'.format(
                    TRAKTID[log]['name'], TRAKTID[log]['plugin']),
                            level=xbmc.LOGERROR)
        CONFIG.set_setting('traktnextsave',
                           tools.get_date(days=3, formatted=True))
    else:
        if TRAKTID[who]:
            if os.path.exists(TRAKTID[who]['path']):
                update_trakt(do, who)
        else:
            logging.log('[Trakt Data] Invalid Entry: {0}'.format(who),
                        level=xbmc.LOGERROR)
Beispiel #6
0
 def do_remind(self):
     if not test:
         CONFIG.set_setting("notedismiss", "false")
     logging.log("[Notification] NotifyID {0} Remind Me Later".format(
         CONFIG.get_setting('noteid')),
                 level=xbmc.LOGNOTICE)
     self.close()
Beispiel #7
0
def auto_clean():
    service = False
    days = [tools.get_date(formatted=True), tools.get_date(days=1, formatted=True), tools.get_date(days=3, formatted=True), tools.get_date(days=7, formatted=True),
            tools.get_date(days=30, formatted=True)]

    freq = int(CONFIG.AUTOFREQ)
    next_cleanup = time.mktime(time.strptime(CONFIG.NEXTCLEANDATE, "%Y-%m-%d %H:%M:%S"))

    if next_cleanup <= tools.get_date() or freq == 0:
        service = True
        next_run = days[freq]
        CONFIG.set_setting('nextautocleanup', next_run)
    else:
        logging.log("[Auto Clean Up] Next Clean Up {0}".format(CONFIG.NEXTCLEANDATE),
                    level=xbmc.LOGINFO)
    if service:
        if CONFIG.AUTOCACHE == 'true':
            logging.log('[Auto Clean Up] Cache: On', level=xbmc.LOGINFO)
            clear.clear_cache(True)
        else:
            logging.log('[Auto Clean Up] Cache: Off', level=xbmc.LOGINFO)
        if CONFIG.AUTOTHUMBS == 'true':
            logging.log('[Auto Clean Up] Old Thumbs: On', level=xbmc.LOGINFO)
            clear.old_thumbs()
        else:
            logging.log('[Auto Clean Up] Old Thumbs: Off', level=xbmc.LOGINFO)
        if CONFIG.AUTOPACKAGES == 'true':
            logging.log('[Auto Clean Up] Packages: On', level=xbmc.LOGINFO)
            clear.clear_packages_startup()
        else:
            logging.log('[Auto Clean Up] Packages: Off', level=xbmc.LOGINFO)
Beispiel #8
0
def inputurl(name):
    if name == 'buildlink':
        keyboardHandle = xbmc.Keyboard(
            CONFIG.get_setting('buildlink'),
            '[COLOR yellow]Nhập link chứa list Build của bạn: (hỗ trợ bit.ly, gg.gg)[/COLOR]\n[I](Xem cách tạo list tại https://hieuit.net/hieuitwizard)[/I]'
        )

    elif name == 'datalink':
        keyboardHandle = xbmc.Keyboard(
            CONFIG.get_setting('datalink'),
            '[COLOR yellow]Nhập link chứa list Datafile của bạn: (hỗ trợ bit.ly, gg.gg)[/COLOR]\n[I](Xem cách tạo list tại https://hieuit.net/hieuitwizard)[/I]'
        )

    keyboardHandle.doModal()
    if (keyboardHandle.isConfirmed()):
        queryText = keyboardHandle.getText()
        if len(queryText) == 0:
            sys.exit()
        else:
            working = _check_url(queryText, cred=None)
            if not working == True:
                dialog = xbmcgui.Dialog()
                dialog.ok(CONFIG.ADDONTITLE, 'Sai URL\nVui lòng nhập lại')
                inputurl(name)
            else:
                # link = name
                CONFIG.set_setting(name, queryText)
Beispiel #9
0
 def do_dismiss(self):
     from resources.libs.common import logging
     if not test:
         CONFIG.set_setting("notedismiss", "true")
     logging.log("[Notification] NotifyID {0} Dismissed".format(CONFIG.get_setting('noteid')),
                 level=xbmc.LOGNOTICE)
     self.close()
Beispiel #10
0
 def do_ignore(self):
     logging.log("[Verificación Build Actual] [Usuario seleccionado: Ignorar Build Menu] [Siguiente Verificación: {0}]".format(CONFIG.BUILDCHECK),
                 level=xbmc.LOGINFO)
     CONFIG.set_setting('nextbuildcheck', tools.get_date(days=CONFIG.UPDATECHECK, formatted=True))
     CONFIG.set_setting('instalado', 'ignorado')
     
     self.close()
Beispiel #11
0
 def do_remind(self):
     if not test:
         CONFIG.set_setting('notedismiss', 'false')
     logging.log(
         '[Notifications] Notification {0} Remind Me Later'.format(
             CONFIG.get_setting('noteid')))
     self.close()
Beispiel #12
0
def look_and_feel_data(do='save'):
    from resources.libs.common import logging

    scan = [
        'lookandfeel.enablerssfeeds', 'lookandfeel.font',
        'lookandfeel.rssedit', 'lookandfeel.skincolors',
        'lookandfeel.skintheme', 'lookandfeel.skinzoom',
        'lookandfeel.soundskin', 'lookandfeel.startupwindow',
        'lookandfeel.stereostrength'
    ]

    if do == 'save':
        for item in scan:
            query = '{{"jsonrpc":"2.0", "method":"Settings.GetSettingValue","params":{{"setting":"{0}"}}, "id":1}}'.format(
                item)
            response = xbmc.executeJSONRPC(query)
            if 'error' not in response:
                match = re.compile('{"value":(.+?)}').findall(str(response))
                CONFIG.set_setting(item.replace('lookandfeel', 'default'),
                                   match[0])
                logging.log("%s saved to %s" % (item, match[0]))
    else:
        for item in scan:
            value = CONFIG.get_setting(item.replace('lookandfeel', 'default'))
            query = '{{"jsonrpc":"2.0", "method":"Settings.SetSettingValue","params":{{"setting":"{0}","value":{1}}}, "id":1}}'.format(
                item, value)
            response = xbmc.executeJSONRPC(query)
            logging.log("{0} restored to {1}".format(item, value))
Beispiel #13
0
def show_notification():
    if not CONFIG.NOTIFY == 'true':
        response = tools.open_url(CONFIG.NOTIFICATION)
        if response:
            note_id, msg = window.split_notify(CONFIG.NOTIFICATION)
            if note_id:
                try:
                    note_id = int(note_id)
                    if note_id == CONFIG.NOTEID:
                        if CONFIG.NOTEDISMISS == 'false':
                            window.show_notification(msg)
                        else:
                            logging.log("[Notifications] id[{0}] Dismissed".format(int(id)), level=xbmc.LOGNOTICE)
                    elif note_id > CONFIG.NOTEID:
                        logging.log("[Notifications] id: {0}".format(str(id)), level=xbmc.LOGNOTICE)
                        CONFIG.set_setting('noteid', str(id))
                        CONFIG.set_setting('notedismiss', 'false')
                        window.show_notification(msg=msg)
                        logging.log("[Notifications] Complete", level=xbmc.LOGNOTICE)
                except Exception as e:
                    logging.log("Error on Notifications Window: {0}".format(str(e)), level=xbmc.LOGERROR)
            else:
                logging.log("[Notifications] Text File not formatted Correctly")
        else:
            logging.log("[Notifications] URL({0}): {1}".format(CONFIG.NOTIFICATION, response), level=xbmc.LOGNOTICE)
    else:
        logging.log("[Notifications] Turned Off", level=xbmc.LOGNOTICE)
def toggle_cache(state):
    cachelist = [
        'includevideo', 'includeall', 'includeexodusredux', 'includegaia',
        'includenumbers', 'includescrubs', 'includeseren', 'includethecrew',
        'includevenom'
    ]
    titlelist = [
        'Include Video Addons', 'Include All Addons', 'Include Exodus Redux',
        'Include Gaia', 'Include NuMb3r5', 'Include Scrubs v2',
        'Include Seren', 'Include THE CREW', 'Include Venom'
    ]
    if state in ['true', 'false']:
        for item in cachelist:
            CONFIG.set_setting(item, state)
    else:
        if state not in ['includevideo', 'includeall'
                         ] and CONFIG.get_setting('includeall') == 'true':
            try:
                dialog = xbmcgui.Dialog()

                item = titlelist[cachelist.index(state)]
                dialog.ok(
                    CONFIG.ADDONTITLE,
                    "[COLOR {0}]You will need to turn off [COLOR {1}]Include All Addons[/COLOR] to disable[/COLOR] [COLOR {2}]{3}[/COLOR]"
                    .format(CONFIG.COLOR2, CONFIG.COLOR1, CONFIG.COLOR1, item))
            except:
                logging.log_notify(
                    "[COLOR {0}]Toggle Cache[/COLOR]".format(CONFIG.COLOR1),
                    "[COLOR {0}]Invalid Add-on ID: {1}[/COLOR]".format(
                        CONFIG.COLOR2, state))
        else:
            new = 'true' if CONFIG.get_setting(state) == 'false' else 'false'
            CONFIG.set_setting(state, new)
Beispiel #15
0
def check_log():
    from resources.libs.common import tools

    next = tools.get_date(days=1)
    lines = tools.read_from_file(CONFIG.WIZLOG).split('\n')

    if CONFIG.CLEANWIZLOGBY == '0':  # By Days
        keep = tools.get_date(days=-CONFIG.MAXWIZDATES[int(float(CONFIG.CLEANDAYS))])
        x = 0
        for line in lines:
            if str(line[1:11]) >= str(keep):
                break
            x += 1
        newfile = lines[x:]
        tools.write_to_file(CONFIG.WIZLOG, '\n'.join(newfile))
    elif CONFIG.CLEANWIZLOGBY == '1':  # By Size
        maxsize = CONFIG.MAXWIZSIZE[int(float(CONFIG.CLEANSIZE))]*1024
        if os.path.getsize(CONFIG.WIZLOG) >= maxsize:
            start = len(lines)/2
            newfile = lines[start:]
            tools.write_to_file(CONFIG.WIZLOG, '\n'.join(newfile))
    elif CONFIG.CLEANWIZLOGBY == '2':  # By Lines
        maxlines = CONFIG.MAXWIZLINES[int(float(CONFIG.CLEANLINES))]
        if len(lines) > maxlines:
            start = len(lines) - int(maxlines/2)
            newfile = lines[start:]
            tools.write_to_file(CONFIG.WIZLOG, '\n'.join(newfile))
    CONFIG.set_setting('nextcleandate', str(next))
Beispiel #16
0
def auto_clean():
    service = False
    days = [tools.get_date(), tools.get_date(days=1), tools.get_date(days=3), tools.get_date(days=7), tools.get_date(days=30)]

    freq = int(float(CONFIG.AUTOFREQ))

    if CONFIG.AUTONEXTRUN <= str(tools.get_date()) or freq == 0:
        service = True
        next_run = days[freq]
        CONFIG.set_setting('nextautocleanup', str(next_run))
    else:
        logging.log("[Auto Clean Up] Next Clean Up {0}".format(CONFIG.AUTONEXTRUN), level=xbmc.LOGNOTICE)
    if service:
        if CONFIG.AUTOCACHE == 'true':
            logging.log('[Auto Clean Up] Cache: On', level=xbmc.LOGNOTICE)
            clear.clear_cache(True)
        else:
            logging.log('[Auto Clean Up] Cache: Off', level=xbmc.LOGNOTICE)
        if CONFIG.AUTOTHUMBS == 'true':
            logging.log('[Auto Clean Up] Old Thumbs: On', level=xbmc.LOGNOTICE)
            clear.old_thumbs()
        else:
            logging.log('[Auto Clean Up] Old Thumbs: Off', level=xbmc.LOGNOTICE)
        if CONFIG.AUTOPACKAGES == 'true':
            logging.log('[Auto Clean Up] Packages: On', level=xbmc.LOGNOTICE)
            clear.clear_packages_startup()
        else:
            logging.log('[Auto Clean Up] Packages: Off', level=xbmc.LOGNOTICE)
Beispiel #17
0
def check_build_update():
    from resources.libs.common import logging
    from resources.libs.common import tools
    from resources.libs.gui import window

    response = tools.open_url(CONFIG.BUILDFILE)

    if not response:
        return

    link = response.text.replace('\n', '').replace('\r', '').replace('\t', '')
    match = re.compile('name="%s".+?ersion="(.+?)".+?con="(.+?)".+?anart="(.+?)"' % CONFIG.BUILDNAME).findall(link)
    if len(match) > 0:
        version = match[0][0]
        icon = match[0][1]
        fanart = match[0][2]
        CONFIG.set_setting('latestversion', version)
        if version > CONFIG.BUILDVERSION:
            if CONFIG.DISABLEUPDATE == 'false':
                logging.log("[Check Updates] [Installed Version: {0}] [Current Version: {1}] Opening Update Window".format(CONFIG.BUILDVERSION, version))
                window.show_update_window(CONFIG.BUILDNAME, CONFIG.BUILDVERSION, version, icon, fanart)
            else:
                logging.log("[Check Updates] [Installed Version: {0}] [Current Version: {1}] Update Window Disabled".format(CONFIG.BUILDVERSION, version))
        else:
            logging.log("[Check Updates] [Installed Version: {0}] [Current Version: {1}]".format(CONFIG.BUILDVERSION, version))
    else:
        logging.log("[Check Updates] ERROR: Unable to find build version in build text file", level=xbmc.LOGERROR)
Beispiel #18
0
def login_it(do, who):
    if not os.path.exists(CONFIG.ADDON_DATA):
        os.makedirs(CONFIG.ADDON_DATA)
    if not os.path.exists(CONFIG.LOGINFOLD):
        os.makedirs(CONFIG.LOGINFOLD)
    if who == 'all':
        for log in ORDER:
            if os.path.exists(LOGINID[log]['path']):
                try:
                    addonid = tools.get_addon_by_id(LOGINID[log]['plugin'])
                    default = LOGINID[log]['default']
                    user = addonid.getSetting(default)
                    
                    update_login(do, log)
                except:
                    pass
            else:
                logging.log('[Login Info] {0}({1}) is not installed'.format(LOGINID[log]['name'], LOGINID[log]['plugin']), level=xbmc.LOGERROR)
        CONFIG.set_setting('loginlastsave', tools.get_date(days=3))
    else:
        if LOGINID[who]:
            if os.path.exists(LOGINID[who]['path']):
                update_login(do, who)
        else:
            logging.log('[Login Info] Invalid Entry: {0}'.format(who), level=xbmc.LOGERROR)
Beispiel #19
0
 def do_ignore(self):
     from resources.libs.common import logging
     logging.log("[Current Build Check] [User Selected: Ignore Build Menu] [Next Check: {0}]".format(str(CONFIG.BUILDCHECK)),
                 level=xbmc.LOGNOTICE)
     CONFIG.set_setting('lastbuildcheck', str(CONFIG.BUILDCHECK))
     CONFIG.set_setting('installed', 'ignored')
     
     self.close()
Beispiel #20
0
def save_login():
    if CONFIG.LOGINSAVE <= str(tools.get_date()):
        from resources.libs import loginit
        logging.log("[Login Info] Saving all Data", level=xbmc.LOGNOTICE)
        loginit.auto_update('all')
        CONFIG.set_setting('loginlastsave', str(tools.get_date(days=3)))
    else:
        logging.log("[Login Info] Next Auto Save isn't until: {0} / TODAY is: {1}".format(CONFIG.LOGINSAVE, str(
            tools.get_date())), level=xbmc.LOGNOTICE)
Beispiel #21
0
def install_addon_from_url(name, url):
    from resources.libs.downloader import Downloader
    from resources.libs import db
    from resources.libs import extract
    from resources.libs.common import logging
    from resources.libs import skin
    from resources.libs.common import tools

    progress_dialog = xbmcgui.DialogProgress()

    response = tools.open_url(url, check=True)

    if not response:
        logging.log_notify(
            "[COLOR {0}]Addon Installer[/COLOR]".format(CONFIG.COLOR1),
            '[COLOR {0}]{1}:[/COLOR] [COLOR {2}]Invalid Zip Url![/COLOR]'.
            format(CONFIG.COLOR1, name, CONFIG.COLOR2))
        return
    if not os.path.exists(CONFIG.PACKAGES):
        os.makedirs(CONFIG.PACKAGES)

    progress_dialog.create(
        CONFIG.ADDONTITLE,
        '[COLOR {0}][B]Downloading:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format(
            CONFIG.COLOR2, CONFIG.COLOR1,
            name), '', '[COLOR {0}]Please Wait[/COLOR]'.format(CONFIG.COLOR2))
    urlsplits = url.split('/')
    lib = os.path.join(CONFIG.PACKAGES, urlsplits[-1])
    try:
        os.remove(lib)
    except:
        pass
    Downloader().download(url, lib)
    title = '[COLOR {0}][B]Installing:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format(
        CONFIG.COLOR2, CONFIG.COLOR1, name)
    progress_dialog.update(
        0, title, '', '[COLOR {0}]Please Wait[/COLOR]'.format(CONFIG.COLOR2))
    percent, errors, error = extract.all(lib, CONFIG.ADDONS, title=title)
    progress_dialog.update(
        0, title, '',
        '[COLOR {0}]Installing Dependencies[/COLOR]'.format(CONFIG.COLOR2))
    installed(name)
    installlist = db.grab_addons(lib)
    logging.log(str(installlist))
    db.addon_database(installlist, 1, True)
    install_dependency(name, progress_dialog)
    progress_dialog.close()

    xbmc.executebuiltin('UpdateAddonRepos()')
    xbmc.executebuiltin('UpdateLocalAddons()')
    xbmc.executebuiltin('Container.Refresh()')

    for item in installlist:
        if item.startswith('skin.') and not item == 'skin.shortcuts':
            if not CONFIG.BUILDNAME == '' and CONFIG.DEFAULTIGNORE == 'true':
                CONFIG.set_setting('defaultskinignore', 'true')
            skin.switch_to_skin(item, 'Skin Installer')
Beispiel #22
0
def save_debrid():
    if CONFIG.DEBRIDSAVE <= str(tools.get_date()):
        from resources.libs import debridit
        logging.log("[Debrid Data] Saving all Data", level=xbmc.LOGNOTICE)
        debridit.auto_update('all')
        CONFIG.set_setting('debridlastsave', str(tools.get_date(days=3)))
    else:
        logging.log("[Debrid Data] Next Auto Save isn't until: {0} / TODAY is: {1}".format(CONFIG.DEBRIDSAVE, str(
            tools.get_date())), level=xbmc.LOGNOTICE)
Beispiel #23
0
    def install_skin(self, name, url):
        from resources.libs.downloader import Downloader
        from resources.libs import db
        from resources.libs import extract
        from resources.libs.common import logging
        from resources.libs import skin
        from resources.libs.common import tools

        progress_dialog = xbmcgui.DialogProgress()

        response = tools.open_url(url, check=False)

        if not response:
            logging.log_notify(
                "[COLOR {0}]Instalador de Add-ons[/COLOR]".format(
                    CONFIG.COLOR1),
                '[COLOR {0}]{1}:[/COLOR] [COLOR {2}]Url del Zip Inválida![/COLOR]'
                .format(CONFIG.COLOR1, name, CONFIG.COLOR2))
            return

        if not os.path.exists(CONFIG.PACKAGES):
            os.makedirs(CONFIG.PACKAGES)

        progress_dialog.create(
            CONFIG.ADDONTITLE,
            '[COLOR {0}][B]Descargando:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.
            format(CONFIG.COLOR2, CONFIG.COLOR1, name) + '\n' + '' + '\n' +
            '[COLOR {0}]Espere por Favor[/COLOR]'.format(CONFIG.COLOR2))

        urlsplits = url.split('/')
        lib = xbmc.makeLegalFilename(
            os.path.join(CONFIG.PACKAGES, urlsplits[-1]))
        try:
            os.remove(lib)
        except:
            pass
        Downloader().download(url, lib)
        title = '[COLOR {0}][B]Instalando:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format(
            CONFIG.COLOR2, CONFIG.COLOR1, name)
        progress_dialog.update(
            0, title + '\n' + '' + '\n' +
            '[COLOR {0}]Espere por Favor[/COLOR]'.format(CONFIG.COLOR2))
        percent, errors, error = extract.all(lib, CONFIG.HOME, title=title)
        installed = db.grab_addons(lib)
        db.addon_database(installed, 1, True)
        progress_dialog.close()
        logging.log_notify(
            "[COLOR {0}]Instalador de Add-ons[/COLOR]".format(CONFIG.COLOR1),
            '[COLOR {0}]{1}: Instalado![/COLOR]'.format(CONFIG.COLOR2, name))
        xbmc.executebuiltin('UpdateAddonRepos()')
        xbmc.executebuiltin('UpdateLocalAddons()')
        for item in installed:
            if item.startswith('skin.') and not item == 'skin.shortcuts':
                if not CONFIG.BUILDNAME == '' and CONFIG.DEFAULTIGNORE == 'true':
                    CONFIG.set_setting('defaultskinignore', 'true')
                skin.switch_to_skin(item, 'Skin Installer')
        xbmc.executebuiltin('Container.Refresh()')
Beispiel #24
0
    def install_addon_from_url(self, plugin, url):
        from resources.libs.downloader import Downloader
        from resources.libs import db
        from resources.libs import extract
        from resources.libs import skin

        response = tools.open_url(url, check=True)

        if not response:
            logging.log_notify(
                "[COLOR {0}]Instalador de Add-ons[/COLOR]".format(
                    CONFIG.COLOR1),
                '[COLOR {0}]{1}:[/COLOR] [COLOR {2}]URL inválido zip![/COLOR]'.
                format(CONFIG.COLOR1, plugin, CONFIG.COLOR2))
            return

        tools.ensure_folders(CONFIG.PACKAGES)

        self.progress_dialog.create(
            CONFIG.ADDONTITLE,
            '[COLOR {0}][B]Descargando:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.
            format(CONFIG.COLOR2, CONFIG.COLOR1, plugin) + '\n' + '' + '\n' +
            '[COLOR {0}]Espere por Favor[/COLOR]'.format(CONFIG.COLOR2))
        urlsplits = url.split('/')
        lib = os.path.join(CONFIG.PACKAGES, urlsplits[-1])

        try:
            os.remove(lib)
        except:
            pass

        Downloader().download(url, lib)
        title = '[COLOR {0}][B]Instalando:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format(
            CONFIG.COLOR2, CONFIG.COLOR1, plugin)
        self.progress_dialog.update(
            0, title + '\n' + '' + '\n' +
            '[COLOR {0}]Espere por Favor[/COLOR]'.format(CONFIG.COLOR2))
        percent, errors, error = extract.all(lib, CONFIG.ADDONS, title=title)
        self.progress_dialog.update(
            0, title + '\n' + '' + '\n' +
            '[COLOR {0}]Instalando Dependencias[/COLOR]'.format(CONFIG.COLOR2))
        installed(plugin)
        installlist = db.grab_addons(lib)
        logging.log(str(installlist))
        db.addon_database(installlist, 1, True)
        self.install_dependency(plugin)
        self.progress_dialog.close()

        xbmc.executebuiltin('UpdateAddonRepos()')
        xbmc.executebuiltin('UpdateLocalAddons()')
        xbmc.executebuiltin('Container.Refresh()')

        for item in installlist:
            if item.startswith('skin.') and not item == 'skin.shortcuts':
                if not CONFIG.BUILDNAME == '' and CONFIG.DEFAULTIGNORE == 'true':
                    CONFIG.set_setting('defaultskinignore', 'true')
                skin.switch_to_skin(item, 'Skin Installer')
Beispiel #25
0
def save_trakt():
    if CONFIG.TRAKTSAVE <= str(tools.get_date()):
        from resources.libs import traktit
        logging.log("[Trakt Data] Saving all Data", level=xbmc.LOGNOTICE)
        traktit.auto_update('all')
        CONFIG.set_setting('traktlastsave', str(tools.get_date(days=3)))
    else:
        logging.log("[Trakt Data] Next Auto Save isn't until: {0} / TODAY is: {1}".format(CONFIG.TRAKTSAVE, str(
            tools.get_date())), level=xbmc.LOGNOTICE)
Beispiel #26
0
def change_freq():
    from resources.libs.common import logging

    dialog = xbmcgui.Dialog()

    change = dialog.select("[COLOR {0}]How often would you list to Auto Clean on Startup?[/COLOR]".format(CONFIG.COLOR2), CONFIG.CLEANFREQ)
    if not change == -1:
        CONFIG.set_setting('autocleanfreq', str(change))
        logging.log_notify('[COLOR {0}]Auto Clean Up[/COLOR]'.format(CONFIG.COLOR1),
                           '[COLOR {0}]Frequency Now {1}[/COLOR]'.format(CONFIG.COLOR2, CONFIG.CLEANFREQ[change]))
Beispiel #27
0
 def do_ignore(self):
     from resources.libs.common import logging
     from resources.libs.common import tools
     
     logging.log("[Current Build Check] [User Selected: Ignore Build Menu] [Next Check: {0}]".format(CONFIG.BUILDCHECK),
                 level=xbmc.LOGNOTICE)
     CONFIG.set_setting('nextbuildcheck', tools.get_date(days=CONFIG.UPDATECHECK, formatted=True))
     CONFIG.set_setting('installed', 'ignored')
     
     self.close()
 def do_build_menu(self):
     logging.log("[Current Build Check] [User Selected: Open Build Menu] [Next Check: {0}]".format(CONFIG.BUILDCHECK),
                 level=xbmc.LOGINFO)
     CONFIG.set_setting('nextbuildcheck', tools.get_date(days=CONFIG.UPDATECHECK, formatted=True))
     CONFIG.set_setting('installed', 'ignored')
     
     url = 'plugin://{0}/?mode=builds'.format(CONFIG.ADDON_ID)
     
     self.close()
     
     xbmc.executebuiltin('ActivateWindow(Programs, {0}, return)'.format(url))
Beispiel #29
0
 def do_build_menu(self):
     logging.log("[Verificación Build Actual] [Usuario Seleccionado: Abrir Menu Build] [Siguiente Verificación: {0}]".format(CONFIG.BUILDCHECK),
                 level=xbmc.LOGINFO)
     CONFIG.set_setting('nextbuildcheck', tools.get_date(days=CONFIG.UPDATECHECK, formatted=True))
     CONFIG.set_setting('instalado', 'ignorado')
     
     url = 'plugin://{0}/?mode=builds'.format(CONFIG.ADDON_ID)
     
     self.close()
     
     xbmc.executebuiltin('ActivateWindow(Programs, {0}, return)'.format(url))
Beispiel #30
0
 def do_ignore(self):
     logging.log(
         "[Verificação da compilação atual] [Selecionado pelo usuário: Menu Ignorar compilação] [Verificação seguinte: {0}]"
         .format(CONFIG.BUILDCHECK),
         level=xbmc.LOGINFO)
     CONFIG.set_setting(
         'nextbuildcheck',
         tools.get_date(days=CONFIG.UPDATECHECK, formatted=True))
     CONFIG.set_setting('installed', 'ignored')
     if 29 - 29: OOooOOo + Oo0Ooo.i11iIiiIii - i1IIi / iIii1I11I1II1
     self.close()
     if 26 - 26: I11i.OoooooooOO