Exemplo n.º 1
0
def international():
    kodi.add_dir('International Repos', '', 'interrepos',
                'https://www.tvaddons.co/kodi-addons/images/categories/international.png',
                description="Foreign language repos from across the globe!")
    kodi.add_dir('International Addons', '', 'interaddons',
                'https://www.tvaddons.co/kodi-addons/images/categories/international.png',
                description="Foreign language addons from across the globe!")
Exemplo n.º 2
0
def backup_menu():
    kodi.add_item(
        '[COLOR white]Select Backup Location[/COLOR]',
        'url',
        'display_backup_settings',
        '',
        description=
        "Choose the location to which you wish to store your backups!")
    kodi.add_item(
        '[COLOR white]Full Backup (All Files and Folders Included)[/COLOR]',
        'url',
        'full_backup',
        '',
        description="Backup everything possible!")
    kodi.add_item(
        '[COLOR white]Backup No Database (No Database Files Included)[/COLOR]',
        'url',
        'small_backup',
        '',
        description=
        "Backup your Kodi configuration without unnecessary database files!")
    kodi.add_dir('[COLOR white]Restore Backup[/COLOR]',
                 '',
                 'do_backup_restore',
                 '',
                 description="Restore your Kodi configuration from a backup!")
    kodi.add_dir('[COLOR white]Delete Backup[/COLOR]',
                 '',
                 'del_backup',
                 '',
                 description="Erase any backups you have saved!")
    viewsetter.set_view("sets")
def international_addons():
    imurl = 'https://www.tvaddons.co/kodi-addons/images/categories/international/'
    link = api.get_langs()
    if link:
        # for e in link:
        #     name=e['languages']
        #     kodi.log(name)
        l_vert = {
            "af": "African",
            "ar": "Arabic",
            # "cn": "Chinese",
            "zh": "Chinese",
            "cs": "Czech",
            "da": "Danish",
            "nl": "Dutch",
            "ph": "Filipino",
            "fi": "Finnish",
            "fr": "French",
            "de": "German",
            "el": "Greek",
            # "iw": "Hebrew",
            "he": "Hebrew",
            "hu": "Hungarian",
            "is": "Icelandic",
            "hi": "Indian",
            "ga": "Irish",
            "it": "Italian",
            "ja": "Japanese",
            "ko": "Korean",
            "mn": "Mongolian",
            "ne": "Nepali",
            "no": "Norwegian",
            "ur": "Pakistani",
            "pl": "Polish",
            "pt": "Portuguese",
            "ro": "Romanian",
            "ru": "Russian",
            "ms": "Singapore",
            "es": "Spanish",
            "sv": "Swedish",
            "ta": "Tamil",
            "th": "Thai",
            "tr": "Turkish",
            "vi": "Vietnamese"
        }
        for lang in sorted(l_vert.items(), key=lambda key: lang[1]):
            kodi.add_dir(
                lang[1],
                lang[0],
                'interaddonslist',
                imurl + lang[1].lower() + '.png',
                description="Foreign language addons from across the globe!")
            viewsetter.set_view("sets")
Exemplo n.º 4
0
def rtmp_lib():
    liblist = "http://indigo.tvaddons.co/librtmp/rtmplist.txt"
    try:
        # link = OPEN_URL(liblist).replace('\n', '').replace('\r', '')
        link = kodi.read_file(liblist).replace('\n', '').replace('\r', '')
    except Exception as e:
        kodi.log(str(e))
        kodi.add_item('[COLOR gold][B]This service is currently unavailable.[/COLOR][/B]', '', 100, '', '', '')
        return
    match = re.compile('name="(.+?)".+?rl="(.+?)".+?ersion="(.+?)"').findall(link)
    kodi.add_item('[COLOR gold][B]Files Will Be Donwloaded to the Kodi Home directory,'
                  'You Will Need To Manually Install From There.[/COLOR][/B]', '', 100, '', '', '')
    # kodi.add_item('[COLOR gold]--------------------------------------------------------[/COLOR]', '', 100, '',' ', '')
    for m_name, m_url, m_description in match:
        kodi.add_dir(m_name, m_url, "lib_installer", artwork + 'icon.png')
    viewsetter.set_view("sets")
