コード例 #1
0
def INTERNATIONAL():
    kodi.addDir('International Repos', '', 'interrepos',
                'https://www.tvaddons.co/kodi-addons/images/categories/international.png',
                description="Foreign language repos from across the globe!")
    kodi.addDir('International Addons', '', 'interaddons',
                'https://www.tvaddons.co/kodi-addons/images/categories/international.png',
                description="Foreign language addons from across the globe!")
コード例 #2
0
def INTERNATIONAL():
    kodi.addDir('International Repos', '', 'interrepos',
                'https://www.tvaddons.co/kodi-addons/images/categories/international.png',
                description="Foreign language repos from across the globe!")
    kodi.addDir('International Addonss', '', 'interaddons',
                'https://www.tvaddons.co/kodi-addons/images/categories/international.png',
                description="Foreign language addons from across the globe!")
コード例 #3
0
ファイル: installer.py プロジェクト: krzysztofuu/Bonitillonew
def INTERNATIONAL(url):
    if not '://' in url: url = base_url2 + url
    link = OPEN_URL(url)
    match = GetListItems(link)
    CMi = []
    viewsetter.set_view("sets")
    #CMi.append(['Information',"XBMC.Action(Info)"]);
    if 'repository' in url: ToMode = 'interrepolist'
    else: ToMode = 'addonlist'
    for url, image, name, in match:
        if name == "Repositories":
            kodi.addDir(
                'International Repositories',
                base_url + 'category/international/repositories',
                'interlist',
                artwork + 'world.png',
                description="Foreign language addons from across the globe!")
        else:

            iconimage = base_url + image
            add2HELPDir(name, url, ToMode, iconimage, fanart, '', 'addon', CMi,
                        True)
    nmatch = GetListNextPage(link)
    if len(nmatch) > 0:
        kodi.addDir('Next Page', (nmatch[0]), 'interrepolist',
                    getArtworkJ('NextPage'))
    viewsetter.set_view("sets")
    return
コード例 #4
0
ファイル: backup.py プロジェクト: enursha101/xbmc-addon
def BACKUPMENU():
    kodi.addItem(
        '[COLOR white]Select Backup Location[/COLOR]',
        'url',
        'display_backup_settings',
        '',
        description=
        "Choose the location to which you wish to store your backups!")
    kodi.addItem(
        '[COLOR white]Full Backup (All Files and Folders Included)[/COLOR]',
        'url',
        'full_backup',
        '',
        description="Backup everything possible!")
    kodi.addItem(
        '[COLOR white]Backup No Database (No Database Files Included)[/COLOR]',
        'url',
        'small_backup',
        '',
        description=
        "Backup your Kodi configuration without unnecessary database files!")
    kodi.addDir('[COLOR white]Restore Backup[/COLOR]',
                '',
                'do_backup_restore',
                '',
                description="Restore your Kodi configuration from a backup!")
    kodi.addDir('[COLOR white]Delete Backup[/COLOR]',
                '',
                'del_backup',
                '',
                description="Erase any backups you have saved!")

    viewsetter.set_view("sets")
コード例 #5
0
ファイル: default.py プロジェクト: AMOboxTV/AMOBox.LegoBuild
def custom_list_view_tv(trakt_id,media):
	try:
		lists = trakt_api.get_special_list('kids',media)#is actually SLUG ID
		for e in lists:
			infoLabels = trakt_api.process_movie(e)
			infoLabels.update(make_infoLabels(e))
			menu_items=[]
			trakt_id = str(infoLabels['trakt_id'])
			trailer = infoLabels['trailer_url']
			year = str(infoLabels['year'])
			name = infoLabels['title'].encode('utf-8')
			thumb=infoLabels['cover_url']
			if thumb is None:
				thumb = ''
			menu_items.append(('[COLOR gold]Show Information[/COLOR]', 'XBMC.Action(Info)'))
			if trailer:
				utube = tools.make_trailer(trailer)
				menu_items.append(('[COLOR gold]Play Trailer[/COLOR]', 'PlayMedia('+utube+',xbmcgui.ListItem(title, iconImage=image, thumbnailImage=image))'))


			kodi.addDir(name+' ('+year+')','','find_season',thumb,name,5,trakt_id,'shows',meta_data=infoLabels,menu_items=menu_items,replace_menu=False)
			kodi.auto_view('tvshows')
	except Exception as e:
		log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
		if kodi.get_setting('error_notify') == "true":
			kodi.notify(header='Custom List Error',msg='(error) %s  %s' % (str(e), ''),duration=5000,sound=None)
コード例 #6
0
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",.execute
            "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 key in sorted(l_vert.items(), key=lambda key: key[1]):
            try:
                kodi.addDir(
                    key[1],
                    key[0],
                    'interaddonslist',
                    imurl + key[1].lower() + '.png',
                    description="Foreign language addons from across the globe!"
                )
            except:
                pass
            viewsetter.set_view("sets")
コード例 #7
0
ファイル: maintool.py プロジェクト: krzysztofuu/Bonitillonew
def tool_menu():

    kodi.addItem("Clear Cache",
                 '',
                 'clearcache',
                 artwork + 'clear_cache.png',
                 description="Clear your device cache!")
    kodi.addItem("Purge Packages",
                 '',
                 'purgepackages',
                 artwork + 'purge_packages.png',
                 description="Erase old addon update files!")
    kodi.addItem("Wipe Addons",
                 '',
                 'wipeaddons',
                 artwork + 'wipe_addons.png',
                 description="Erase all your Kodi addons in one shot!")
    kodi.addDir(
        "Install Custom Keymaps",
        '',
        'customkeys',
        artwork + 'custom_keymaps.png',
        description=
        "Get the best experience out of your device-specific remote control!")
    if kodi.get_setting('automain') == 'true':
        kodi.addItem(
            "Disable Auto Maintenance ",
            '',
            'disablemain',
            artwork + 'disable_AM.png',
            description=
            "Disable the periodic automated erasing of cache and packages!")
    if kodi.get_setting('automain') == 'false':
        kodi.addItem(
            "Enable Auto Maintenance ",
            '',
            'enablemain',
            artwork + 'enable_AM.png',
            description=
            "Enable the periodic automated erasing of cache and packages!")
    if kodi.get_setting('scriptblock') == 'true':
        kodi.addItem(
            "Disable Malicious Scripts Blocker",
            '',
            'disableblocker',
            artwork + 'disable_MSB.png',
            description="Disable protection against malicious scripts!")
    if kodi.get_setting('scriptblock') == 'false':
        kodi.addItem(
            "Enable Malicious Scripts Blocker",
            '',
            'enableblocker',
            artwork + 'enable_MSB.png',
            description="Enable protection against malicious scripts!")

    viewsetter.set_view("sets")
コード例 #8
0
def rtmp_lib():
    liblist = "http://indigo.tvaddons.ag/librtmp/rtmplist.txt"
    link = OPEN_URL(liblist).replace('\n','').replace('\r','')
    match = re.compile('name="(.+?)".+?rl="(.+?)".+?ersion="(.+?)"').findall(link)
    kodi.addItem('[COLOR gold][B]Files Will Be Donwloaded to the Kodi Home directory, You Will Need To Manually Install From There.[/COLOR][/B]','',100,'','','')
    #kodi.addItem('[COLOR gold]-----------------------------------------------------------[/COLOR]','',100,'','','')
    for name,url,description in match:
        kodi.addDir(name,url,"lib_installer",artwork+'icon.png')

    viewsetter.set_view("sets")
コード例 #9
0
ファイル: backup.py プロジェクト: CYBERxNUKE/xbmc-addon
def backup_menu():
    kodi.addItem('[COLOR white]Select Backup Location[/COLOR]', 'url', 'display_backup_settings', '',
                 description="Choose the location to which you wish to store your backups!")
    kodi.addItem('[COLOR white]Full Backup (All Files and Folders Included)[/COLOR]', 'url', 'full_backup', '',
                 description="Backup everything possible!")
    kodi.addItem('[COLOR white]Backup No Database (No Database Files Included)[/COLOR]', 'url', 'small_backup', '',
                 description="Backup your Kodi configuration without unnecessary database files!")
    kodi.addDir('[COLOR white]Restore Backup[/COLOR]', '', 'do_backup_restore', '',
                description="Restore your Kodi configuration from a backup!")
    kodi.addDir('[COLOR white]Delete Backup[/COLOR]', '', 'del_backup', '',
                description="Erase any backups you have saved!")
    viewsetter.set_view("sets")
コード例 #10
0
ファイル: default.py プロジェクト: CYBERxNUKE/xbmc-addon
def rtmp_lib():
    liblist = "http://indigo.tvaddons.co/librtmp/rtmplist.txt"
    try:
        link = OPEN_URL(liblist).replace('\n', '').replace('\r', '')
    except:
        kodi.addItem('[COLOR gold][B]This service is currently unavailable.[/COLOR][/B]', '', 100, '', '', '')
        return
    match = re.compile('name="(.+?)".+?rl="(.+?)".+?ersion="(.+?)"').findall(link)
    kodi.addItem('[COLOR gold][B]Files Will Be Donwloaded to the Kodi Home directory, You Will Need To Manually Install From There.[/COLOR][/B]', '', 100, '', '', '')
    # kodi.addItem('[COLOR gold]---------------------------------------------------------[/COLOR]', '', 100, '',' ', '')
    for name, url, description in match:
        kodi.addDir(name, url, "lib_installer", artwork + 'icon.png')
    viewsetter.set_view("sets")
コード例 #11
0
def rtmp_lib():
    liblist = "http://indigo.tvaddons.co/librtmp/rtmplist.txt"
    try:
        link = OPEN_URL(liblist).replace('\n', '').replace('\r', '')
    except Exception as e:
        kodi.log(str(e))
        kodi.addItem('[COLOR gold][B]This service is currently unavailable.[/COLOR][/B]', '', 100, '', '', '')
        return
    match = re.compile('name="(.+?)".+?rl="(.+?)".+?ersion="(.+?)"').findall(link)
    kodi.addItem('[COLOR gold][B]Files Will Be Donwloaded to the Kodi Home directory,'
                 'You Will Need To Manually Install From There.[/COLOR][/B]', '', 100, '', '', '')
    # kodi.addItem('[COLOR gold]---------------------------------------------------------[/COLOR]', '', 100, '',' ', '')
    for m_name, m_url, m_description in match:
        kodi.addDir(m_name, m_url, "lib_installer", artwork + 'icon.png')
    viewsetter.set_view("sets")
