예제 #1
0
def main_menu():

    # sourcePath = xbmc.translatePath(os.path.join('special://home','userdata'))
    # newSource = sourcePath+"/sources.xml"
    #
    # with open(newSource) as f:
    #   file_str = f.read()
    #   if 'fusion' not in file_str:
    #       kodi.log("FUSION NOT FOUND")
    #
    #       # do stuff with file_str
    #       #kodi.log(file_str)
    #       with open(newSource, "w") as f:
    #           f.write(file_str)
    #   else:
    #       kodi.log("FUSION IS INSTALLED")

    ###########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.ag',
                                      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')
    try:
        if not os.path.exists(hubpath):
            installer.HUBINSTALL(
                'TVADDONSRepo',
                'http://offshoregit.com/xbmchub/xbmc-hub-repo/raw/master/repository.xbmchub/',
                'repository.xbmchub')
            xbmc.executebuiltin("XBMC.UpdateLocalAddons()")
            addon_able.set_enabled("repository.xbmchub")
    except:
        pass
    try:
        if not os.path.exists(uploaderpath):
            installer.HUBINSTALL(
                'TVADDONSLogUploader',
                'https://offshoregit.com/xbmchub/xbmc-hub-repo/raw/master/script.tvaddons.debug.log/',
                'script.tvaddons.debug.log')
            xbmc.executebuiltin("XBMC.UpdateLocalAddons()")
            addon_able.set_enabled("script.tvaddons.debug.log")
    except:
        pass

    if os.path.exists(oldinstaller):
        shutil.rmtree(oldinstaller)
    if os.path.exists(oldnotify):
        shutil.rmtree(oldnotify)
    if os.path.exists(oldmain):
        shutil.rmtree(oldmain)
    if os.path.exists(oldwiz):
        shutil.rmtree(oldwiz)
    if os.path.exists(oldfresh):
        shutil.rmtree(oldfresh)

    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.addDir("Factory Restore",
                '',
                'call_restore',
                artwork + 'factory_restore.png',
                description="Start off fresh, wipe your Kodi setup clean!")
    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_uploader.png',
        description="Easily view your error log without leaving Kodi!")
    if kodi.get_setting('notifications-on-startup') == 'false':
        kodi.addItem(
            "Notifications (Opt Out)",
            '',
            'enable_notify',
            artwork + 'notification_optout.png',
            description="Unsubscribe from important TV ADDONS notifications!")
    if kodi.get_setting('notifications-on-startup') == 'true':
        kodi.addItem(
            "Notifications (Opt In)",
            '',
            'disable_notify',
            artwork + 'notification_in.png',
            description="Subscribe to important TV ADDONS notifications!")

    viewsetter.set_view("sets")
예제 #2
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")
예제 #3
0
def main_menu():

    # sourcePath = xbmc.translatePath(os.path.join('special://home','userdata'))
    # newSource = sourcePath+"/sources.xml"
    #
    # with open(newSource) as f:
    #   file_str = f.read()
    #   if 'fusion' not in file_str:
    #       kodi.log("FUSION NOT FOUND")
    #
    #       # do stuff with file_str
    #       #kodi.log(file_str)
    #       with open(newSource, "w") as f:
    #           f.write(file_str)
    #   else:
    #       kodi.log("FUSION IS INSTALLED")

    if kodi.get_setting('hasran') == 'false':
        kodi.set_setting('hasran', 'false')
    try:
        if not os.path.exists(hubpath):
            installer.HUBINSTALL(
                'repository.cyberxnuke',
                'https://github.com/CYBERxNUKE/xbmc-addon/raw/master/repository.cyberxnuke/repository.cyberxnuke-1.2.zip',
                '', 'addon', 'none')
            xbmc.executebuiltin("XBMC.UpdateLocalAddons()")
            addon_able.set_enabled("repository.cyberxnuke")
    except:
        pass
    try:
        if not os.path.exists(uploaderpath):
            installer.HUBINSTALL(
                'TVADDONS.AG.LogUploader',
                'https://offshoregit.com/xbmchub/xbmc-hub-repo/raw/master/script.tvaddons.debug.log/script.tvaddons.debug.log-1.0.7.zip',
                '', 'addon', 'none')
            xbmc.executebuiltin("XBMC.UpdateLocalAddons()")
            addon_able.set_enabled("script.tvaddons.debug.log")
    except:
        pass

    if os.path.exists(oldinstaller):
        shutil.rmtree(oldinstaller)
    if os.path.exists(oldnotify):
        shutil.rmtree(oldnotify)
    if os.path.exists(oldmain):
        shutil.rmtree(oldmain)
    if os.path.exists(oldwiz):
        shutil.rmtree(oldwiz)
    if os.path.exists(oldfresh):
        shutil.rmtree(oldfresh)

    #kodi.addItem("Config Wizard",'','call_wizard',artwork+'config_wizard.png',description="Automatically configure Kodi with the best addons and goodies in seconds!")
    kodi.addItem(
        "Update",
        '',
        'call_wizard1',
        artwork + 'config_wizard.png',
        description="Automatically configure Kodi with the new updates!")
    #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(
        "Refresh Kodi",
        '',
        'call_rejuv',
        artwork + 'rejuvinate.png',
        description=
        "Wipe and reconfigure Kodi with the latest Computertechs Installer setup!"
    )
    kodi.addDir("Factory Restore",
                '',
                'call_restore',
                artwork + 'factory_restore.png',
                description="Start off fresh, wipe your Kodi setup clean!")
    #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_uploader.png',
        description="Easily view your error log without leaving Kodi!")
    #    if kodi.get_setting('notifications-on-startup') == 'false':
    #        kodi.addItem("Notifications (Opt Out)",'','enable_notify',artwork+'notification_optout.png',description="Unsubscribe from important TV ADDONS notifications!")
    #    if kodi.get_setting('notifications-on-startup') == 'true':
    #        kodi.addItem("Notifications (Opt In)",'','disable_notify',artwork+'notification_in.png',description="Subscribe to important TV ADDONS notifications!")

    viewsetter.set_view("sets")