Exemplo n.º 5
0
def keymaps():
    try:
        link = kodi.open_url(Keymaps_URL).replace('\n', '').replace('\r', '')
    except IOError:
        kodi.add_dir("No Keymaps Available", '', '', artwork + 'unkeymap.png')
        kodi.log('Could not open keymaps URL')
        return
    match = re.compile('name="(.+?)".+?rl="(.+?)".+?mg="(.+?)".+?anart="(.+?)".+?ersion="(.+?)".+?ash="(.+?)"').findall(
        link)
    if os.path.isfile(KEYBOARD_FILE):
        kodi.add_dir("Remove Current Keymap Configuration", '', 'uninstall_keymap', artwork + 'unkeymap.png')
    for name, url, iconimage, art, version, description in match:
        name = "[COLOR white][B]" + name + "[/B][/COLOR]"
        kodi.add_dir(name, url, 'install_keymap', artwork + 'keymapadd.png')
    viewsetter.set_view("files")
def list_addons(url):
    specials = ('featured', 'live', 'sports', 'playlists')
    regulars = ('video', 'executable')
    easyreg = ('audio', 'image', 'service', 'skins')
    if url in specials:
        query = url
        link = api.get_all_addons()
        feat = api.special_addons(query)
        my_list = sorted(link, key=lambda k: k['name'])
        for e in my_list:
            if e['id'] in feat:
                name = e['name']
                repourl = e['repodlpath']
                path = e['addon_zip_path']
                description = e['description']
                icon = path.rsplit('/', 1)[0] + '/icon.png'
                l_fanart = path.rsplit('/', 1)[0] + '/fanart.jpg'
                try:
                    add_help_dir(name,
                                 path,
                                 'addoninstall',
                                 icon,
                                 l_fanart,
                                 description,
                                 'addon',
                                 repourl,
                                 '',
                                 '',
                                 CMi,
                                 contextreplace=False)
                except Exception as e:
                    kodi.log(str(e))

    if url in easyreg:
        link = api.get_types(url)
        my_list = sorted(link, key=lambda k: k['name'])
        for e in my_list:
            name = e['name']
            repourl = e['repodlpath']
            path = e['addon_zip_path']
            description = e['description']
            icon = path.rsplit('/', 1)[0] + '/icon.png'
            l_fanart = path.rsplit('/', 1)[0] + '/fanart.jpg'
            try:
                add_help_dir(name,
                             path,
                             'addoninstall',
                             icon,
                             l_fanart,
                             description,
                             'addon',
                             repourl,
                             '',
                             '',
                             CMi,
                             contextreplace=False)
            except Exception as e:
                kodi.log(str(e))

            # Split into ABC Menus
    if url in regulars:
        d = dict.fromkeys(string.ascii_uppercase, 0)
        my_list = sorted(d)
        for e in my_list:
            kodi.add_dir(e,
                         url,
                         'splitlist',
                         artwork + e + '.png',
                         description="Starts with letter " + e)
        kodi.add_dir('Others',
                     url,
                     'splitlist',
                     artwork + 'symbols.png',
                     description="Starts with another character")

    if url == 'repositories':
        link = api.get_repos()
        for e in link:
            name = e['name']
            # repourl = e['repodlpath']
            path = e['addon_zip_path']
            description = e['description']
            icon = path.rsplit('/', 1)[0] + '/icon.png'
            l_fanart = path.rsplit('/', 1)[0] + '/fanart.jpg'
            try:
                add_help_dir(name,
                             path,
                             'addoninstall',
                             icon,
                             l_fanart,
                             description,
                             'addon',
                             'None',
                             '',
                             '',
                             CMi,
                             contextreplace=False)
            except Exception as e:
                kodi.log(str(e))
    if url == 'skins':
        link = api.get_all_addons()
        my_list = sorted(link, key=lambda k: k['name'])
        for e in my_list:
            if e['extension_point'] == 'xbmc.gui.skin':
                name = e['name']
                # repourl = e['repodlpath']
                path = e['addon_zip_path']
                description = e['description']
                icon = path.rsplit('/', 1)[0] + '/icon.png'
                l_fanart = path.rsplit('/', 1)[0] + '/fanart.jpg'
                try:
                    add_help_dir(name,
                                 path,
                                 'addoninstall',
                                 icon,
                                 l_fanart,
                                 description,
                                 'addon',
                                 'None',
                                 '',
                                 '',
                                 CMi,
                                 contextreplace=False)
                except Exception as e:
                    kodi.log(str(e))
    viewsetter.set_view("sets")