コード例 #12
0
def MAININDEX():
    kodi.addDir('GitHub Browser', '', 'github_main', artwork + 'github_browser.png',
                description='Search for repositories hosted on GitHub.')
    # kodi.addDir('Search by: Addon/Author', '', 'searchaddon', artwork + 'search.png',
    #             description="Search for addons by Name or Author")
    # if settings.getSetting('featured') == 'true':
    #     kodi.addDir('Featured Addons', 'featured', 'addonlist', artwork + 'featured.png',
    #                 description="The most popular Kodi addons!")
    # if settings.getSetting('livetv') == 'true':
    #     kodi.addDir('Live TV Addons', 'live', 'addonlist', artwork + 'livetv.png',
    #                 description="The most popular live TV addons!")
    # if settings.getSetting('sports') == 'true':
    #     kodi.addDir('Sports Addons', 'sports', 'addonlist', artwork + 'sports.png',
    #                 description="The most popular sports addons!")
    # if settings.getSetting('video') == 'true':
    #     kodi.addDir('Video Addons', 'video', 'addonlist', artwork + 'video.png',
    #                 description="Every video addon in existence!")
    # if settings.getSetting('audio') == 'true':
    #     kodi.addDir('Audio Addons', 'audio', 'addonlist', artwork + 'audio.png',
    #                 description="Find addons to listen to music!")
    # if settings.getSetting('program') == 'true':
    #     kodi.addDir('Program Addons', 'executable', 'addonlist', artwork + 'program.png',
    #                 description="Every program addon you can imagine!")
    # if settings.getSetting('playlist') == 'true':
    #     kodi.addDir('Playlist Addons', 'playlists', 'addonlist', artwork + 'playlists.png',
    #                 description="The most popular playlist addons!")
    # if settings.getSetting('services') == 'true':
    #     kodi.addDir('Service Addons', 'service', 'addonlist', artwork + 'service.png')
    # if settings.getSetting('skincat') == 'true':
    #     kodi.addDir('Kodi Skins', 'skins', 'addonlist', artwork + 'kodi_skins.png',
    #                 description="Change up your look!")
    # if settings.getSetting('world') == 'true':
    #     kodi.addDir('International Addons', 'international', 'interlist', artwork + 'world.png',
    #                 description="Foreign language addons and repos from across the globe!")
    # if settings.getSetting('adult') == 'true':
    #     kodi.addDir('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.addDir('Repositories','repositories', 'addonlist', artwork + 'repositories.png',
    # 				description="Browse addons by repository!")
    # kodi.addItem('Enable Live Streaming', 'None', 'EnableRTMP', artwork + 'enablertmp.png',
    # 			 description="Enable RTMP InputStream and InputStream Adaptive modules for Live Streaming.")
    # kodi.addItem('Official OpenSubtitles Addon', openSub, 'addopensub', artwork + 'opensubicon.png',
    #              description="Install Official OpenSubtitles Addon!")
    kodi.addDir('Install ZIP from Online Link', '', 'urlzip', artwork + 'onlinesource.png',
                description='Manually download and install addons or repositories from the web.')
    viewsetter.set_view("sets")
コード例 #13
0
ファイル: installer.py プロジェクト: krzysztofuu/Bonitillonew
def keymaps():
    #xbmc.executebuiltin("Container.Refresh")
    link = OPEN_URL(Keymaps_URL).replace('\n', '').replace('\r', '')
    match = re.compile(
        'name="(.+?)".+?rl="(.+?)".+?mg="(.+?)".+?anart="(.+?)".+?ersion="(.+?)".+?ash="(.+?)"'
    ).findall(link)
    if os.path.isfile(KEYBOARD_FILE):
        kodi.addDir("Remove Current Keymap Configuration", '',
                    'uninstall_keymap', artwork + 'unkeymap.png')
        #Common.addItem('[COLOR white][B]Remove Current Keymap Configuration[/B][/COLOR]',BASEURL,128,ICON,FANART,'')
    for name, url, iconimage, fanart, version, description in match:
        kodi.addDir(name, url, 'install_keymap', artwork + 'keymapadd.png')
        name = "[COLOR white][B]" + name + "[/B][/COLOR]"
        #bname = " - [COLOR lightskyblue][COLOR white]This Week - [/COLOR][B]" + str(Common.count_advanced(name)) + "[/B][/COLOR]"
        #Common.addItem(name + bname,url,130,ADVANCED_SET_ICON,FANART,description)
    #xbmc.executebuiltin("Container.Refresh")
    viewsetter.set_view("files")
コード例 #14
0
ファイル: default.py プロジェクト: AMOboxTV/AMOBox.LegoBuild
def find_episode(name,trakt_id,movie_title):

	try:
		media ='episode'
		season = name.replace('Season ','')
		#print "SHOW TRAKT IS : "+trakt_id
		link = trakt_api.get_show_episodes(trakt_id,season)
		for e in link:
			ep_trakt_id= e['ids']['trakt']
			#print "Episode TRAKT ID IS  : "+str(ep_trakt_id)
			infoLabels={}
			infoLabels.update(make_infoLabels(e))
			episode = infoLabels['episode']
			infoLabels = trakt_api.get_episode_details(trakt_id,season,episode)
			menu_items=[]
			trailer = infoLabels['trailer_url']
			year = str(infoLabels['year'])
			name = infoLabels['title'].encode('utf-8')
			thumb=infoLabels['cover_url']
			# ################
			was_watched=watched_cache.get_watched_cache(ep_trakt_id)
			if was_watched is not None:
				infoLabels['playcount'] = 1
			# ################
			if thumb is None:
				thumb = ''
			#print infoLabels['premiered'][:10]
			#if (episode['first_aired'] != None and utils2.iso_2_utc(episode['first_aired']) <= time.time()) or (include_unknown and episode['first_aired'] == None):
			d1 = str(infoLabels['premiered'])
			d2 = str(datetime.date.today())
			#print today - was_aired
			#if infoLabels['premiered'] =='':
			if d1 >= d2 or infoLabels['premiered'] == '':
				if name is not '':
					menu_items.append(('[COLOR gold]Show Information[/COLOR]', 'XBMC.Action(Info)'))
					kodi.addDir('[COLOR maroon]S'+str(season)+'E'+str(episode)+'  '+name+'[/COLOR]','','findsource',thumb,movie_title,5,'','shows',meta_data=infoLabels,menu_items=menu_items,replace_menu=True)
					#name = name+" [COLOR red]Coming Soon[/COLOR]"
			else:
				menu_items.append(('[COLOR gold]Show Information[/COLOR]', 'XBMC.Action(Info)'))
				kodi.addDir('S'+str(season)+'E'+str(episode)+'  '+name,'','findsource',thumb,movie_title,5,'','shows',meta_data=infoLabels,menu_items=menu_items,replace_menu=True)
			kodi.auto_view('episode')
	except Exception as e:
		log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
		if kodi.get_setting('error_notify') == "true":
			kodi.notify(header='Trakt Episodes',msg='(error) %s  %s' % (str(e), ''),duration=5000,sound=None)
コード例 #15
0
ファイル: installer.py プロジェクト: krzysztofuu/Bonitillonew
def List_Addons(url):
    if not '://' in url: url = base_url2 + url
    link = OPEN_URL(url)
    match = GetListItems(link)
    CMi = []
    #kodi.log(link)
    if '/category/repositories/' in url: ToMode = 'addonlist'
    else: ToMode = 'addonindex'
    for url, image, name, in match:
        iconimage = base_url + image
        add2HELPDir(name, url, ToMode, iconimage, fanart, '', 'addon', CMi,
                    True)
    nmatch = GetListNextPage(link)
    if len(nmatch) > 0:
        kodi.addDir('Next Page', (nmatch[0]), 'addonlist',
                    getArtworkJ('NextPage'))

    viewsetter.set_view("sets")
コード例 #16
0
ファイル: default.py プロジェクト: AMOboxTV/AMOBox.LegoBuild
def custom_list_view(trakt_id, media):
    try:
        lists = trakt_api.get_special_list(trakt_id,
                                           media)  #is actually SLUG ID
        for e in lists:
            infoLabels = trakt_api.process_movie(e)
            infoLabels.update(make_infoLabels(e))
            menu_items = []
            trakt_id = str(infoLabels['trakt_id'])
            trailer = infoLabels['trailer_url']
            year = str(infoLabels['year'])
            name = infoLabels['title'].encode('utf-8')
            thumb = infoLabels['cover_url']
            if thumb is None:
                thumb = ''
            menu_items.append(
                ('[COLOR gold]Show Information[/COLOR]', 'XBMC.Action(Info)'))
            if trailer:
                utube = tools.make_trailer(trailer)
                menu_items.append((
                    '[COLOR gold]Play Trailer[/COLOR]', 'PlayMedia(' + utube +
                    ',xbmcgui.ListItem(title, iconImage=image, thumbnailImage=image))'
                ))

            kodi.addDir(name + ' (' + year + ')',
                        '',
                        'findsource',
                        thumb,
                        name,
                        5,
                        '',
                        'movies',
                        meta_data=infoLabels,
                        menu_items=menu_items,
                        replace_menu=False)
            kodi.auto_view('movies')
    except Exception as e:
        log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
        if kodi.get_setting('error_notify') == "true":
            kodi.notify(header='Custom List Error',
                        msg='(error) %s  %s' % (str(e), ''),
                        duration=5000,
                        sound=None)
コード例 #17
0
def github_search(url):
    q = _get_keyboard("", "Search GitHub")
    if not q: return
    import json
    from libs.github_installer import github_api
    if url == 'username':
        rtype = 'api'
        response = github_api.find_zips(q)
        if response is None: return
        for r in github_api.sort_results(response['items']):
            if not r['path'].endswith(".zip"): continue
            url = github_api.content_url % (r['repository']['full_name'], r['path'])
            kodi.addItem(r['name'], json.dumps({"url": url, "user": q, "file": r['name'], "full_name": "%s/%s" % (q, r['repository']['name'])}), 'github_install', '', description="")
        #viewsetter.set_view("list")
        return
    elif url == 'repo':
        rtype = 'api'
        results = github_api.search(q, 'title')
        if results is None: return
        for i in results['items']:
            user = i['owner']['login']
            response = github_api.find_zips(user)
            if response is None: continue
            for r in github_api.sort_results(response['items']):
                if not r['path'].endswith(".zip"): continue
                url = github_api.content_url % (r['repository']['full_name'], r['path'])
                kodi.addItem(r['name'], json.dumps({"url": url, "user": q, "file": r['name'], "full_name": "%s/%s" % (q, r['repository']['name'])}), 'github_install', '', description="")
        #viewsetter.set_view("list")
        return
            
    elif url == 'addon_id':
        rtype = 'web'
        results = github_api.web_search(q)
    else:
        rtype = 'api'
        results = github_api.search(q)
    if results is None: return
    for r in results['items']:
        if rtype == 'api':
            kodi.addDir(r['name'], json.dumps({"user":  r['owner']['login'], "repo": r['name'], "rtype": rtype}), 'github_results', '', description="")
        else:
            kodi.addItem("%s/%s" % (r['owner']['login'], r['name']), json.dumps({"user":  r['owner']['login'], "repo": r['name'], "rtype": rtype}), 'github_results', '', description="")
コード例 #18
0
ファイル: default.py プロジェクト: AMOboxTV/AMOBox.LegoBuild
def menu():
    autoupdates.STARTUP()
    if kodi.get_setting('trakt_authorized') == 'true':
        kodi.addDir("Parent Approved Movies",
                    '',
                    'custom_movie_lists',
                    artwork + 'movies.png',
                    '',
                    1,
                    '',
                    '',
                    fanart=fanart)
        kodi.addDir("Parent Approved TV Shows",
                    '',
                    'custom_tv_lists',
                    artwork + 'tvshows.png',
                    '',
                    1,
                    '',
                    '',
                    fanart=fanart)
    if kodi.get_setting('trakt_authorized') == 'false':
        kodi.addDir("[COLOR gold]Requires Trakt Integration[/COLOR]",
                    messages + 'trakt_auth.txt',
                    'get_pin',
                    artwork + 'trakt.png',
                    '',
                    1,
                    '',
                    '',
                    fanart=fanart,
                    is_playable=False,
                    is_folder=True)
    kodi.auto_view('menu')
