Пример #1
0
def service_checks():
    import maintool
    maintool.source_change()
    date = datetime.datetime.today().weekday()
    if (kodi.get_setting("clearday") == date) or kodi.get_setting("acstartup") == "true":
        maintool.auto_clean(True)
    elif (kodi.get_setting("clearday") == 0) and kodi.get_setting("acstartup") != "true":
        kodi.log('Auto Main Turned off')
def service_checks():
    import maintool
    maintool.source_change()
    date = datetime.datetime.today().weekday()
    if (kodi.get_setting("clearday") == date) or kodi.get_setting("acstartup") == "true":
        maintool.auto_clean(True)
    elif (kodi.get_setting("clearday") == 0) and kodi.get_setting("acstartup") != "true":
        kodi.log('Auto Main Turned off')
Пример #3
0
def main_menu():
    maintool.source_change()
    maintool.feed_change()
    # ########## TRY POP ########
    if len(kodi.get_setting('notify')) > 0:
        kodi.set_setting('notify', str(int(kodi.get_setting('notify')) + 1))
    else:
        kodi.set_setting('notify', "1")
    if int(kodi.get_setting('notify')) == 1:
        xbmcgui.Dialog().notification('Need Support?', 'www.tvaddons.co',
                                      artwork + 'icon.png', 3000, False)
    elif int(kodi.get_setting('notify')) == 5:
        kodi.set_setting('notify', "0")
    # ######## END POP ###########

    if kodi.get_setting('hasran') == 'false':
        kodi.set_setting('hasran', 'true')

    dp = xbmcgui.DialogProgress()
    try:
        if (not os.path.exists(ART)) or (not os.path.exists(ART2)) or (
                not os.path.exists(ART3)):
            dp.create(AddonTitle, 'Getting ' + AddonTitle + ' Ready......',
                      'Downloading ' + AddonTitle + ' Icons.....')
            dp.update(0)
            icons_zip = os.path.join(packagepath, AddonTitle + '_icons.zip')
            downloader.download(
                OPEN_URL('http://indigo.tvaddons.co/graphics/arts.txt'),
                icons_zip, dp)
            dp.update(0, 'Getting %s Ready........' % AddonTitle,
                      'Extracting %s Icons......' % AddonTitle)
            extract.all(icons_zip, addon_path, dp)
            dp.close()
    except:
        pass
    # Check for old version of hubrepo and remove it
    try:
        if os.path.exists(hubpath):
            with open(hubpath, 'r') as content:
                if 'AG' in content:
                    shutil.rmtree(hubpath)
    except:
        pass
    # # Check for HUBRepo and install it
    try:
        if not os.path.exists(hubpath):
            installer.HUBINSTALL(
                'repository.xbmchub',
                'http://github.com/tvaddonsco/tva-release-repo/raw/master/'
                'repository.xbmchub/', 'repository.xbmchub')
            xbmc.executebuiltin("XBMC.InstallAddon(%s)" % 'repository.xbmchub')
            addon_able.set_enabled("repository.xbmchub")
            xbmc.executebuiltin("XBMC.UpdateAddonRepos()")
    except:
        pass
    # Check for Log Uploader and install it
    try:
        if not os.path.exists(uploaderpath):
            installer.HUBINSTALL(
                'script.tvaddons.debug.log',
                'http://github.com/tvaddonsco/tva-release-repo/raw/master'
                '/script.tvaddons.debug.log/', 'script.tvaddons.debug.log')
            addon_able.set_enabled('script.tvaddons.debug.log')
            # xbmc.executebuiltin("InstallAddon(%s)" % 'script.tvaddons.debug.log')
            xbmc.executebuiltin("XBMC.UpdateLocalAddons()")
    except:
        pass

    # Check for old maintenance tools and remove them
    old_maintenance = (oldinstaller, oldnotify, oldmain, oldwiz, oldfresh)
    for old_file in old_maintenance:
        if os.path.exists(old_file):
            shutil.rmtree(old_file)

    # Notification Status
    if kodi.get_setting("notifications-on-startup") == "false":
        note_status = '(Opt Out)'
        note_art = 'notification_optout.png'
        note_description = 'Unsubscribe'
    else:
        note_status = '(Opt In)'
        note_art = 'notification_in.png'
        note_description = 'Subscribe'

    if kodi.get_setting('wizardran') == 'false':
        kodi.addItem(
            "Config Wizard",
            '',
            'call_wizard',
            artwork + 'config_wizard.png',
            description=
            "Automatically configure Kodi with the best addons and goodies in seconds!"
        )
    kodi.addDir("Addon Installer",
                '',
                'call_installer',
                artwork + 'addon_installer.png',
                description="It’s like an App Store for Kodi addons!")
    kodi.addDir(
        "Maintenance Tools",
        '',
        'call_maintool',
        artwork + 'maintool.png',
        description="Keep your Kodi setup running at optimum performance!")
    # kodi.addDir("Kodi Librtmp Files", '', 'get_libs', artwork +'librtmp_files.png')
    kodi.addItem(
        "Rejuvenate Kodi",
        '',
        'call_rejuv',
        artwork + 'rejuvinate.png',
        description=
        "Wipe and reconfigure Kodi with the latest Config Wizard setup!")
    kodi.addDir("Factory Restore",
                '',
                'call_restore',
                artwork + 'factory_restore.png',
                description="Start off fresh, wipe your Kodi setup clean!")
    if os.path.exists(uploaderpath):
        kodi.addItem(
            "Log Uploader",
            '',
            'log_upload',
            artwork + 'log_uploader.png',
            description="Easily upload your error logs for troubleshooting!")
    kodi.addDir("Network Speed Test",
                '',
                'runspeedtest',
                artwork + 'speed_test.png',
                description="How fast is your internet?")
    kodi.addDir("System Information",
                '',
                'system_info',
                artwork + 'system_info.png',
                description="Useful information about your Kodi setup!")
    kodi.addDir("Sports Listings",
                '',
                'call_sports',
                artwork + 'sports_list.png',
                description="Who’s playing what today?")
    kodi.addDir(
        'Backup / Restore',
        '',
        'backup_restore',
        artwork + 'backup_restore.png',
        description="Backup or restore your Kodi configuration in minutes!")
    kodi.addItem(
        "Log Viewer",
        '',
        'log_view',
        artwork + 'log_viewer.png',
        description="Easily view your error log without leaving Kodi!")
    kodi.addItem("No-Coin Scan",
                 '',
                 'nocoin',
                 artwork + 'no_coin.png',
                 description="Scan your Kodi directory for coin mining.")
    kodi.addItem(
        "Notifications " + note_status,
        '',
        'toggle_notify',
        artwork + note_art,
        description="%s to important TV ADDONS notifications on startup!" %
        note_description)
    kodi.addItem(
        "Show Notification",
        '',
        'show_note',
        artwork + 'notification.png',
        description=
        "Show TVA Notification. To get Important News, Tips, and Giveaways from TV ADDONS"
    )
    viewsetter.set_view("sets")