def main_index():
    xbmc.executebuiltin("UpdateAddonRepos")
    kodi.add_item("Git Browser",
                  '',
                  'github_main',
                  artwork + 'github_browser.png',
                  description="Search for repositories hosted on GitHub.")
    try:
        if len(str(api.get_all_addons())) < 20:
            raise ValueError('API is less than 20')
        kodi.add_dir('Search by: Addon/Author',
                     '',
                     'searchaddon',
                     artwork + 'search.png',
                     description="Search for addons by Name or Author")
        if settings.getSetting('featured') == 'true':
            kodi.add_dir('Featured Addons',
                         'featured',
                         'addonlist',
                         artwork + 'featured.png',
                         description="The most popular Kodi addons!")
        # if settings.getSetting('livetv') == 'true':
        #     kodi.add_dir('Live TV Addons', 'live', 'addonlist', artwork + 'livetv.png',
        #                 description="The most popular live TV addons!")
        # if settings.getSetting('sports') == 'true':
        #     kodi.add_dir('Sports Addons', 'sports', 'addonlist', artwork + 'sports.png',
        #                 description="The most popular sports addons!")
        if settings.getSetting('video') == 'true':
            kodi.add_dir('Video Addons',
                         'video',
                         'addonlist',
                         artwork + 'video.png',
                         description="Every video addon in existence!")
        if settings.getSetting('audio') == 'true':
            kodi.add_dir('Audio Addons',
                         'audio',
                         'addonlist',
                         artwork + 'audio.png',
                         description="Find addons to listen to music!")
        if settings.getSetting('program') == 'true':
            kodi.add_dir('Program Addons',
                         'executable',
                         'addonlist',
                         artwork + 'program.png',
                         description="Every program addon you can imagine!")
        # if settings.getSetting('playlist') == 'true':
        #     kodi.add_dir('Playlist Addons', 'playlists', 'addonlist', artwork + 'playlists.png',
        #                 description="The most popular playlist addons!")
        if settings.getSetting('services') == 'true':
            kodi.add_dir('Service Addons', 'service', 'addonlist',
                         artwork + 'service.png')
        if settings.getSetting('skincat') == 'true':
            kodi.add_dir('Kodi Skins',
                         'skins',
                         'addonlist',
                         artwork + 'kodi_skins.png',
                         description="Change up your look!")
        if settings.getSetting('world') == 'true':
            kodi.add_dir(
                'International Addons',
                'international',
                'interlist',
                artwork + 'world.png',
                description=
                "Foreign language addons and repos from across the globe!")
        if settings.getSetting('adult') == 'true':
            kodi.add_dir(
                'Adult Addons',
                'xxx',
                'adultlist',
                artwork + 'adult.png',
                description=
                "Must be 18 years or older! This menu can be disabled from within Add-on Settings."
            )
        # if settings.getSetting('repositories') == 'true':
        # 	kodi.add_dir('Repositories','repositories', 'addonlist', artwork + 'repositories.png',
        # 				description="Browse addons by repository!")
    except Exception as e:
        kodi.log(str(e))
        traceback.print_exc(file=sys.stdout)
        kodi.add_item(
            "Addon Listing Is Temporarily Unavailable",
            '',
            '',
            artwork1 + 'addon_installer.png',
            description="The Addon Listing Is Temporarily Unavailable")
    # kodi.add_item('Enable Live Streaming', 'None', 'EnableRTMP', artwork + 'enablertmp.png',
    # 			 description="Enable RTMP InputStream and InputStream Adaptive modules for Live Streaming.")
    kodi.add_item('Official OpenSubtitles Addon',
                  openSub,
                  'addopensub',
                  artwork + 'opensubicon.png',
                  description="Install Official OpenSubtitles Addon!")
    kodi.add_dir(
        'Install ZIP from Online Link',
        '',
        'urlzip',
        artwork + 'onlinesource.png',
        description=
        'Manually download and install addons or repositories from the web.')
    viewsetter.set_view("sets")