コード例 #19
0
ファイル: default.py プロジェクト: AMOboxTV/AMOBox.LegoBuild
def menu():
	autoupdates.STARTUP()
	if  kodi.get_setting('trakt_authorized') =='true':
		kodi.addDir("Parent Approved Movies",'','custom_movie_lists',artwork+'movies.png','',1,'','',fanart=fanart)
		kodi.addDir("Parent Approved TV Shows",'','custom_tv_lists',artwork+'tvshows.png','',1,'','',fanart=fanart)
	if  kodi.get_setting('trakt_authorized') =='false':
		kodi.addDir("[COLOR gold]Requires Trakt Integration[/COLOR]",messages+'trakt_auth.txt','get_pin',artwork+'trakt.png','',1,'','',fanart=fanart,is_playable=False,is_folder=True)
	kodi.auto_view('menu')
コード例 #20
0
ファイル: default.py プロジェクト: AMOboxTV/AMOBox.LegoBuild
def find_season(name,trakt_id):

	try:
		media = 'shows'
		movie_title =name
		print "TRAKT ID IS : "+trakt_id
		link = trakt_api.get_show_seasons(trakt_id)
		for e in link:
					infoLabels = trakt_api.process_show(e)
					infoLabels.update(make_infoLabels(e))
					#trakt_id = str(infoLabels['trakt_id'])
					if infoLabels['cover_url'] == None:
						infoLabels['cover_url'] = artwork+'place_poster.png'
					menu_items=[]
					menu_items.append(('[COLOR gold]Show Information[/COLOR]', 'XBMC.Action(Info)'))
					#if kodi.get_setting('trakt_authorized') == 'true':
						#menu_items.append(('[COLOR gold]Mark as Watched[/COLOR]',      'RunPlugin(%s)' % addon.build_plugin_url({'trakt_id':trakt_id, 'mode':'add_watched_history', 'name':name, 'media':media})))
					kodi.addDir('Season '+str(infoLabels['number']),'','find_episode',infoLabels['cover_url'],movie_title,5,trakt_id,'shows',meta_data=infoLabels,menu_items=menu_items,replace_menu=True)
					kodi.auto_view('season')
	except Exception as e:
		log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
		if kodi.get_setting('error_notify') == "true":
			kodi.notify(header='Trakt Seasons',msg='(error) %s  %s' % (str(e), ''),duration=5000,sound=None)
コード例 #21
0
ファイル: default.py プロジェクト: AMOboxTV/AMOBox.LegoBuild
def find_season(name, trakt_id):

    try:
        media = 'shows'
        movie_title = name
        print "TRAKT ID IS : " + trakt_id
        link = trakt_api.get_show_seasons(trakt_id)
        for e in link:
            infoLabels = trakt_api.process_show(e)
            infoLabels.update(make_infoLabels(e))
            #trakt_id = str(infoLabels['trakt_id'])
            if infoLabels['cover_url'] == None:
                infoLabels['cover_url'] = artwork + 'place_poster.png'
            menu_items = []
            menu_items.append(
                ('[COLOR gold]Show Information[/COLOR]', 'XBMC.Action(Info)'))
            #if kodi.get_setting('trakt_authorized') == 'true':
            #menu_items.append(('[COLOR gold]Mark as Watched[/COLOR]',      'RunPlugin(%s)' % addon.build_plugin_url({'trakt_id':trakt_id, 'mode':'add_watched_history', 'name':name, 'media':media})))
            kodi.addDir('Season ' + str(infoLabels['number']),
                        '',
                        'find_episode',
                        infoLabels['cover_url'],
                        movie_title,
                        5,
                        trakt_id,
                        'shows',
                        meta_data=infoLabels,
                        menu_items=menu_items,
                        replace_menu=True)
            kodi.auto_view('season')
    except Exception as e:
        log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
        if kodi.get_setting('error_notify') == "true":
            kodi.notify(header='Trakt Seasons',
                        msg='(error) %s  %s' % (str(e), ''),
                        duration=5000,
                        sound=None)
コード例 #22
0
def github_main(url):
    github_instructions()
    kodi.addDir('Search by GitHub Username', 'username', 'github_search', artwork + 'search_by_username.png',
                description="Search for addons by Username. Ex. tvaddonsco")
    kodi.addDir('Search by GitHub Repository Title', 'repo', 'github_search', artwork + 'search_by_repository_title.png',
                description="Search for addons by Repository Name")
    kodi.addDir('Search GitHub by Addon ID', 'addon_id', 'github_search', artwork + 'searchaddonid.png',
                description="Search for addons by AddonID. Ex. plugin.video.youtube (Advanced)")
    #kodi.addItem('Update Addons', '', 'github_update', artwork + 'update_github.png',
    #           description="Update GitHub Addons")
    viewsetter.set_view("sets")