Пример #4
0
def main_menu():
    maintool.source_change()
    maintool.feed_change()
    # ########## TRY POP ########
    if len(kodi.get_setting('notify')) > 0:
        kodi.set_setting('notify', str(int(kodi.get_setting('notify')) + 1))
    else:
        kodi.set_setting('notify', "1")
    if int(kodi.get_setting('notify')) == 1:
        xbmcgui.Dialog().notification('Need Support?', 'www.tvaddons.co', artwork + 'icon.png', 3000, False)
    elif int(kodi.get_setting('notify')) == 5:
        kodi.set_setting('notify', "0")
    # ######## END POP ###########

    if kodi.get_setting('hasran') == 'false':
        kodi.set_setting('hasran', 'true')

    if kodi.get_setting('set_rtmp') == 'false':
        try:
            addon_able.set_enabled("inputstream.adaptive")
        except:
            pass
        time.sleep(0.5)
        try:
            addon_able.set_enabled("inputstream.rtmp")
        except:
            pass
        time.sleep(0.5)
        xbmc.executebuiltin("XBMC.UpdateLocalAddons()")
        kodi.set_setting('set_rtmp', 'true')
        
    dp = xbmcgui.DialogProgress()
    try:
        if (not os.path.exists(ART)) or (not os.path.exists(ART2)) or (not os.path.exists(ART3)):
            dp.create(AddonTitle, 'Getting ' + AddonTitle + ' Ready........', 'Downloading ' + AddonTitle + ' Icons......')
            dp.update(0)
            icons_zip = os.path.join(packagepath, AddonTitle + '_icons.zip')
            downloader.download(OPEN_URL('http://indigo.tvaddons.co/graphics/arts.txt'), icons_zip, dp)
            dp.update(0, 'Getting %s Ready........' % AddonTitle, 'Extracting %s Icons......' % AddonTitle)
            extract.all(icons_zip, addon_path, dp)
            dp.close()
    except:
        pass
    # # Check for HUBRepo and install it
    try:
        if not os.path.exists(hubpath):
            installer.HUBINSTALL('repository.xbmchub', 'http://github.com/tvaddonsco/tva-release-repo/raw/master/repository.xbmchub/', 'repository.xbmchub')
            xbmc.executebuiltin("XBMC.InstallAddon(%s)" % 'repository.xbmchub')
            addon_able.set_enabled("repository.xbmchub")
            xbmc.executebuiltin("XBMC.UpdateAddonRepos()")

    except:
        pass
    # Check for Log Uploader and install it
    try:
        if not os.path.exists(uploaderpath):
            installer.HUBINSTALL('script.tvaddons.debug.log', 'http://github.com/tvaddonsco/tva-release-repo/raw/master/script.tvaddons.debug.log/', 'script.tvaddons.debug.log')
            addon_able.set_enabled('script.tvaddons.debug.log')
            # xbmc.executebuiltin("InstallAddon(%s)" % 'script.tvaddons.debug.log')
            xbmc.executebuiltin("XBMC.UpdateLocalAddons()")

    except:
        pass
   
    # Check for old maintenance tools and remove them
    old_maintenance = (oldinstaller, oldnotify, oldmain, oldwiz, oldfresh)
    for old_file in old_maintenance:
        if os.path.exists(old_file):
            shutil.rmtree(old_file)

    if kodi.get_setting('wizardran') == 'false':
        kodi.addItem("Config Wizard", '', 'call_wizard',artwork+'config_wizard.png',
                     description="Automatically configure Kodi with the best addons and goodies in seconds!")
    kodi.addDir("Addon Installer", '', 'call_installer', artwork + 'addon_installer.png',
                description="It’s like an App Store for Kodi addons!")
    kodi.addDir("Maintenance Tools", '', 'call_maintool', artwork + 'maintool.png',
                description="Keep your Kodi setup running at optimum performance!")
    # kodi.addDir("Kodi Librtmp Files", '', 'get_libs', artwork +'librtmp_files.png')
    kodi.addItem("Rejuvenate Kodi", '', 'call_rejuv', artwork + 'rejuvinate.png',
                 description="Wipe and reconfigure Kodi with the latest Config Wizard setup!")
    kodi.addDir("Factory Restore", '', 'call_restore', artwork + 'factory_restore.png',
                description="Start off fresh, wipe your Kodi setup clean!")
    if os.path.exists(uploaderpath):
        kodi.addItem("Log Uploader", '', 'log_upload', artwork + 'log_uploader.png',
                     description="Easily upload your error logs for troubleshooting!")
    kodi.addDir("Network Speed Test", '', 'runspeedtest', artwork + 'speed_test.png',
                description="How fast is your internet?")
    kodi.addDir("System Information", '', 'system_info', artwork + 'system_info.png',
                description="Useful information about your Kodi setup!")
    kodi.addDir("Sports Listings", '', 'call_sports', artwork + 'sports_list.png',
                description="Who’s playing what today?")
    kodi.addDir('Backup / Restore', '', 'backup_restore', artwork + 'backup_restore.png',
                description="Backup or restore your Kodi configuration in minutes!")
    kodi.addItem("Log Viewer", '', 'log_view', artwork + 'log_viewer.png',
                 description="Easily view your error log without leaving Kodi!")
    if kodi.get_setting("notifications-on-startup") == "false":
        kodi.addItem("Notifications (Opt Out)", '', 'toggle_notify', artwork + 'notification_optout.png',
                     description="Unsubscribe to important TV ADDONS notifications!")
    else:
        kodi.addItem("Notifications (Opt In)", '', 'toggle_notify', artwork + 'notification_in.png',
                     description="Subscribe from important TV ADDONS notifications!")
    viewsetter.set_view("sets")