Exemplo n.º 8
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......\nDownloading ' + AddonTitle + ' Icons.....')
            dp.update(0)
            icons_zip = os.path.join(packagepath, AddonTitle + '_icons.zip')
            downloader.download(kodi.read_file('http://indigo.tvaddons.co/graphics/arts.txt'), icons_zip, dp)
            dp.update(0, 'Getting %s Ready........' % AddonTitle, 'Extracting %s Icons......' % AddonTitle)
            extract.extract_all(icons_zip, addon_path, dp)
            dp.close()
    except Exception as e:
        kodi.log(str(e))
    # Check for old version of hubrepo and remove it
    try:
        if os.path.exists(hubpath):
            with open(hubpath + '/addon.xml', 'r') as content:
                if 'AG' in content:
                    shutil.rmtree(hubpath)
    except Exception as e:
        kodi.log(str(e))
    # # Check for HUBRepo and install it
    try:
        if not os.path.exists(hubpath):
            installer.hub_install('repository.xbmchub', 'http://github.com/tvaddonsco/tva-release-repo/raw/master/'
                                                        'repository.xbmchub/')
            # xbmc.executebuiltin("XBMC.InstallAddon(%s)" % 'repository.xbmchub')
            addon_able.set_enabled("repository.xbmchub")
    except Exception as e:
        kodi.log(str(e))
        traceback.print_exc(file=sys.stdout)
        raise
    # Check for Log Uploader and install it
    try:
        if not os.path.exists(uploaderpath):
            installer.hub_install('script.tvaddons.debug.log', 'http://github.com/tvaddonsco/tva-release-repo/raw/'
                                                               'master/script.tvaddons.debug.log/')
            addon_able.set_enabled('script.tvaddons.debug.log')
    except Exception as e:
        kodi.log(str(e))
        raise
   
    # 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.add_item("Config Wizard", '', 'call_wizard', artwork+'config_wizard.png',
                      description="Automatically configure Kodi with the best addons and goodies in seconds!")
    kodi.add_dir("Addon Installer", '', 'call_installer', artwork + 'addon_installer.png',
                 description="It’s like an App Store for Kodi addons!")
    kodi.add_dir("Maintenance Tools", '', 'call_maintool', artwork + 'maintool.png',
                 description="Keep your Kodi setup running at optimum performance!")
    # kodi.add_dir("Kodi Librtmp Files", '', 'get_libs', artwork +'librtmp_files.png')
    kodi.add_item("Rejuvenate Kodi", '', 'call_rejuv', artwork + 'rejuvinate.png',
                  description="Wipe and reconfigure Kodi with the latest Config Wizard setup!")
    kodi.add_dir("Factory Restore", '', 'call_restore', artwork + 'factory_restore.png',
                 description="Start off fresh, wipe your Kodi setup clean!")
    if os.path.exists(uploaderpath):
        kodi.add_item("Log Uploader", '', 'log_upload', artwork + 'log_uploader.png',
                      description="Easily upload your error logs for troubleshooting!")
    kodi.add_dir("Network Speed Test", '', 'runspeedtest', artwork + 'speed_test.png',
                 description="How fast is your internet?")
    kodi.add_dir("System Information", '', 'system_info', artwork + 'system_info.png',
                 description="Useful information about your Kodi setup!")
    kodi.add_dir("Sports Listings", '', 'call_sports', artwork + 'sports_list.png',
                 description="Who’s playing what today?")
    kodi.add_dir('Backup / Restore', '', 'backup_restore', artwork + 'backup_restore.png',
                 description="Backup or restore your Kodi configuration in minutes!")
    kodi.add_item("Log Viewer", '', 'log_view', artwork + 'log_viewer.png',
                  description="Easily view your error log without leaving Kodi!")
    kodi.add_item("No-Coin Scan", '', 'nocoin', artwork + 'no_coin.png',
                  description="Scan your Kodi directory for coin mining.")
    kodi.add_item("Notifications " + note_status, '', 'toggle_notify', artwork + note_art,
                  description="%s to important TV ADDONS notifications on startup!" % note_description)
    kodi.add_item("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")