コード例 #23
0
def keymaps():
    try:
        link = OPEN_URL(Keymaps_URL).replace('\n', '').replace('\r', '')
    except:
        kodi.addDir("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.addDir("Remove Current Keymap Configuration", '', 'uninstall_keymap', artwork + 'unkeymap.png')
    for name, url, iconimage, fanart, version, description in match:
        kodi.addDir(name, url, 'install_keymap', artwork + 'keymapadd.png')
        name = "[COLOR white][B]" + name + "[/B][/COLOR]"
    viewsetter.set_view("files")
コード例 #24
0
def keymaps():
    try:
        link = kodi.open_url(Keymaps_URL).replace('\n', '').replace('\r', '')
    except IOError:
        kodi.addDir("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.addDir("Remove Current Keymap Configuration", '', 'uninstall_keymap', artwork + 'unkeymap.png')
    for name, url, iconimage, fanart, version, description in match:
        name = "[COLOR white][B]" + name + "[/B][/COLOR]"
        kodi.addDir(name, url, 'install_keymap', artwork + 'keymapadd.png')
    viewsetter.set_view("files")
コード例 #25
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:
                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.addItem("Clear Cache " + str(paths[menu_cache_path]),
                 '',
                 'clear_cache',
                 artwork + 'currentcache.png',
                 description="Clear your device cache!")
    kodi.addItem("Delete Thumbnails " + str(paths[thumbnail_path]),
                 '',
                 'clear_thumbs',
                 artwork + 'currentthumbs.png',
                 description="Delete your Thumbnail cache!")
    kodi.addItem("Delete Packages " + str(paths[packages_path]),
                 '',
                 'purge_packages',
                 artwork + 'currentpackages.png',
                 description="Delete your addon installation files!")
    kodi.addItem("Delete Crash Logs",
                 '',
                 'crashlogs',
                 artwork + 'clearcrash.png',
                 description="Clear all crash logs from your device!")
    kodi.addItem("Delete Textures13.db",
                 '',
                 'deletetextures',
                 artwork + 'currentthumbs.png',
                 description="This will delete the Textures13 database")
    kodi.addDir("Wipe Addons",
                '',
                'wipe_addons',
                artwork + 'wipe_addons.png',
                description="Erase all your Kodi addons in one shot!")
    kodi.addItem(
        "Run Auto Maintenance",
        '',
        'autoclean',
        artwork + 'run_am.png',
        description=
        "Clear your cache, thumbnails and delete addon packages in one click!")
    kodi.addItem(startup_onoff + ' Auto Maintenance on Startup',
                 '',
                 'autocleanstartup',
                 artwork + su_art,
                 description=su_desc)
    kodi.addItem(weekly_onoff + ' Weekly Auto Maintenance',
                 '',
                 'autocleanweekly',
                 artwork + acw_art,
                 description=acw_desc)
    kodi.addItem(debug_onoff + " Debugging Mode",
                 '',
                 'debug_onoff',
                 artwork + debug_art,
                 description=debug_desc)
    kodi.addItem(scb_onoff + " Malicious Scripts Blocker",
                 '',
                 'toggleblocker',
                 artwork + scb_art,
                 description=scb_desc)
    kodi.addItem(
        "Force Update Addons",
        '',
        'updateaddons',
        artwork + 'forceupdateaddons.png',
        description="Force a reload of all Kodi addons and repositories!")
    kodi.addDir(
        "Install Custom Keymaps",
        '',
        'customkeys',
        artwork + 'custom_keymaps.png',
        description=
        "Get the best experience out of your device-specific remote control!")
    kodi.addItem("Reload Current Skin",
                 '',
                 'reloadskin',
                 artwork + 'reloadskin.png',
                 description="Reload the skin!")
    viewsetter.set_view("sets")
コード例 #26
0
ファイル: installer.py プロジェクト: krzysztofuu/Bonitillonew
def MAININDEX():

    kodi.addDir('Search by: Addon/Author',
                base_url + 'search/?keyword=',
                'searchaddon',
                artwork + 'search.png',
                description="Search for addons by Name or Author")
    if settings.getSetting('featured') == 'true':
        kodi.addDir('Featured Addons',
                    base_url + 'category/featured/',
                    'addonlist',
                    artwork + 'featured.png',
                    description="The most popular Kodi addons!")
    if settings.getSetting('livetv') == 'true':
        kodi.addDir('Live TV Addons',
                    base_url + 'category/livetv/',
                    'addonlist',
                    artwork + 'livetv.png',
                    description="The most popular live TV addons!")
    if settings.getSetting('sports') == 'true':
        kodi.addDir('Sports Addons',
                    base_url + 'category/sports/',
                    'addonlist',
                    artwork + 'sports.png',
                    description="The most popular sports addons!")
    if settings.getSetting('video') == 'true':
        kodi.addDir('Video Addons',
                    base_url + 'category/video/',
                    'addonlist',
                    artwork + 'video.png',
                    description="Every video addon in existence!")
    if settings.getSetting('audio') == 'true':
        kodi.addDir('Audio Addons',
                    base_url + 'category/audio/',
                    'addonlist',
                    artwork + 'audio.png',
                    description="Find addons to listen to music!")
    if settings.getSetting('program') == 'true':
        kodi.addDir('Program Addons',
                    base_url + 'category/programs/',
                    'addonlist',
                    artwork + 'program.png',
                    description="Every program addon you can imagine!")
    if settings.getSetting('playlist') == 'true':
        kodi.addDir('Playlist Addons',
                    base_url + 'category/playlists/',
                    'addonlist',
                    artwork + 'playlists.png',
                    description="The most popular playlist addons!")
    # if settings.getSetting('services')=='true':
    # 	kodi.addDir('Service Addons',base_url+'category/services/','addonlist',artwork+'service.png')
    if settings.getSetting('skincat') == 'true':
        kodi.addDir('Kodi Skins',
                    base_url + 'category/skins/',
                    'addonlist',
                    artwork + 'kodi_skins.png',
                    description="Change up your look!")
    if settings.getSetting('world') == 'true':
        kodi.addDir('International Addons',
                    base_url + 'category/international/',
                    'interlist',
                    artwork + 'world.png',
                    description=
                    "Foreign language addons and repos from across the globe!")
    if settings.getSetting('adult') == 'true':
        kodi.addDir(
            'Adult Addons',
            indigo_url + 'xxx.php',
            '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.addDir('Repositories',
                    base_url + 'category/repositories/',
                    'addonlist',
                    artwork + 'repositories.png',
                    description="Browse addons by repository!")
    kodi.addItem('Official OpenSubtitles Addon',
                 openSub,
                 'addopensub',
                 artwork + 'opensubicon.png',
                 description="Install Official OpenSubtitles Addon!")
    viewsetter.set_view("sets")
コード例 #27
0
ファイル: backup.py プロジェクト: enursha101/xbmc-addon
def ListBackDel():
    addonfolder = xbmc.translatePath(os.path.join('special://', 'home'))
    for file in os.listdir(USB):
        if file.endswith(".zip"):
            url = xbmc.translatePath(os.path.join(USB, file))
            kodi.addDir(file, url, 'do_del_backup', '')
コード例 #28
0
def MAININDEX():
    kodi.addItem("Git Browser", '', 'github_main', artwork + 'github_browser.png',
                 description="Search for repositories hosted on GitHub.")
    kodi.addDir('Search by: Addon/Author', '', 'searchaddon', artwork + 'search.png',
                description="Search for addons by Name or Author")
    if settings.getSetting('featured') == 'true':
        kodi.addDir('Featured Addons', 'featured', 'addonlist', artwork + 'featured.png',
                    description="The most popular Kodi addons!")
    # if settings.getSetting('livetv') == 'true':
    #     kodi.addDir('Live TV Addons', 'live', 'addonlist', artwork + 'livetv.png',
    #                 description="The most popular live TV addons!")
    # if settings.getSetting('sports') == 'true':
    #     kodi.addDir('Sports Addons', 'sports', 'addonlist', artwork + 'sports.png',
    #                 description="The most popular sports addons!")
    if settings.getSetting('video') == 'true':
        kodi.addDir('Video Addons', 'video', 'addonlist', artwork + 'video.png',
                    description="Every video addon in existence!")
    if settings.getSetting('audio') == 'true':
        kodi.addDir('Audio Addons', 'audio', 'addonlist', artwork + 'audio.png',
                    description="Find addons to listen to music!")
    if settings.getSetting('program') == 'true':
        kodi.addDir('Program Addons', 'executable', 'addonlist', artwork + 'program.png',
                    description="Every program addon you can imagine!")
    # if settings.getSetting('playlist') == 'true':
    #     kodi.addDir('Playlist Addons', 'playlists', 'addonlist', artwork + 'playlists.png',
    #                 description="The most popular playlist addons!")
    if settings.getSetting('services') == 'true':
        kodi.addDir('Service Addons', 'service', 'addonlist', artwork + 'service.png')
    if settings.getSetting('skincat') == 'true':
        kodi.addDir('Kodi Skins', 'skins', 'addonlist', artwork + 'kodi_skins.png',
                    description="Change up your look!")
    if settings.getSetting('world') == 'true':
        kodi.addDir('International Addons', 'international', 'interlist', artwork + 'world.png',
                    description="Foreign language addons and repos from across the globe!")
    if settings.getSetting('adult') == 'true':
        kodi.addDir('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.addDir('Repositories','repositories', 'addonlist', artwork + 'repositories.png',
    # 				description="Browse addons by repository!")
    # kodi.addItem('Enable Live Streaming', 'None', 'EnableRTMP', artwork + 'enablertmp.png',
    # 			 description="Enable RTMP InputStream and InputStream Adaptive modules for Live Streaming.")
    kodi.addItem('Official OpenSubtitles Addon', openSub, 'addopensub', artwork + 'opensubicon.png',
                 description="Install Official OpenSubtitles Addon!")
    kodi.addDir('Install ZIP from Online Link', '', 'urlzip', artwork + 'onlinesource.png',
                description='Manually download and install addons or repositories from the web.')
    viewsetter.set_view("sets")
コード例 #29
0
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'
                fanart = path.rsplit('/', 1)[0] + '/fanart.jpg'
                try:
                    addHELPDir(name, path, 'addoninstall', icon, fanart, description, 'addon', repourl, '', '', CMi,
                               contextreplace=False)
                except:
                    pass
    
    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'
            fanart = path.rsplit('/', 1)[0] + '/fanart.jpg'
            try:
                addHELPDir(name, path, 'addoninstall', icon, fanart, description, 'addon', repourl, '', '', CMi,
                           contextreplace=False)
            except:
                pass
            
            # 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.addDir(e, url, 'splitlist', artwork + e + '.png', description="Starts with letter " + e)
        kodi.addDir('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'
            fanart = path.rsplit('/', 1)[0] + '/fanart.jpg'
            try:
                addHELPDir(name, path, 'addoninstall', icon, fanart, description, 'addon', 'None', '', '', CMi,
                           contextreplace=False)
            except:
                pass
    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'
                fanart = path.rsplit('/', 1)[0] + '/fanart.jpg'
                try:
                    addHELPDir(name, path, 'addoninstall', icon, fanart, description, 'addon', 'None', '', '', CMi,
                               contextreplace=False)
                except:
                    pass
    viewsetter.set_view("sets")
コード例 #30
0
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 key in l_vert:
            #     if e['languages'] == key:
            #         full_name = l_vert[key]
            #         name = e['languages']
            #         try:
            #             kodi.addDir(full_name, name, 'interaddonslist', imurl + full_name.lower() + '.png',
            #                         description="Foreign language addons from across the globe!")
            #         except:
            #             pass
            #         viewsetter.set_view("sets")

            for key in sorted(l_vert.items(), key=lambda key: key[1]):
                try:
                    kodi.addDir(key[1], key[0], 'interaddonslist', imurl + key[1].lower() + '.png',
                                description="Foreign language addons from across the globe!")
                except:
                    pass
                viewsetter.set_view("sets")
コード例 #31
0
ファイル: default.py プロジェクト: CYBERxNUKE/xbmc-addon
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")
コード例 #32
0
def ListBackDel():
    for file in os.listdir(zip_path):
        if file.endswith(".zip"):
            url = xbmc.translatePath(os.path.join(zip_path, file))
            kodi.addDir(file, url, 'do_del_backup', '')
コード例 #33
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")
コード例 #34
0
ファイル: default.py プロジェクト: AMOboxTV/AMOBox.LegoBuild
def find_episode(name, trakt_id, movie_title):

    try:
        media = 'episode'
        season = name.replace('Season ', '')
        #print "SHOW TRAKT IS : "+trakt_id
        link = trakt_api.get_show_episodes(trakt_id, season)
        for e in link:
            ep_trakt_id = e['ids']['trakt']
            #print "Episode TRAKT ID IS  : "+str(ep_trakt_id)
            infoLabels = {}
            infoLabels.update(make_infoLabels(e))
            episode = infoLabels['episode']
            infoLabels = trakt_api.get_episode_details(trakt_id, season,
                                                       episode)
            menu_items = []
            trailer = infoLabels['trailer_url']
            year = str(infoLabels['year'])
            name = infoLabels['title'].encode('utf-8')
            thumb = infoLabels['cover_url']
            # ################
            was_watched = watched_cache.get_watched_cache(ep_trakt_id)
            if was_watched is not None:
                infoLabels['playcount'] = 1
            # ################
            if thumb is None:
                thumb = ''
            #print infoLabels['premiered'][:10]
            #if (episode['first_aired'] != None and utils2.iso_2_utc(episode['first_aired']) <= time.time()) or (include_unknown and episode['first_aired'] == None):
            d1 = str(infoLabels['premiered'])
            d2 = str(datetime.date.today())
            #print today - was_aired
            #if infoLabels['premiered'] =='':
            if d1 >= d2 or infoLabels['premiered'] == '':
                if name is not '':
                    menu_items.append(('[COLOR gold]Show Information[/COLOR]',
                                       'XBMC.Action(Info)'))
                    kodi.addDir('[COLOR maroon]S' + str(season) + 'E' +
                                str(episode) + '  ' + name + '[/COLOR]',
                                '',
                                'findsource',
                                thumb,
                                movie_title,
                                5,
                                '',
                                'shows',
                                meta_data=infoLabels,
                                menu_items=menu_items,
                                replace_menu=True)
                    #name = name+" [COLOR red]Coming Soon[/COLOR]"
            else:
                menu_items.append(('[COLOR gold]Show Information[/COLOR]',
                                   'XBMC.Action(Info)'))
                kodi.addDir('S' + str(season) + 'E' + str(episode) + '  ' +
                            name,
                            '',
                            'findsource',
                            thumb,
                            movie_title,
                            5,
                            '',
                            'shows',
                            meta_data=infoLabels,
                            menu_items=menu_items,
                            replace_menu=True)
            kodi.auto_view('episode')
    except Exception as e:
        log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
        if kodi.get_setting('error_notify') == "true":
            kodi.notify(header='Trakt Episodes',
                        msg='(error) %s  %s' % (str(e), ''),
                        duration=5000,
                        sound=None)
コード例 #35
0
def find_source(name, thumb, media, movie_title):

    try:
        q1, q2, q3, q4, q5, q6, q7, q8 = Queue(), Queue(), Queue(), Queue(
        ), Queue(), Queue(), Queue(), Queue()

        if thumb is None:
            thumb = ''
        else:
            thumb = thumb
        if media == 'shows':
            find_sourceTV(name, thumb, media, movie_title)
        else:
            if kodi.get_setting('9movies') == "true":
                movie_title = name
                t = Thread(target=wrapper,
                           args=(nine_movies.ninemovies, name, q1))
                t.daemon = True
                t.start()

            if kodi.get_setting('primewire') == "true":
                movie_title = name
                Thread(target=wrapper,
                       args=(primewire.primewire, name, q2)).start()

            if kodi.get_setting('twomovies') == "true":
                movie_title = name
                Thread(target=wrapper,
                       args=(twomovies.tmovies, name, q3)).start()

            if kodi.get_setting('afdah') == 'true':
                movie_title = name
                Thread(target=wrapper, args=(afdah.afdah, name, q4)).start()

            if kodi.get_setting('merdb') == "true":
                movie_title = name
                Thread(target=wrapper, args=(merdb.merdb, name, q5)).start()

            if kodi.get_setting('zmovies') == "true":
                movie_title = name
                Thread(target=wrapper,
                       args=(zmovies.zmovies, name, q6)).start()

            if kodi.get_setting('123movies') == "true":
                movie_title = name
                Thread(target=wrapper,
                       args=(zmovies.zmovies, name, q7)).start()

            if kodi.get_setting('ice_films') == "true":
                movie_title = name
                t = Thread(target=wrapper, args=(icefilms.ice_films, name, q8))
                t.daemon = True
                t.start()

            if kodi.get_setting('ice_films') == "true":
                try:
                    icesources = q8.get()
                    for e in icesources:
                        total_items = len(icesources)
                        if 'debrid' in e:
                            premium = e['debrid']
                        else:
                            premium = ''
                        names = e['host']
                        urls = e['url']
                        urls = icefilms.resolve_link(urls)
                        views = e['views']
                        if e['quality'] == None:
                            quals = 'unknown'
                        else:
                            quals = e['quality']
                        menu_items = []
                        #menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                        kodi.addDir("[COLORteal][IceFilms][/COLOR] - " +
                                    names + ' [' + quals + ']' +
                                    ' [COLOR gold]' + str(premium) +
                                    '[/COLOR]',
                                    urls,
                                    'get_link',
                                    thumb,
                                    movie_title,
                                    total_items,
                                    '',
                                    'movies',
                                    menu_items=menu_items,
                                    is_playable='true',
                                    fanart=fanart)
                except Exception as e:
                    log_utils.log('Error [%s]  %s' % (str(e), ''),
                                  xbmc.LOGERROR)
                    if kodi.get_setting('error_notify') == "true":
                        kodi.notify(header='Scraper',
                                    msg='(error) %s  %s' % (str(e), ''),
                                    duration=5000,
                                    sound=None)

            if kodi.get_setting('9movies') == "true":
                try:
                    ninesources = q1.get()
                    for e in ninesources:
                        total_items = len(ninesources)
                        if 'debrid' in e:
                            premium = e['debrid']
                        else:
                            premium = ''
                        names = e['host']
                        urls = e['url']
                        views = e['view']
                        quals = e['quality']
                        menu_items = []
                        #menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                        kodi.addDir("[COLORteal][9Movies][/COLOR] - " + names +
                                    ' [' + quals + ']' + ' [COLOR gold]' +
                                    str(premium) + '[/COLOR]',
                                    urls,
                                    'get_link',
                                    thumb,
                                    movie_title,
                                    total_items,
                                    '',
                                    'movies',
                                    menu_items=menu_items,
                                    is_playable='true',
                                    fanart=fanart)
                except Exception as e:
                    log_utils.log('Error [%s]  %s' % (str(e), ''),
                                  xbmc.LOGERROR)
                    if kodi.get_setting('error_notify') == "true":
                        kodi.notify(header='Scraper',
                                    msg='(error) %s  %s' % (str(e), ''),
                                    duration=5000,
                                    sound=None)

            if kodi.get_setting('123movies') == "true":
                ottsources = q7.get()
                for e in ottsources:
                    total_items = len(ottsources)
                    if 'debrid' in e:
                        premium = e['debrid']
                    else:
                        premium = ''
                    names = e['host']
                    urls = e['url']
                    try:
                        quals = e['quality']
                    except:
                        quals = 'unknown'
                    menu_items = []
                    #menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                    kodi.addDir("[COLORteal][123Movies][/COLOR] - " + names +
                                ' [' + quals + ']' + ' [COLOR gold]' +
                                str(premium) + '[/COLOR]',
                                urls,
                                'get_link',
                                thumb,
                                movie_title,
                                total_items,
                                '',
                                'movies',
                                menu_items=menu_items,
                                is_playable='true',
                                fanart=fanart)

            if kodi.get_setting('primewire') == "true":
                primesources = q2.get()
                for e in primesources:
                    total_items = len(primesources)
                    #START RD CHECK
                    if 'debrid' in e:
                        premium = e['debrid']
                    else:
                        premium = ''
                    names = e['host']
                    urls = e['url']
                    views = e['view']
                    quals = e['quality']
                    menu_items = []
                    #menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb,'media':media,'movie_title':movie_title})))
                    kodi.addDir("[COLORteal][Primewire][/COLOR] - " + names +
                                ' [' + quals + ']' + ' Views ' + views +
                                ' [COLOR gold]' + str(premium) + '[/COLOR]',
                                urls,
                                'get_link',
                                thumb,
                                movie_title,
                                total_items,
                                '',
                                'movies',
                                menu_items=menu_items,
                                is_playable='true',
                                fanart=fanart)

            if kodi.get_setting('twomovies') == "true":
                tmsources = q3.get()
                for e in tmsources:
                    total_items = len(tmsources)
                    if 'debrid' in e:
                        premium = e['debrid']
                    else:
                        premium = ''
                    names = e['host']
                    #END RD Check
                    urls = e['url']
                    menu_items = []
                    #menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                    kodi.addDir('[COLORteal][Two Movies][/COLOR] - ' + names +
                                ' [COLOR gold]' + str(premium) + '[/COLOR]',
                                urls,
                                'tmlinkpage',
                                thumb,
                                movie_title,
                                total_items,
                                '',
                                'movies',
                                menu_items=menu_items,
                                is_playable='true',
                                fanart=fanart)

            if kodi.get_setting('afdah') == 'true':
                try:
                    afdahsources = q4.get()
                    for e in afdahsources:
                        total_items = len(afdahsources)
                        if 'debrid' in e:
                            premium = e['debrid']
                        else:
                            premium = ''
                        names = e['host']
                        urls = e['url']
                        quals = e['quality']
                        menu_items = []
                        #menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                        kodi.addDir('[COLORteal][AFDAH][/COLOR] - ' + names +
                                    ' [' + quals + ']' + ' [COLOR gold]' +
                                    str(premium) + '[/COLOR]',
                                    urls,
                                    'get_link',
                                    thumb,
                                    movie_title,
                                    total_items,
                                    '',
                                    'movies',
                                    menu_items=menu_items,
                                    is_playable='true',
                                    fanart=fanart)
                except Exception as e:
                    log_utils.log('Error [%s]  %s' % (str(e), ''),
                                  xbmc.LOGERROR)
                    if kodi.get_setting('error_notify') == "true":
                        kodi.notify(header='Scraper',
                                    msg='(error) %s  %s' % (str(e), ''),
                                    duration=5000,
                                    sound=None)

            if kodi.get_setting('merdb') == "true":
                mersources = q5.get()
                for e in mersources:
                    total_items = len(mersources)
                    if 'debrid' in e:
                        premium = e['debrid']
                    else:
                        premium = ''
                    names = e['host']
                    urls = e['url']
                    menu_items = []
                    #menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                    kodi.addDir("[COLORteal][MerDB][/COLOR] - " + names +
                                ' [COLOR gold]' + str(premium) + '[/COLOR]',
                                urls,
                                'playmerdblink',
                                thumb,
                                movie_title,
                                total_items,
                                '',
                                'movies',
                                menu_items=menu_items,
                                is_playable='true',
                                fanart=fanart)

            if kodi.get_setting('zmovies') == "true":
                zmoviesources = q6.get()
                for e in zmoviesources:
                    total_items = len(zmoviesources)
                    if 'debrid' in e:
                        premium = e[
                            'debrid']  #.replace('[','').replace(']','')
                    else:
                        premium = ''
                    names = e['host']
                    urls = e['url']
                    menu_items = []
                    #menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                    kodi.addDir("[COLORteal][ZMovies][/COLOR] - " + names +
                                ' [COLOR gold]' + str(premium) + '[/COLOR]',
                                urls,
                                'playzmovieslink',
                                thumb,
                                movie_title,
                                total_items,
                                '',
                                'movies',
                                menu_items=menu_items,
                                is_playable='true',
                                fanart=fanart)

    except Exception as e:
        log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
        if kodi.get_setting('error_notify') == "true":
            kodi.notify(header='Scraper',
                        msg='(error) %s  %s' % (str(e), ''),
                        duration=5000,
                        sound=None)
コード例 #36
0
ファイル: main_scrape.py プロジェクト: codixor/maximumTv
def find_source(name, thumb, media, movie_title):
    try:
        all_source = []

        q1, q2, q3, q4, q5, q6, q7, q8, q9 = Queue(), Queue(), Queue(), Queue(
        ), Queue(), Queue(), Queue(), Queue(), Queue()

        if thumb is None:
            thumb = ''
        else:
            thumb = thumb
        if media == 'shows':
            find_sourceTV(name, thumb, media, movie_title)
        else:
            # if kodi.get_setting('9movies') == "true":
            #     movie_title = name
            #     Thread(target=wrapper, args=(nine_movies.ninemovies, name, q1)).start()

            if kodi.get_setting('primewire') == "true":
                movie_title = name
                Thread(target=wrapper,
                       args=(primewire.primewire, name, q2)).start()

            # if kodi.get_setting('afdah') =='true':
            #     movie_title = name
            #     Thread(target=wrapper, args=(afdah.afdah, name, q4)).start()

            if kodi.get_setting('merdb') == "true":
                movie_title = name
                Thread(target=wrapper, args=(merdb.merdb, name, q5)).start()

            if kodi.get_setting('zmovies') == "true":
                movie_title = name
                Thread(target=wrapper,
                       args=(zmovies.zmovies, name, q6)).start()

            if kodi.get_setting('123movies') == "true":
                movie_title = name
                Thread(target=wrapper,
                       args=(ot3_movies.ot3_movies, name, q7)).start()

            if kodi.get_setting('ice_films') == "true":
                movie_title = name
                t = Thread(target=wrapper, args=(icefilms.ice_films, name, q8))
                t.daemon = True
                t.start()

            if kodi.get_setting('putlocker') == "true":
                movie_title = name
                t = Thread(target=wrapper,
                           args=(putlocker_both.putlocker_movies, name, q9))
                t.daemon = True
                t.start()


######Grab Results
######TRY TO SORT ALL TOGETHER

            if kodi.get_setting('ice_films') == "true":
                icesources = q8.get()
                all_source.append(icesources)

            if kodi.get_setting('putlocker') == "true":
                putlockersources = q9.get()
                all_source.append(putlockersources)

            # if kodi.get_setting('9movies') == "true":
            #     ninesources = q1.get()
            #     all_source.append(ninesources)

            if kodi.get_setting('123movies') == "true":
                ottsources = q7.get()
                all_source.append(ottsources)

            if kodi.get_setting('primewire') == "true":
                primesources = q2.get()
                all_source.append(primesources)

            # if kodi.get_setting('afdah') =='true':
            #     afdahsources = q4.get()
            #     all_source.append(afdahsources)

            if kodi.get_setting('merdb') == "true":
                mersources = q5.get()
                all_source.append(mersources)

            if kodi.get_setting('zmovies') == "true":
                zmoviesources = q6.get()
                all_source.append(zmoviesources)

            for a in all_source:
                if a:
                    #b = sorted(a, key=lambda k: (str(k['debrid'])))
                    b = sorted(a, reverse=False)
                    #b.sort(reverse=True)
                    # log_utils.log('TESTING 2 [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
                    try:
                        for e in b:
                            # log_utils.log('TESTING 3 [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
                            total_items = len(e)
                            if 'debrid' in e:
                                premium = " [COLOR gold]" + str(
                                    e['debrid']) + " [/COLOR]"
                            else:
                                premium = ''
                            hostname = e['hostname']
                            provider = "[COLOR white][" + hostname + "][/COLOR] - "
                            names = e['host']
                            urls = e['url']
                            if e['views'] == None:
                                views = ''
                            else:
                                views = " [COLOR green]Views " + e[
                                    'views'] + "[/COLOR]"
                            if e['quality'] == None:
                                quals = ''
                            else:
                                quals = " [COLOR red][" + e[
                                    'quality'] + "][/COLOR]"
                            menu_items = []
                            menu_items.append(
                                ('[COLOR gold]Add to Downloads[/COLOR]',
                                 'XBMC.Container.Update(%s)' %
                                 addon.build_plugin_url(
                                     {
                                         'mode': 'setup_download',
                                         'name': name,
                                         'url': urls,
                                         'thumb': thumb,
                                         'media': media,
                                         'movie_title': movie_title
                                     })))
                            #kodi.addDir("[COLORteal]["+hostname+"][/COLOR] - "+names+' ['+quals+']'+' [COLOR gold]'+str(premium)+'[/COLOR]',urls,'get_link',thumb,movie_title,total_items,'','movies',menu_items=menu_items,is_playable='true',fanart=fanart)
                            kodi.addDir(provider + names + quals + views +
                                        premium,
                                        urls,
                                        'get_link',
                                        thumb,
                                        movie_title,
                                        total_items,
                                        '',
                                        'movies',
                                        menu_items=menu_items,
                                        is_playable='true',
                                        fanart=fanart)

                    except:
                        pass

    except Exception as e:
        log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
        if kodi.get_setting('error_notify') == "true":
            kodi.notify(header='Movie Scrapers',
                        msg='(error) %s  %s' % (str(e), ''),
                        duration=5000,
                        sound=None)
        return