Exemplo n.º 9
0
def tool_menu():
    menu_cache_path = cache_path
    if not os.path.exists(temp_path) and not os.path.exists(cache_path):
        os.makedirs(temp_path)
    if os.path.exists(temp_path):
        menu_cache_path = temp_path
    if not os.path.exists(packages_path):
        os.makedirs(packages_path)
    cache_size = ''
    thumb_size = ''
    packages_size = ''
    paths = {
        menu_cache_path: cache_size,
        thumbnail_path: thumb_size,
        packages_path: packages_size
    }
    if kodi.get_setting("maint_check_folders") == "true":
        for path in paths:
            try:
                paths[path] = ' - [COLOR blue]' + convert_size(
                    get_size(path)) + '[/COLOR]'
            except Exception as e:
                kodi.log(str(e))
                paths[path] = ' - [COLOR red]Error reading thumbnails[/COLOR]'
    startup_clean = kodi.get_setting("acstartup")
    if startup_clean == "false":
        startup_onoff = "Enable"
        su_art = 'enable_am_startup.png'
    else:
        startup_onoff = "Disable"
        su_art = 'disable_am_startup.png'
    su_desc = startup_onoff + " maintenance on Kodi launch!"
    weekly_clean = kodi.get_setting("clearday")
    if weekly_clean == "7":
        weekly_onoff = "Enable"
        acw_art = 'enable_am_week.png'
        acw_desc = "Set your device to perform maintenance on a given day each week!"
    else:
        weekly_onoff = "Disable"
        acw_art = 'disable_am_week.png'
        acw_desc = weekly_onoff + " weekly maintenance on Kodi launch!"
    if kodi.get_setting('scriptblock') == 'false':
        scb_onoff = 'Enable'
        # scb_mode = 'toggleblocker'
        scb_art = 'enable_MSB.png'
    else:
        scb_onoff = 'Disable'
        # scb_mode = 'toggleblocker'
        scb_art = 'enable_MSB.png'
    scb_desc = scb_onoff + " protection against malicious scripts!"

    if not _is_debugging():
        debug_onoff = 'Enable'
        debug_art = 'enabledebug.png'
    else:
        debug_onoff = 'Disable'
        debug_art = 'disabledebug.png'
    debug_desc = debug_onoff + " Debugging!"

    # Maintenance Tool Menu
    kodi.add_item("Clear Cache " + str(paths[menu_cache_path]),
                  '',
                  'clear_cache',
                  artwork + 'currentcache.png',
                  description="Clear your device cache!")
    kodi.add_item("Delete Thumbnails " + str(paths[thumbnail_path]),
                  '',
                  'clear_thumbs',
                  artwork + 'currentthumbs.png',
                  description="Delete your Thumbnail cache!")
    kodi.add_item("Delete Packages " + str(paths[packages_path]),
                  '',
                  'purge_packages',
                  artwork + 'currentpackages.png',
                  description="Delete your addon installation files!")
    kodi.add_item("Delete Crash Logs",
                  '',
                  'crashlogs',
                  artwork + 'clearcrash.png',
                  description="Clear all crash logs from your device!")
    kodi.add_item("Delete Textures13.db",
                  '',
                  'deletetextures',
                  artwork + 'currentthumbs.png',
                  description="This will delete the Textures13 database")
    kodi.add_dir("Wipe Addons",
                 '',
                 'wipe_addons',
                 artwork + 'wipe_addons.png',
                 description="Erase all your Kodi addons in one shot!")
    kodi.add_item(
        "Run Auto Maintenance",
        '',
        'autoclean',
        artwork + 'run_am.png',
        description=
        "Clear your cache, thumbnails and delete addon packages in one click!")
    kodi.add_item(startup_onoff + ' Auto Maintenance on Startup',
                  '',
                  'autocleanstartup',
                  artwork + su_art,
                  description=su_desc)
    kodi.add_item(weekly_onoff + ' Weekly Auto Maintenance',
                  '',
                  'autocleanweekly',
                  artwork + acw_art,
                  description=acw_desc)
    kodi.add_item(debug_onoff + " Debugging Mode",
                  '',
                  'debug_onoff',
                  artwork + debug_art,
                  description=debug_desc)
    kodi.add_item(scb_onoff + " Malicious Scripts Blocker",
                  '',
                  'toggleblocker',
                  artwork + scb_art,
                  description=scb_desc)
    kodi.add_item(
        "Force Update Addons",
        '',
        'updateaddons',
        artwork + 'forceupdateaddons.png',
        description="Force a reload of all Kodi addons and repositories!")
    kodi.add_dir(
        "Install Custom Keymaps",
        '',
        'customkeys',
        artwork + 'custom_keymaps.png',
        description=
        "Get the best experience out of your device-specific remote control!")
    kodi.add_item("Reload Current Skin",
                  '',
                  'reloadskin',
                  artwork + 'reloadskin.png',
                  description="Reload the skin!")
    viewsetter.set_view("sets")
Exemplo n.º 10
0
def list_back_del():
    for f in os.listdir(zip_path):
        if f.endswith(".zip"):
            url = xbmc.translatePath(os.path.join(zip_path, f))
            kodi.add_dir(f, url, 'do_del_backup', '')