コード例 #37
0
ファイル: backup.py プロジェクト: CYBERxNUKE/xbmc-addon
def ListBackDel():
    addonfolder = xbmc.translatePath(os.path.join('special://', 'home'))
    for file in os.listdir(zip_path):
        if file.endswith(".zip"):
            url = xbmc.translatePath(os.path.join(zip_path, file))
            kodi.addDir(file, url, 'do_del_backup', '')
コード例 #38
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")
コード例 #39
0
def find_source(name, thumb, media, movie_title):

    if media == 'shows':
        find_sourceTV(name, thumb, media, movie_title)
    else:
        try:
            if thumb is None:
                thumb = ''
            else:
                thumb = thumb

            title = name[:-7]
            movie_year = name[-6:]
            year = movie_year.replace('(', '').replace(')', '')
            video_type = 'movies'
            total_items = 0

            t1 = Thread(target=go_ice, args=(video_type, title, year))
            #############PRIMEWIRE########################
            t2 = Thread(target=go_prime, args=(video_type, title, year))
            ##############IWATCH COMPLETE####################
            t3 = Thread(target=go_iwatch, args=(video_type, title, year))
            #############AFDAH COMPLETE##################
            t4 = Thread(target=go_afdah, args=(video_type, title, year))
            ############PUTLOCKER COMPLETE##################
            t5 = Thread(target=go_putlocker, args=(video_type, title, year))

            t1.start()
            t2.start()
            t3.start()
            t4.start()
            t5.start()

            t1.join()
            t2.join()
            t3.join()
            t4.join()
            t5.join()

            for a in all_source:
                if a:
                    b = sorted(a, reverse=False)
                    try:
                        for e in b:
                            #total_items =len(e)
                            #kodi.log(total_items)
                            if 'debrid' in e:
                                premium = " [COLOR gold]" + str(
                                    e['debrid']) + " [/COLOR]"
                            else:
                                premium = ''
                            hostname = e['hostname']
                            provider = "[COLOR white][" + hostname + "][/COLOR] - "
                            names = e['host']
                            urls = e['url']
                            if e['views'] == None:
                                views = ''
                            else:
                                views = " [COLOR green]Views " + e[
                                    'views'] + "[/COLOR]"
                            if e['quality'] == None:
                                quals = ''
                            else:
                                quals = " [COLOR red][" + e[
                                    'quality'] + "][/COLOR]"
                            menu_items = []
                            menu_items.append(
                                ('[COLOR gold]Add to Downloads[/COLOR]',
                                 'XBMC.Container.Update(%s)' %
                                 addon.build_plugin_url(
                                     {
                                         'mode': 'setup_download',
                                         'name': name,
                                         'url': urls,
                                         'thumb': thumb,
                                         'media': media,
                                         'movie_title': movie_title
                                     })))

                            #TODO Make Dialog Selections
                            # passname = []
                            # pro_list = {'proname': provider + names + quals + views + premium, 'url': urls,'movie_title':movie_title,'thumb':thumb,'media':media }
                            #
                            # passname.append(pro_list)
                            # pick_list(passname)

                            kodi.addDir(provider + names + quals + views +
                                        premium,
                                        urls,
                                        'get_link',
                                        thumb,
                                        movie_title + movie_year,
                                        total_items,
                                        '',
                                        'movies',
                                        menu_items=menu_items,
                                        is_playable='true',
                                        fanart=fanart)
                            viewsetter.set_view('files')
                    except:
                        pass

        except Exception as e:
            log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
            if kodi.get_setting('error_notify') == "true":
                kodi.notify(header='Movie Scrapers',
                            msg='(error) %s  %s' % (str(e), ''),
                            duration=5000,
                            sound=None)
            return
コード例 #40
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")
コード例 #41
0
ファイル: main_scrape.py プロジェクト: rofunds/maximumTv
def find_source(name,thumb,media,movie_title):
    try:
        all_source = []

        q1, q2, q3, q4, q5, q6, q7, q8, q9 = Queue(), Queue(), Queue(),Queue(), Queue(), Queue(), Queue(), Queue(),Queue()

        if thumb is None:
            thumb = ''
        else:
            thumb = thumb
        if media == 'shows':
            find_sourceTV(name,thumb,media,movie_title)
        else:
            # if kodi.get_setting('9movies') == "true":
            #     movie_title = name
            #     Thread(target=wrapper, args=(nine_movies.ninemovies, name, q1)).start()

            if kodi.get_setting('primewire') == "true":
                movie_title = name
                Thread(target=wrapper, args=(primewire.primewire, name, q2)).start()

            # if kodi.get_setting('afdah') =='true':
            #     movie_title = name
            #     Thread(target=wrapper, args=(afdah.afdah, name, q4)).start()

            if kodi.get_setting('merdb') == "true":
                movie_title = name
                Thread(target=wrapper, args=(merdb.merdb, name, q5)).start()

            if kodi.get_setting('zmovies') == "true":
                movie_title = name
                Thread(target=wrapper, args=(zmovies.zmovies, name, q6)).start()

            if kodi.get_setting('123movies') == "true":
                movie_title = name
                Thread(target=wrapper, args=(ot3_movies.ot3_movies, name, q7)).start()

            if kodi.get_setting('ice_films') == "true":
                movie_title = name
                t = Thread(target=wrapper, args=(icefilms.ice_films, name, q8))
                t.daemon = True
                t.start()

            if kodi.get_setting('putlocker') == "true":
                movie_title = name
                t = Thread(target=wrapper, args=(putlocker_both.putlocker_movies, name, q9))
                t.daemon = True
                t.start()

######Grab Results
######TRY TO SORT ALL TOGETHER


            if kodi.get_setting('ice_films') == "true":
                icesources = q8.get()
                all_source.append(icesources)

            if kodi.get_setting('putlocker') == "true":
                putlockersources = q9.get()
                all_source.append(putlockersources)

            # if kodi.get_setting('9movies') == "true":
            #     ninesources = q1.get()
            #     all_source.append(ninesources)

            if kodi.get_setting('123movies') == "true":
                ottsources = q7.get()
                all_source.append(ottsources)

            if kodi.get_setting('primewire') == "true":
                primesources = q2.get()
                all_source.append(primesources)

            # if kodi.get_setting('afdah') =='true':
            #     afdahsources = q4.get()
            #     all_source.append(afdahsources)

            if kodi.get_setting('merdb') == "true":
                mersources = q5.get()
                all_source.append(mersources)

            if kodi.get_setting('zmovies') == "true":
                zmoviesources =q6.get()
                all_source.append(zmoviesources)

            for a in all_source:
                    if a:
                        #b = sorted(a, key=lambda k: (str(k['debrid'])))
                        b = sorted(a, reverse=False)
                        #b.sort(reverse=True)
                        # log_utils.log('TESTING 2 [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
                        try:
                            for e in b :
                                # log_utils.log('TESTING 3 [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
                                total_items =len(e)
                                if 'debrid' in e:
                                    premium = " [COLOR gold]"+str(e['debrid'])+" [/COLOR]"
                                else:
                                    premium = ''
                                hostname = e['hostname']
                                provider = "[COLOR white]["+hostname+"][/COLOR] - "
                                names = e['host']
                                urls = e['url']
                                if e['views'] == None:
                                    views = ''
                                else:
                                    views = " [COLOR green]Views "+e['views']+"[/COLOR]"
                                if e['quality'] == None:
                                    quals = ''
                                else:quals =" [COLOR red]["+ e['quality']+"][/COLOR]"
                                menu_items=[]
                                menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                                #kodi.addDir("[COLORteal]["+hostname+"][/COLOR] - "+names+' ['+quals+']'+' [COLOR gold]'+str(premium)+'[/COLOR]',urls,'get_link',thumb,movie_title,total_items,'','movies',menu_items=menu_items,is_playable='true',fanart=fanart)
                                kodi.addDir(provider+names+quals+views+premium,urls,'get_link',thumb,movie_title,total_items,'','movies',menu_items=menu_items,is_playable='true',fanart=fanart)

                        except:
                            pass




    except Exception as e:
            log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
            if kodi.get_setting('error_notify') == "true":
                kodi.notify(header='Movie Scrapers',msg='(error) %s  %s' % (str(e), ''),duration=5000,sound=None)
            return
コード例 #42
0
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:
                    addHELPDir(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:
                addHELPDir(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.addDir(e, url, 'splitlist', artwork + e + '.png', description="Starts with letter " + e)
        kodi.addDir('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:
                addHELPDir(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:
                    addHELPDir(name, path, 'addoninstall', icon, l_fanart, description, 'addon', 'None', '', '', CMi,
                               contextreplace=False)
                except Exception as e:
                    kodi.log(str(e))
    viewsetter.set_view("sets")
コード例 #43
0
ファイル: maintool.py プロジェクト: CYBERxNUKE/xbmc-addon
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:
                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.addItem("Clear Cache " + str(paths[menu_cache_path]), '', 'clear_cache', artwork + 'currentcache.png',
                 description="Clear your device cache!")
    kodi.addItem("Delete Thumbnails " + str(paths[thumbnail_path]), '', 'clear_thumbs', artwork + 'currentthumbs.png',
                 description="Delete your Thumbnail cache!")
    kodi.addItem("Delete Packages " + str(paths[packages_path]), '', 'purge_packages', artwork + 'currentpackages.png',
                 description="Delete your addon installation files!")
    kodi.addItem("Delete Crash Logs", '', 'crashlogs', artwork + 'clearcrash.png',
                 description="Clear all crash logs from your device!")
    kodi.addItem("Delete Textures13.db", '', 'deletetextures', artwork + 'currentthumbs.png',
                 description="This will delete the Textures13 database")
    kodi.addDir("Wipe Addons", '', 'wipe_addons', artwork + 'wipe_addons.png',
                description="Erase all your Kodi addons in one shot!")
    kodi.addItem("Run Auto Maintenance", '', 'autoclean', artwork + 'run_am.png',
                 description="Clear your cache, thumbnails and delete addon packages in one click!")
    kodi.addItem(startup_onoff + ' Auto Maintenance on Startup', '', 'autocleanstartup', artwork + su_art,
                 description=su_desc)
    kodi.addItem(weekly_onoff + ' Weekly Auto Maintenance', '', 'autocleanweekly', artwork + acw_art,
                 description=acw_desc)
    kodi.addItem(debug_onoff + " Debugging Mode", '', 'debug_onoff', artwork + debug_art,
                 description=debug_desc)
    kodi.addItem(scb_onoff + " Malicious Scripts Blocker", '', 'toggleblocker', artwork + scb_art,
                 description=scb_desc)
    kodi.addItem("Force Update Addons", '', 'updateaddons', artwork + 'forceupdateaddons.png',
                 description="Force a reload of all Kodi addons and repositories!")
    kodi.addDir("Install Custom Keymaps", '', 'customkeys', artwork + 'custom_keymaps.png',
                description="Get the best experience out of your device-specific remote control!")
    kodi.addItem("Reload Current Skin", '', 'reloadskin', artwork + 'reloadskin.png',
                 description="Reload the skin!")
    viewsetter.set_view("sets")
コード例 #44
0
def find_sourceTV(name, thumb, media, movie_title):
    q1, q2, q3, q4, q5, q6, q7, q8 = Queue(), Queue(), Queue(), Queue(), Queue(
    ), Queue(), Queue(), Queue()
    try:
        if thumb is None:
            thumb = ''
        else:
            thumb = thumb
        if kodi.get_setting('primewire') == "true":
            Thread(target=tv_wrapper,
                   args=(primewire.primewire_tv, name, movie_title,
                         q2)).start()

        if kodi.get_setting('twomovies') == "true":
            Thread(target=tv_wrapper,
                   args=(twomovies.tmovies_tv, name, movie_title, q3)).start()

        if kodi.get_setting('ice_films') == "true":
            t = Thread(target=tv_wrapper,
                       args=(icefilms.ice_films_tv, name, movie_title, q8))
            t.daemon = True
            t.start()

        # GRAB RETURNS BELOW
        if kodi.get_setting('ice_films') == "true":
            try:
                icesources = q8.get()
                for e in icesources:
                    total_items = len(icesources)
                    if 'debrid' in e:
                        premium = e[
                            'debrid']  #.replace('[','').replace(']','')
                        print str(premium)
                    else:
                        premium = ''
                    names = e['host']
                    urls = e['url']
                    urls = icefilms.resolve_link(urls)
                    views = e['views']
                    if e['quality'] == None:
                        quals = 'unknown'
                    else:
                        quals = e['quality']
                    menu_items = []
                    #menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                    kodi.addDir("[COLORteal][IceFilms][/COLOR] - " + names +
                                ' [' + quals + ']' + ' [COLOR gold]' +
                                str(premium) + '[/COLOR]',
                                urls,
                                'get_tv_link',
                                thumb,
                                movie_title,
                                total_items,
                                '',
                                name,
                                menu_items=menu_items,
                                is_playable='true',
                                fanart=fanart)
            except Exception as e:
                log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
                if kodi.get_setting('error_notify') == "true":
                    kodi.notify(header='Ice Films',
                                msg='(error) %s  %s' % (str(e), ''),
                                duration=5000,
                                sound=None)

        if kodi.get_setting('primewire') == "true":
            primesources = q2.get()
            for e in primesources:
                total_items = len(primesources)
                if 'debrid' in e:
                    premium = e['debrid']
                    print str(premium)
                else:
                    premium = ''
                names = e['host']
                urls = e['url']
                views = e['view']
                quals = e['quality']
                menu_items = []
                #menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                kodi.addDir("[COLORteal][Primewire][/COLOR] - " + names +
                            ' [' + quals + ']' + ' Views ' + views +
                            ' [COLOR gold]' + str(premium) + '[/COLOR]',
                            urls,
                            'get_tv_link',
                            thumb,
                            movie_title,
                            total_items,
                            '',
                            name,
                            menu_items=menu_items,
                            is_playable='true',
                            fanart=fanart)

        if kodi.get_setting('twomovies') == "true":
            tmsources = q3.get()
            for e in tmsources:
                total_items = len(tmsources)
                if 'debrid' in e:
                    premium = e['debrid']
                    print str(premium)
                else:
                    premium = ''
                names = e['host']
                urls = e['url']
                menu_items = []
                #menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                kodi.addDir(
                    "[COLORteal][TwoMovies-TV][/COLOR] - " + names +
                    ' [COLOR gold]' + str(premium) + '[/COLOR]',
                    urls,
                    'tmlinkpage',
                    thumb,
                    movie_title,
                    total_items,
                    '',
                    name,
                    menu_items=menu_items,
                    is_playable='true',
                    fanart=fanart
                )  # MUST BE EPISODE NAME IN PLACE OF MEDIA TYPE HERE
        # AFDAH SCRAPE
        # TODO Add TV
        if kodi.get_setting('afdah') == "true":
            print "AFDAH TV not setup yet"

        # TODO Add Mer TV Scrapers
        if kodi.get_setting('merdb') == "true":
            print "MerDb TV Not Setup Yet"

        # TODO Add ZMovies TV Scrapers
        if kodi.get_setting('zmovies') == "true":
            print "ZMovies TV Not setup yet"

    except Exception as e:
        log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
        if kodi.get_setting('error_notify') == "true":
            kodi.notify(header='Scraper',
                        msg='(error) %s  %s' % (str(e), ''),
                        duration=5000,
                        sound=None)
コード例 #45
0
def find_sourceTV(name,thumb,media,movie_title):
    q1, q2, q3, q4, q5, q6, q7, q8 = Queue(), Queue(), Queue(),Queue(), Queue(), Queue(), Queue(), Queue()
    try:
        if thumb is None:
            thumb = ''
        else:
            thumb = thumb
        if kodi.get_setting('primewire') == "true":
                Thread(target=tv_wrapper, args=(primewire.primewire_tv, name,movie_title, q2)).start()


        # if kodi.get_setting('twomovies') == "true":
        #         Thread(target=tv_wrapper, args=(twomovies.tmovies_tv, name,movie_title, q3)).start()

        if kodi.get_setting('ice_films') == "true":
                t = Thread(target=tv_wrapper, args=(icefilms.ice_films_tv, name,movie_title, q8))
                t.daemon = True
                t.start()

        if kodi.get_setting('santa_tv') == "true":
                t = Thread(target=tv_wrapper, args=(santa_tv.santa_tv, name,movie_title, q1))
                t.daemon = True
                t.start()


        if kodi.get_setting('putlocker') == "true":
                t = Thread(target=tv_wrapper, args=(putlocker_both.putlocker_tv, name,movie_title, q4))
                t.daemon = True
                t.start()

        # GRAB RETURNS BELOW
        if kodi.get_setting('putlocker') == "true":
                try:
                    putlockersources = q4.get()
                    for e in putlockersources:
                        total_items =len(putlockersources)
                        if 'debrid' in e:
                            premium = e['debrid']#.replace('[','').replace(']','')
                            print str(premium)
                        else:
                            premium = ''
                        names = e['host']
                        urls = e['url']
                        #views = e['views']
                        #label = e['label']
                        if e['quality'] == None:
                            quals = 'unknown'
                        else:quals = e['quality']
                        menu_items=[]
                        menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                        kodi.addDir("[COLORteal][Putlocker][/COLOR] - "+names+' ['+quals+']  [COLOR gold]'+str(premium)+'[/COLOR]',urls,'get_tv_link',thumb,movie_title,total_items,'',name,menu_items=menu_items,is_playable='true',fanart=fanart)
                except Exception as e:
                    log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
                    if kodi.get_setting('error_notify') == "true":
                        kodi.notify(header='Putlocker',msg='(error) %s  %s' % (str(e), ''),duration=5000,sound=None)



        if kodi.get_setting('santa_tv') == "true":
                try:
                    santasources = q1.get()
                    for e in santasources:
                        total_items =len(santasources)
                        if 'debrid' in e:
                            premium = e['debrid']#.replace('[','').replace(']','')
                            print str(premium)
                        else:
                            premium = ''
                        names = e['host']
                        urls = e['url']
                        # urls = icefilms.resolve_link(urls)
                        #views = e['views']
                        label = e['label']
                        if e['quality'] == None:
                            quals = 'unknown'
                        else:quals = e['quality']
                        menu_items=[]
                        menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                        kodi.addDir("[COLORteal][SantaSeries][/COLOR] - "+names+' ['+quals+'] '+label+' [COLOR gold]'+str(premium)+'[/COLOR]',urls,'get_tv_link',thumb,movie_title,total_items,'',name,menu_items=menu_items,is_playable='true',fanart=fanart)
                except Exception as e:
                    log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
                    if kodi.get_setting('error_notify') == "true":
                        kodi.notify(header='SantaSeries',msg='(error) %s  %s' % (str(e), ''),duration=5000,sound=None)

        if kodi.get_setting('ice_films') == "true":
                try:
                    icesources = q8.get()
                    for e in icesources:
                        total_items =len(icesources)
                        if 'debrid' in e:
                            premium = e['debrid']#.replace('[','').replace(']','')
                            print str(premium)
                        else:
                            premium = ''
                        names = e['host']
                        urls = e['url']
                        urls = icefilms.resolve_link(urls)
                        views = e['views']
                        if e['quality'] == None:
                            quals = 'unknown'
                        else:quals = e['quality']
                        menu_items=[]
                        menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                        kodi.addDir("[COLORteal][IceFilms][/COLOR] - "+names+' ['+quals+']'+' [COLOR gold]'+str(premium)+'[/COLOR]',urls,'get_tv_link',thumb,movie_title,total_items,'',name,menu_items=menu_items,is_playable='true',fanart=fanart)
                except Exception as e:
                    log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
                    if kodi.get_setting('error_notify') == "true":
                        kodi.notify(header='Ice Films',msg='(error) %s  %s' % (str(e), ''),duration=5000,sound=None)


        if kodi.get_setting('primewire') == "true":
                primesources = q2.get()
                for e in primesources:
                        total_items =len(primesources)
                        if 'debrid' in e:
                            premium = e['debrid']
                            print str(premium)
                        else:
                            premium = ''
                        names = e['host']
                        urls = e['url']
                        views = e['view']
                        quals = e['quality']
                        menu_items=[]
                        menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                        kodi.addDir("[COLORteal][Primewire][/COLOR] - "+names+' ['+quals+']'+' Views '+views+' [COLOR gold]'+str(premium)+'[/COLOR]',urls,'get_tv_link',thumb,movie_title,total_items,'',name,menu_items=menu_items,is_playable='true',fanart=fanart)

        # if kodi.get_setting('twomovies') == "true":
        #         tmsources = q3.get()
        #         for e in tmsources:
        #                 total_items =len(tmsources)
        #                 if 'debrid' in e:
        #                     premium = e['debrid']
        #                     print str(premium)
        #                 else:
        #                     premium = ''
        #                 names = e['host']
        #                 urls = e['url']
        #                 menu_items=[]
        #                 menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
        #                 kodi.addDir("[COLORteal][TwoMovies-TV][/COLOR] - "+names+' [COLOR gold]'+str(premium)+'[/COLOR]',urls,'tmlinkpage',thumb,movie_title,total_items,'',name,menu_items=menu_items,is_playable='true',fanart=fanart)# MUST BE EPISODE NAME IN PLACE OF MEDIA TYPE HERE
        # # AFDAH SCRAPE
        # TODO Add TV
        if kodi.get_setting('afdah') == "true":
            print "AFDAH TV not setup yet"

        # TODO Add Mer TV Scrapers
        if kodi.get_setting('merdb') == "true":
            print "MerDb TV Not Setup Yet"


        # TODO Add ZMovies TV Scrapers
        if kodi.get_setting('zmovies') == "true":
            print "ZMovies TV Not setup yet"

    except Exception as e:
            log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
            if kodi.get_setting('error_notify') == "true":
                kodi.notify(header='Scraper',msg='(error) %s  %s' % (str(e), ''),duration=5000,sound=None)
コード例 #46
0
def main_menu():

    ###########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('Serve  Aiuto?', 'https://t.me/steaddon',
                                      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

    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(
        "Manutenzione 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.addDir("Informazioni Sistema",
                '',
                '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 Stefano notifications!")
    if kodi.get_setting('notifications-on-startup') == 'true':
        kodi.addItem(
            "Notifications (Opt In)",
            '',
            'disable_notify',
            artwork + 'notification_in.png',
            description="Subscribe to important Stefano notifications!")

    viewsetter.set_view("sets")
コード例 #47
0
def find_source(name,thumb,media,movie_title):

    try:
        q1, q2, q3, q4, q5, q6, q7, q8, q9 = Queue(), Queue(), Queue(),Queue(), Queue(), Queue(), Queue(), Queue(),Queue()

        if thumb is None:
            thumb = ''
        else:
            thumb = thumb
        if media == 'shows':
            find_sourceTV(name,thumb,media,movie_title)
        else:
            if kodi.get_setting('9movies') == "true":
                movie_title = name
                t = Thread(target=wrapper, args=(nine_movies.ninemovies, name, q1))
                t.daemon = True
                t.start()

            if kodi.get_setting('primewire') == "true":
                movie_title = name
                Thread(target=wrapper, args=(primewire.primewire, name, q2)).start()

            # if kodi.get_setting('twomovies') == "true":
            #     movie_title = name
            #     Thread(target=wrapper, args=(twomovies.tmovies, name, q3)).start()

            if kodi.get_setting('afdah') =='true':
                movie_title = name
                Thread(target=wrapper, args=(afdah.afdah, name, q4)).start()

            if kodi.get_setting('merdb') == "true":
                movie_title = name
                Thread(target=wrapper, args=(merdb.merdb, name, q5)).start()

            if kodi.get_setting('zmovies') == "true":
                movie_title = name
                Thread(target=wrapper, args=(zmovies.zmovies, name, q6)).start()

            if kodi.get_setting('123movies') == "true":
                movie_title = name
                Thread(target=wrapper, args=(zmovies.zmovies, name, q7)).start()


            if kodi.get_setting('ice_films') == "true":
                movie_title = name
                t = Thread(target=wrapper, args=(icefilms.ice_films, name, q8))
                t.daemon = True
                t.start()


            if kodi.get_setting('putlocker') == "true":
                movie_title = name
                t = Thread(target=wrapper, args=(putlocker_both.putlocker_movies, name, q9))
                t.daemon = True
                t.start()
######Grab Results




            if kodi.get_setting('ice_films') == "true":
                try:
                    icesources = q8.get()
                    for e in icesources:
                        total_items =len(icesources)
                        if 'debrid' in e:
                            premium = e['debrid']
                        else:
                            premium = ''
                        names = e['host']
                        urls = e['url']
                        urls = icefilms.resolve_link(urls)
                        views = e['views']
                        if e['quality'] == None:
                            quals = 'unknown'
                        else:quals = e['quality']
                        menu_items=[]
                        menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                        kodi.addDir("[COLORteal][IceFilms][/COLOR] - "+names+' ['+quals+']'+' [COLOR gold]'+str(premium)+'[/COLOR]',urls,'get_link',thumb,movie_title,total_items,'','movies',menu_items=menu_items,is_playable='true',fanart=fanart)
                except Exception as e:
                    log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
                    if kodi.get_setting('error_notify') == "true":
                        kodi.notify(header='IceFilms',msg='(error) %s  %s' % (str(e), ''),duration=5000,sound=None)

            if kodi.get_setting('putlocker') == "true":
                try:
                    putlockersources = q9.get()
                    for e in putlockersources:
                        total_items =len(putlockersources)
                        if 'debrid' in e:
                            premium = e['debrid']
                        else:
                            premium = ''
                        names = e['host']
                        urls = e['url']
                        views = e['views']
                        if e['quality'] == None:
                            quals = 'unknown'
                        else:quals = e['quality']
                        menu_items=[]
                        menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                        kodi.addDir("[COLORteal][Putlocker][/COLOR] - "+names+' ['+quals+']'+' [COLOR gold]'+str(premium)+'[/COLOR]',urls,'get_link',thumb,movie_title,total_items,'','movies',menu_items=menu_items,is_playable='true',fanart=fanart)
                except Exception as e:
                    log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
                    if kodi.get_setting('error_notify') == "true":
                        kodi.notify(header='Putlocker',msg='(error) %s  %s' % (str(e), ''),duration=5000,sound=None)


            if kodi.get_setting('9movies') == "true":
                try:
                    ninesources = q1.get()
                    for e in ninesources:
                        total_items =len(ninesources)
                        if 'debrid' in e:
                            premium = e['debrid']
                        else:
                            premium = ''
                        names = e['host']
                        urls = e['url']
                        views = e['view']
                        quals = e['quality']
                        menu_items=[]
                        menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                        kodi.addDir("[COLORteal][9Movies][/COLOR] - "+names+' ['+quals+']'+' [COLOR gold]'+str(premium)+'[/COLOR]',urls,'get_link',thumb,movie_title,total_items,'','movies',menu_items=menu_items,is_playable='true',fanart=fanart)
                except Exception as e:
                    log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
                    if kodi.get_setting('error_notify') == "true":
                        kodi.notify(header='9Movies',msg='(error) %s  %s' % (str(e), ''),duration=5000,sound=None)

            if kodi.get_setting('123movies') == "true":
                try:
                    ottsources = q7.get()
                    for e in ottsources:
                        total_items =len(ottsources)
                        if 'debrid' in e:
                            premium = e['debrid']
                        else:
                            premium = ''
                        names = e['host']
                        urls = e['url']
                        try:
                            quals = e['quality']
                        except: quals = 'unknown'
                        menu_items=[]
                        menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                        kodi.addDir("[COLORteal][123Movies][/COLOR] - "+names+' ['+quals+']'+' [COLOR gold]'+str(premium)+'[/COLOR]',urls,'get_link',thumb,movie_title,total_items,'','movies',menu_items=menu_items,is_playable='true',fanart=fanart)
                except Exception as e:
                    log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
                    if kodi.get_setting('error_notify') == "true":
                        kodi.notify(header='123Movies',msg='(error) %s  %s' % (str(e), ''),duration=5000,sound=None)


            if kodi.get_setting('primewire') == "true":
                primesources = q2.get()
                for e in primesources:
                    total_items =len(primesources)
                    #START RD CHECK
                    if 'debrid' in e:
                        premium = e['debrid']
                    else:
                        premium = ''
                    names = e['host']
                    urls = e['url']
                    views = e['view']
                    quals = e['quality']
                    menu_items=[]
                    menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb,'media':media,'movie_title':movie_title})))
                    kodi.addDir("[COLORteal][Primewire][/COLOR] - "+names+' ['+quals+']'+' Views '+views+' [COLOR gold]'+str(premium)+'[/COLOR]',urls,'get_link',thumb,movie_title,total_items,'','movies',menu_items=menu_items,is_playable='true',fanart=fanart)

            # if kodi.get_setting('twomovies') == "true":
            #     tmsources = q3.get()
            #     for e in tmsources:
            #         total_items =len(tmsources)
            #         if 'debrid' in e:
            #             premium = e['debrid']
            #         else:
            #             premium = ''
            #         names = e['host']
            #         #END RD Check
            #         urls = e['url']
            #         menu_items=[]
            #         menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
            #         kodi.addDir('[COLORteal][Two Movies][/COLOR] - '+names+' [COLOR gold]'+str(premium)+'[/COLOR]',urls,'tmlinkpage',thumb,movie_title,total_items,'','movies',menu_items=menu_items,is_playable='true',fanart=fanart)

            if kodi.get_setting('afdah') =='true':
                try:
                    afdahsources = q4.get()
                    for e in afdahsources:
                            total_items =len(afdahsources)
                            if 'debrid' in e:
                                premium = e['debrid']
                            else:
                                premium = ''
                            names = e['host']
                            urls = e['url']
                            quals = e['quality']
                            menu_items=[]
                            menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                            kodi.addDir('[COLORteal][AFDAH][/COLOR] - '+names+' ['+quals+']'+' [COLOR gold]'+str(premium)+'[/COLOR]',urls,'get_link',thumb,movie_title,total_items,'','movies',menu_items=menu_items,is_playable='true',fanart=fanart)
                except Exception as e:
                    log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
                    if kodi.get_setting('error_notify') == "true":
                        kodi.notify(header='AFDAH',msg='(error) %s  %s' % (str(e), ''),duration=5000,sound=None)

            if kodi.get_setting('merdb') == "true":
                mersources = q5.get()
                for e in mersources:
                    total_items =len(mersources)
                    if 'debrid' in e:
                        premium = e['debrid']
                    else:
                        premium = ''
                    names = e['host']
                    urls = e['url']
                    menu_items=[]
                    menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                    kodi.addDir("[COLORteal][MerDB][/COLOR] - "+names+' [COLOR gold]'+str(premium)+'[/COLOR]',urls,'playmerdblink',thumb,movie_title,total_items,'','movies',menu_items=menu_items,is_playable='true',fanart=fanart)

            if kodi.get_setting('zmovies') == "true":
                zmoviesources =q6.get()
                for e in zmoviesources:
                    total_items =len(zmoviesources)
                    if 'debrid' in e:
                        premium = e['debrid']#.replace('[','').replace(']','')
                    else:
                        premium = ''
                    names = e['host']
                    urls = e['url']
                    menu_items=[]
                    menu_items.append(('[COLOR gold]Add to Downloads[/COLOR]',      'XBMC.Container.Update(%s)' % addon.build_plugin_url({'mode':'setup_download', 'name':name,'url':urls,'thumb':thumb, 'media':media,'movie_title':movie_title})))
                    kodi.addDir("[COLORteal][ZMovies][/COLOR] - "+names+' [COLOR gold]'+str(premium)+'[/COLOR]',urls,'playzmovieslink',thumb,movie_title,total_items,'','movies',menu_items=menu_items,is_playable='true',fanart=fanart)

    except Exception as e:
            log_utils.log('Error [%s]  %s' % (str(e), ''), xbmc.LOGERROR)
            if kodi.get_setting('error_notify') == "true":
                kodi.notify(header='Movie Scrapers',msg='(error) %s  %s' % (str(e), ''),duration=5000,sound=None)