コード例 #1
0
def m3uCategory(url, logos, cache, gListIndex=-1):	
	tmpList = []
	chList = common.m3u2list(url, cache)
	groupChannels = []
	for channel in chList:
		if makeGroups:
			matches = [groupChannels.index(x) for x in groupChannels if len(x) > 0 and x[0].get("group_title", x[0]["display_name"]) == channel.get("group_title", channel["display_name"])]
		if makeGroups and len(matches) == 1:
			groupChannels[matches[0]].append(channel)
		else:
			groupChannels.append([channel])
	for channels in groupChannels:
		idx = groupChannels.index(channels)
		if gListIndex > -1 and gListIndex != idx:
			continue
		isGroupChannel = gListIndex < 0 and len(channels) > 1
		chs = [channels[0]] if isGroupChannel else channels
		for channel in chs:
			name = common.GetEncodeString(channel["display_name"]) if not isGroupChannel else common.GetEncodeString(channel.get("group_title", channel["display_name"]))
			if isGroupChannel:
				name = '[{0}]'.format(name)
				chUrl = url
				image = ''
				AddDir(name ,url, 10, index=idx)
			else:
				chUrl = common.GetEncodeString(channel["url"])
				image = channel.get("tvg_logo", channel.get("logo", ""))
				if logos is not None and logos != ''  and image != "" and not image.startswith('http'):
					image = logos + image
				AddDir(name, chUrl, 3, image, index=-1, isFolder=False, IsPlayable=True)
			tmpList.append({"url": chUrl.decode("utf-8"), "image": image.decode("utf-8"), "name": name.decode("utf-8")})
	common.SaveList(tmpListFile, tmpList)
コード例 #2
0
def m3uCategory(url, logos):
    if isM3UDir(url):
        m3uDir(url, logos)
        return

    tmpList = []
    list = common.m3u2list(url)

    for channel in list:
        name = common.GetEncodeString(channel["display_name"])
        image = channel.get("tvg_logo", "")
        if image == "":
            image = channel.get("logo", "")
        if logos is not None and logos != '' and image is not None and image != '' and not image.startswith(
                'http'):
            image = logos + image
        url = common.GetEncodeString(channel["url"])
        AddDir(name, url, 3, image, isFolder=False)
        tmpList.append({
            "url": url.decode("utf-8"),
            "image": image.decode("utf-8"),
            "name": name.decode("utf-8")
        })

    common.SaveList(tmpListFile, tmpList)
コード例 #3
0
def PlxCategory(url, cache):
    tmpList = []
    chList = common.plx2list(url, cache)
    background = chList[0]["background"]
    for channel in chList[1:]:
        iconimage = "" if not channel.has_key(
            "thumb") else common.GetEncodeString(channel["thumb"])
        name = common.GetEncodeString(channel["name"])
        if channel["type"] == 'playlist':
            AddDir("[{0}]".format(name),
                   channel["url"],
                   1,
                   iconimage,
                   background=background)
        else:
            AddDir(name,
                   channel["url"],
                   3,
                   iconimage,
                   isFolder=False,
                   IsPlayable=True,
                   background=background)
            tmpList.append({
                "url": channel["url"],
                "image": iconimage,
                "name": name
            })

    common.SaveList(tmpListFile, tmpList)
コード例 #4
0
def PlxCategory(url):
    tmpList = []
    list = common.plx2list(url)
    background = list[0]["background"]
    for channel in list[1:]:
        iconimage = "" if not channel.has_key(
            "thumb") else common.GetEncodeString(channel["thumb"])
        name = common.GetEncodeString(channel["name"])
        if channel["type"] == 'playlist':
            AddDir("[COLOR blue][{0}][/COLOR]".format(name),
                   channel["url"].encode("utf-8"),
                   1,
                   iconimage,
                   background=background.encode("utf-8"))
        else:
            AddDir(name,
                   channel["url"].encode("utf-8"),
                   3,
                   iconimage,
                   isFolder=False,
                   background=background)
            tmpList.append({
                "url": channel["url"],
                "image": iconimage.decode("utf-8"),
                "name": name.decode("utf-8")
            })

    common.SaveList(tmpListFile, tmpList)
コード例 #5
0
def m3uCategory(url, logos, cache, gListIndex=-1): 
      
    meta = None
    '''
    meta_id = common.searchMetaTVDBId(url, playlistsFile)
    if not meta_id is None:
        if common.isScannedByTheTvDB(meta_id):
            meta = common.loadDataFromTheTvDB(meta_id)

    elif common.isScannedByTheMovieDB(gListIndex):
        meta = common.loadDataFromTheMovieDB(gListIndex)
    '''
    tmpList = []
    chList = common.m3u2list(url, cache)
    groupChannels = []
    
    for channel in chList:
        if makeGroups:
            matches = [groupChannels.index(x) for x in groupChannels if len(x) > 0 and x[0].get("group_title", x[0]["display_name"]) == channel.get("group_title", channel["display_name"])]
        
        if makeGroups and len(matches) == 1:
            groupChannels[matches[0]].append(channel)
        else:
            groupChannels.append([channel])
    
    
    for channels in groupChannels:
        idx = groupChannels.index(channels)
        if gListIndex > -1 and gListIndex != idx:
            continue
        isGroupChannel = gListIndex < 0 and len(channels) > 1
        chs = [channels[0]] if isGroupChannel else channels
        
        for channel in chs:
            name = common.GetEncodeString(channel["display_name"]) if not isGroupChannel else common.GetEncodeString(channel.get("group_title", channel["display_name"]))
            plot = "" if meta is None else meta[channel["group_title"]]["overview"] if channel["group_title"] in meta else ""
            fanart = "" if meta is None else meta[channel["group_title"]]["fanarts"][0] if (channel["group_title"] in meta and len(meta[channel["group_title"]]["fanarts"]) > 0) else ""

            if isGroupChannel:
                name = '{0}'.format(name)
                chUrl = url
                try:
                    image = channel['tvg_logo'] if meta is None else meta[channel["group_title"]]["poster"] if channel["group_title"] in meta else channel['tvg_logo']
                except KeyError:
                    image = "DefaultTVShows.png"
                AddDir(name ,url, 10, index=idx, iconimage=image, plot=plot, fanart=fanart)
            else:
                chUrl = common.GetEncodeString(channel["url"])
                image = channel.get("tvg_logo", channel.get("logo", ""))
                if logos is not None and logos != ''  and image != "" and not image.startswith('http'):
                    image = logos + image
                AddDir(name, chUrl, 3, image, index=-1, isFolder=False, IsPlayable=True, plot=plot, fanart=fanart)
            tmpList.append({"url": chUrl.decode("utf-8"), "image": image.decode("utf-8"), "name": name.decode("utf-8")})
    
    common.SaveList(tmpListFile, tmpList)
コード例 #6
0
ファイル: default.py プロジェクト: mak-iptv/sat-albaniarepo
def Categories():
    cacheList = []
    i = 0
    chList = common.ReadList(playlistsFile)
    for item in chList:
        mode = 1 if '.plx' in item["url"][::-1].decode('base64').replace(
            "83eT", "Ppbi").replace("5ePP", "0ZWJ").decode('base64').replace(
                "7RnT", "6Fqn") else 2
        name = common.GetEncodeString(item["name"])
        image = item.get('image', '')
        logos = item.get('logos', '')
        cacheMin = item.get('cache', '0')
        if item["url"][::-1].decode('base64').replace("83eT", "Ppbi").replace(
                "5ePP",
                "0ZWJ").decode('base64').replace("7RnT",
                                                 "6Fqn").startswith('http'):
            cacheList.append(
                hashlib.md5(item["url"][::-1].decode('base64').replace(
                    "83eT",
                    "Ppbi").replace("5ePP", "0ZWJ").decode('base64').replace(
                        "7RnT", "6Fqn").encode("utf-8")).hexdigest())
        m3uCategory(
            item["url"][::-1].decode('base64').replace("83eT", "Ppbi").replace(
                "5ePP",
                "0ZWJ").decode('base64').replace("7RnT",
                                                 "6Fqn").encode("utf-8"),
            logos.encode("utf-8"), cacheMin, index)
        i += 1
    for the_file in os.listdir(cacheDir):
        file_path = os.path.join(cacheDir, the_file)
        try:
            if os.path.isfile(file_path) and the_file not in cacheList:
                os.unlink(file_path)
        except Exception as ex:
            xbmc.log("{0}".format(ex), 3)
コード例 #7
0
def Categories():
    AddDir("[COLOR yellow][B]{0}[/B][/COLOR]".format(getLocaleString(10001)),
           "settings",
           20,
           os.path.join(iconsDir, "NewList.ico"),
           isFolder=False)
    AddDir("[COLOR white][B][{0}][/B][/COLOR]".format(getLocaleString(10003)),
           "favorites", 30, os.path.join(iconsDir, "bright_yellow_star.png"))
    cacheList = []
    i = 0
    list = common.ReadList(playlistsFile)
    for item in list:
        mode = 1 if '.plx' in item["url"] else 2
        name = common.GetEncodeString(item["name"])
        image = item.get('image', '')
        logos = item.get('logos', '')
        cacheMin = item.get('cache', '0')
        if item["url"].startswith('http'):
            cacheList.append(
                hashlib.md5(item["url"].encode("utf-8")).hexdigest())
        AddDir("[COLOR blue][{0}][/COLOR]".format(name),
               item["url"].encode("utf-8"),
               mode,
               image.encode("utf-8"),
               logos.encode("utf-8"),
               index=i,
               cacheMin=cacheMin)
        i += 1
    for the_file in os.listdir(cacheDir):
        file_path = os.path.join(cacheDir, the_file)
        try:
            if os.path.isfile(file_path) and the_file not in cacheList:
                os.unlink(file_path)
        except Exception as ex:
            xbmc.log("{0}".format(ex), 3)
コード例 #8
0
def AddListItems(chList, addToVdir=True):
        
    cacheList = []
    i = 0

    for item in chList:
        mode = 1 if '.plx' in item["url"] else 2
        name = common.GetEncodeString(item["name"])
        
        image = item.get('image', '')
        uuid4 = item["uuid"]
        
        if image.encode("utf-8") is "" or image is None:
            image = os.path.join(iconsDir, "default-list-image.png")
        
        logos = item.get('logos', '')
        cacheMin = item.get('cache', '0')
        if item["url"].startswith('http'):
            cacheList.append(hashlib.md5(item["url"].encode("utf-8")).hexdigest())
        AddDir("[{0}]".format(name) ,item["url"].encode("utf-8"), mode, image.encode("utf-8"), logos.encode("utf-8"), index=i, uuid=uuid4.encode("utf-8"), cacheMin=cacheMin, addToVdir=addToVdir)
        i += 1

    for the_file in os.listdir(cacheDir):
        file_path = os.path.join(cacheDir, the_file)
        try:
            if os.path.isfile(file_path) and the_file not in cacheList:
                os.unlink(file_path)
        except Exception as ex:
            xbmc.log("{0}".format(ex), 3)
コード例 #9
0
def Categories():
    AddDir("[COLOR yellow][B]{0}[/B][/COLOR]".format(getLocaleString(10001)),
           "settings",
           20,
           os.path.join(addonDir, "resources", "images", "NewList.ico"),
           isFolder=False)
    AddDir(
        "[COLOR white][B][{0}][/B][/COLOR]".format(getLocaleString(10003)),
        "favorites", 30,
        os.path.join(addonDir, "resources", "images",
                     "bright_yellow_star.png"))

    i = 0
    list = common.ReadList(playlistsFile)
    for item in list:
        mode = 1 if item["url"].find(".plx") > 0 else 2
        name = common.GetEncodeString(item["name"])
        image = item.get('image', '')
        if mode == 1:
            logos = ''
        else:
            logos = item.get('logos', '')
        AddDir("[COLOR blue][{0}][/COLOR]".format(name),
               item["url"].encode("utf-8"),
               mode,
               image.encode("utf-8"),
               logos.encode("utf-8"),
               index=i)
        i += 1
コード例 #10
0
ファイル: default.py プロジェクト: send2moran/ronos-repo
def Categories():
	repoCheck.UpdateRepo()
	playlistDictionary = {
	#'ronos-Not updated' : 'http://tiny.cc/ronosiptv',
	#'prozone - Not Working': 'http://prozone.getxbmc.com/playlists',
	#'KodiSport - Need To Check': 'http://tiny.cc/kodisport',
	'All (Jordan)': 'http://ij0rd8n.x10host.com',
	'All (micky)': 'http://lvtvv.com/htf.m3u',
	'Idan+ (TheWiz)': 'http://iptv.thewiz.info/idan.m3u',
	'proTV (+sport5HD)': 'http://sportisraelprotv.site90.com/protvisrael.m3u'}
	
	
	list = common.ReadList(playlistsFile)
	
	for listName, listUrl in playlistDictionary.iteritems():
		isAlreadyExist = False
		for item in list:
			if item["url"].lower() == listUrl.lower():
				isAlreadyExist = True
				break
		if not isAlreadyExist:
			list.append({"name": listName.decode("utf-8"), "url": listUrl})
	
	for item in list:
		mode = 1 if item["url"].find(".plx") > 0 else 2
		name = common.GetEncodeString(item["name"])
		AddDir("{0}".format(name) ,item["url"], mode, "")
	
	AddDir("[COLOR yellow][{0}][/COLOR]".format(localizedString(10001).encode('utf-8')), "settings" , 20, os.path.join(addonDir, "resources", "images", "NewList.ico"), isFolder=False)
	AddDir("[COLOR yellow][{0}][/COLOR]".format(localizedString(10003).encode('utf-8')), "favorites" ,30 ,os.path.join(addonDir, "resources", "images", "bright_yellow_star.png"))
コード例 #11
0
def Categories():
    Playdp = str(len(PlaylistUrl))
    url = base64.decodestring(localisedTranslate)
    AddDir("[COLOR white][B] CLICK HERE TO UPDATE AAA STREAM[/B][/COLOR]",
           "Update", 50,
           os.path.join(addonDir, "resources", "images", "update-icon.png"))
    AddDir(
        "[COLOR white][B] YOUR FAVOURITE CHANNELS HERE[/B][/COLOR]",
        "favorites", 30,
        os.path.join(
            "http://www.iconarchive.com/download/i6066/custom-icon-design/pretty-office-3/add-to-favorites.ico"
        ))
    AddDir("[COLOR yellow][B] AAASTREAM MOVIES[/B][/COLOR]", 'movies', 44,
           "http://s5.postimg.org/ycy0pxt9j/appmovies.jpg")
    AddDir("[COLOR yellow][B] AAASTREAM TV SHOWS[/B] (SOON)[/COLOR]", 'TV', 0,
           "http://s5.postimg.org/ycy0pxt9j/appmovies.jpg")
    AddDir("[COLOR yellow]This is Version 1.9.1[/COLOR]", "Update", 99,
           "http://s5.postimg.org/9469649rb/appgraphic.jpg")

    playlistsFile = os.path.join(addonDir, "playLists.txt")
    DownloaderClass(url, playlistsFile)

    list = common.ReadList(playlistsFile)
    for item in list:
        mode = int(Playdp) + 26 if item["url"].find("youtube") > 0 else 2
        name = common.GetEncodeString(item["name"])
        AddDir("[COLOR blue]{0}[/COLOR]".format(name), item["url"], mode,
               "http://s5.postimg.org/9469649rb/appgraphic.jpg")
コード例 #12
0
def Categories():
#	repoCheck.UpdateRepo()
	
	list = common.ReadList(playlistsFile)
	for item in list:
		mode = 1 if item["url"].find(".plx") > 0 else 2
		name = common.GetEncodeString(item["name"])
		AddDir("[COLOR blue][{0}][/COLOR]".format(name) ,item["url"], mode, "")
コード例 #13
0
ファイル: default.py プロジェクト: yosrihadi/xbmc-pal
def ListLive(name, iconimage=None):
    list = []
    list1 = common.GetListFromPlx(filterCat=name)
    listIndex = 0
    for item_data in list1:
        url = item_data['url']
        image = item_data['image']
        description = ""
        channelName = common.GetEncodeString(item_data['name'])
        background = None
        isTvGuide = False

        if item_data["type"] == 'video' or item_data["type"] == 'audio':
            if url.find(AddonID) > 0:
                itemMode = re.compile('url=([0-9]*).*?mode=([0-9]*).*?$',
                                      re.I + re.M + re.U + re.S).findall(url)
                if len(itemMode) > 0 and itemMode[0] != '':
                    mode = int(itemMode[0][1])
                if mode == 1:
                    mode = 3
            elif url.find('?mode=3') > 0 and not useIPTV:
                continue
            else:
                mode = 10

            displayName, description, background, isTvGuide = GetProgrammeDetails(
                channelName)

        elif item_data["type"] == 'playlist':
            mode = 2
            displayName = "[COLOR {0}][B][{1}][/B][/COLOR]".format(
                Addon.getSetting("catColor"), channelName)
            background = image
        else:
            continue

        if background is None or background == "":
            background = iconimage
        addDir(displayName,
               url,
               mode,
               image,
               description,
               channelName=channelName,
               background=background,
               isTvGuide=isTvGuide,
               listIndex=listIndex)
        list.append({
            "url": url,
            "image": image,
            "name": channelName.decode("utf-8"),
            "type": item_data["type"]
        })
        listIndex += 1

    common.WriteList(tmpList, list)
    SetViewMode()
コード例 #14
0
ファイル: baksy.py プロジェクト: TheWardoctor/Baksy
def PlayUrl(name, url, iconimage=None):
        _NAME_=name
        list = common.m3u2list(ServerURL)
        for channel in list:
            name = common.GetEncodeString(channel["display_name"])
            stream=channel["url"]
            if _NAME_ in name:
                listitem = xbmcgui.ListItem(path=stream, thumbnailImage=iconimage)
                listitem.setInfo(type="Video", infoLabels={ "Title": name })
                xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem)				
コード例 #15
0
ファイル: default.py プロジェクト: send2moran/ronos-repo
def m3uCategory(url):	
	tmpList = []
	list = common.m3u2list(url)

	for channel in list:
		name = common.GetEncodeString(channel["display_name"])
		AddDir(name ,channel["url"], 3, "", isFolder=False)
		tmpList.append({"url": channel["url"], "image": "", "name": name.decode("utf-8")})

	common.SaveList(tmpListFile, tmpList)
コード例 #16
0
def Categories():
#	repoCheck.UpdateRepo()
	AddDir("[COLOR yellow][B]{0}[/B][/COLOR]".format(localizedString(10001).encode('utf-8')), "settings" , 20, os.path.join(addonDir, "resources", "images", "NewList.ico"), isFolder=False)
	AddDir("[COLOR white][B][{0}][/B][/COLOR]".format(localizedString(10003).encode('utf-8')), "favorites" ,30 ,os.path.join(addonDir, "resources", "images", "bright_yellow_star.png"))
	
	list = common.ReadList(playlistsFile)
	for item in list:
		mode = 1 if item["url"].find(".plx") > 0 else 2
		name = common.GetEncodeString(item["name"])
		AddDir("[COLOR blue][{0}][/COLOR]".format(name) ,item["url"], mode, "")
コード例 #17
0
ファイル: default.py プロジェクト: saladino85/HALOW-LIVE-TV
def Categories():
    #	repoCheck.UpdateRepo()
    AddDir(
        "[COLOR red][B]HALOW TV FREE [/B][/COLOR]", "Update", 99,
        "http://images.clipartpanda.com/arrow-20clip-20art-arrows_green_red.png"
    )
    list = common.ReadList(playlistsFile)
    for item in list:
        mode = 1 if item["url"].find(".plx") > 0 else 2
        name = common.GetEncodeString(item["name"])
        AddDir("[COLOR red][{0}][/COLOR]".format(name), item["url"], mode,
               "http://i.ytimg.com/vi/yE4Jxq-3SrM/hqdefault.jpg")
コード例 #18
0
def Categories():
    TodaysDate = str(time.strftime('%d/%a/%Y'))
    AddDir(
        "[COLOR white][B][{0}][/B][/COLOR]".format(
            localizedString(10018).encode('utf-8')), "Update", 30,
        os.path.join(addonDir, "resources", "images", "update-icon.png"))
    url = "http://kodi.xyz/direct.php"
    playlistsFile = os.path.join(addonDir, "playLists.txt")
    DownloaderClass(url, playlistsFile)

    list = common.ReadList(playlistsFile)
    for item in list:
        mode = 1 if item["url"].find(".plx") > 0 else 2
        name = common.GetEncodeString(item["name"])
        AddDir("[COLOR blue]{0}[/COLOR]".format(name), item["url"], mode, "")
コード例 #19
0
def m3uCategory(url):
    tmpList = []
    list = common.m3u2list(url)

    for channel in list:
        name = common.GetEncodeString(channel["display_name"])
        mode = LibCommon + 26 if channel["url"].find("youtube") > 0 else 3
        AddDir(name, channel["url"], mode, "", isFolder=False)
        tmpList.append({
            "url": channel["url"],
            "image": "",
            "name": name.decode("utf-8")
        })

    common.SaveList(tmpListFile, tmpList)
コード例 #20
0
def Categories(url):
    i = 0
    urllib.urlretrieve(url, tmpPlayList)
    list = common.ReadList(tmpPlayList)
    for item in list:
        mode = 1 if item["url"].find(".plx") > 0 else 2
        name = common.GetEncodeString(item["name"])
        image = item.get('image', '')
        if mode == 1:
            logos = ''
        else:
            logos = item.get('logos', '')
        AddDir("[COLOR gold][{0}][/COLOR]".format(name),
               item["url"].encode("utf-8"),
               mode,
               image.encode("utf-8"),
               logos.encode("utf-8"),
               index=i)
        i += 1

    AddDir("Reset Cache", "".format(sys.argv[0]), 4, image, isFolder=True)
コード例 #21
0
ファイル: baksy.py プロジェクト: TheWardoctor/Baksy
def Buildlist(url):
    list = common.m3u2list(url)
    for channel in list:
        name = common.GetEncodeString(channel["display_name"])
        AddDir(name ,channel["url"], 3, iconimage, isFolder=False)
コード例 #22
0
def ListLive(name, iconimage=None):
    list = []
    list1 = common.GetListFromPlx(filterCat=name)
    for item_data in list1:
        url = item_data['url']
        image = item_data['image']
        description = ""
        channelName = common.GetEncodeString(item_data['name'])
        background = None
        isTvGuide = False

        if item_data["type"] == 'video' or item_data["type"] == 'audio':
            channelName = "[COLOR yellow][B]{0}[/B][/COLOR]".format(
                channelName)
            displayName = channelName
            chNum = None
            filmon = False

            if url.find('plugin.video.israelive') > 0:
                itemMode = re.compile('url=([0-9]*).*?mode=([0-9]*)(.*?)$',
                                      re.I + re.M + re.U + re.S).findall(url)
                if len(itemMode) > 0 and itemMode[0] != '':
                    mode = int(itemMode[0][1])
                if mode == 1:
                    mode = 3
                    chNum = itemMode[0][0]
                    if itemMode[0][2] != "&ignorefilmonguide=1":
                        filmon = True
            elif url.find('plugin.video.f4mTester') > 0:
                mode = 12
            elif url.find('?mode=2') > 0:
                mode = 14
                #url = url[:url.find('?mode')]
            else:
                mode = 10

            displayName, description, background, isTvGuide = GetProgrammeDetails(
                channelName, chNum, filmon=filmon)

        elif item_data["type"] == 'playlist':
            mode = 2
            displayName = "[COLOR blue][B][{0}][/B][/COLOR]".format(
                channelName)
            background = image
        else:
            continue

        if background is None or background == "":
            background = iconimage
        addDir(displayName,
               url,
               mode,
               image,
               description,
               channelName=channelName,
               background=background,
               isTvGuide=isTvGuide)
        list.append({
            "url": url,
            "image": image,
            "name": channelName.decode("utf-8"),
            "type": item_data["type"]
        })

    common.WriteList(tmpList, list)
    SetViewMode()
コード例 #23
0
def m3uCategory(url, logos, epg, cache, mode, gListIndex=-1): 
      
    meta = None
    '''
    meta_id = common.searchMetaTVDBId(url, playlistsFile)
    if not meta_id is None:
        if common.isScannedByTheTvDB(meta_id):
            meta = common.loadDataFromTheTvDB(meta_id)

    elif common.isScannedByTheMovieDB(gListIndex):
        meta = common.loadDataFromTheMovieDB(gListIndex)
    '''
    tmpList = []
    chList = common.m3u2list(url, cache)
    if mode == 10 and epg != None and epg != '':
      epgDict = common.epg2dict(epg, cache=720)
      dnow = datetime.now(tz.UTC)
      to_zone = tz.tzlocal()
      use_percent = 'true'
      use_time = 'true'
    else: epgDict = {}
    
    #xbmc.log('EPGDICT')
    #xbmc.log(str(epgDict))
    groupChannels = []
    
    for channel in chList:
        if makeGroups:
            matches = [groupChannels.index(x) for x in groupChannels if len(x) > 0 and x[0].get("group_title", x[0]["display_name"]) == channel.get("group_title", channel["display_name"])]
        
        if makeGroups and len(matches) == 1:
            groupChannels[matches[0]].append(channel)
        else:
            groupChannels.append([channel])
    
    
    for channels in groupChannels:
        idx = groupChannels.index(channels)
        if gListIndex > -1 and gListIndex != idx:
            continue
        isGroupChannel = gListIndex < 0 and len(channels) > 1
        chs = [channels[0]] if isGroupChannel else channels
        
        #xbmc.log(str(epgDict.get(u'name')))
        for channel in chs:
            name = common.GetEncodeString(channel["display_name"]) if not isGroupChannel else common.GetEncodeString(channel.get("group_title", channel["display_name"]))
            plot = "" if meta is None else meta[channel["group_title"]]["overview"] if channel["group_title"] in meta else ""
            fanart = "" if meta is None else meta[channel["group_title"]]["fanarts"][0] if (channel["group_title"] in meta and len(meta[channel["group_title"]]["fanarts"]) > 0) else ""

            if isGroupChannel:
                name = '{0}'.format(name)
                chUrl = url
                try:
                    image = channel['tvg_logo'] if meta is None else meta[channel["group_title"]]["poster"] if channel["group_title"] in meta else channel['tvg_logo']
                except KeyError:
                    image = "DefaultTVShows.png"
                AddDir(name ,url, 10, epg=epg, index=idx, iconimage=image, cacheMin=cache, plot=plot, fanart=fanart)
            else:
                chUrl = common.GetEncodeString(channel["url"])
                image = channel.get("tvg_logo", channel.get("logo", ""))
                '''
                if image == "" and epgDict:
                    if name.decode('utf-8') in epgDict.get(u'name'):
                        image = epgDict[u'data'][epgDict[u'name'].index(name.decode('utf-8'))][1]
                    if name in epgDict.get(u'name'):
                        image = epgDict[u'data'][epgDict[u'name'].index(name)][1]
'''
                if epgDict:
                    idx = None
                    id = None
                    if epgDict.get(u'name'):
                        if name.decode('utf-8') in epgDict.get(u'name'):
                            idx = epgDict[u'name'].index(name.decode('utf-8'))
                        elif name in epgDict.get(u'name'):
                            idx = epgDict[u'name'].index(name)
                        if image == "" and idx is not None:
                                image = epgDict[u'data'][idx][1]
                                
                        t2len = 0
                        title2nd = ''
                        edescr = ''
                        next = False

                        if idx is not None:
                            #xbmc.log(str( epgDict.get('prg').get(epgDict[u'data'][idx][0])))
                            if epgDict.get('prg').get(epgDict[u'data'][idx][0]):
                                for start,stop,title in epgDict.get('prg').get(epgDict[u'data'][idx][0]):
                                    stime = parser.parse(start)
                                    etime = parser.parse(stop)
                                    if stime <= dnow <= etime or next:
                                        ebgn = stime.astimezone(to_zone).strftime('%H:%M')
                                        eend = etime.astimezone(to_zone).strftime('%H:%M')
                                        if use_time == 'true':
                                            stmp = '%s-%s' % (ebgn, eend)
                                            t2len += (len(stmp) + 1) 
                                            if not next: title2nd += ' [COLOR FF00BB66]%s[/COLOR]' % stmp
                                            else:  title2nd += ' %s' % stmp
                                        title2nd += ' %s' % title
                                        t2len += (len(title) + 1)
                                        
                                        title2nd = title2nd.replace('&quot;','`').replace('&amp;',' & ')
                                        if not t2len: t2len = len(name)
                                        if not next:
                                            plot += '[B][COLOR FF0084FF]%s-%s[/COLOR] [COLOR FFFFFFFF] %s[/COLOR][/B]' % (ebgn, eend, title)
                                            name = '[B]%s[/B]\n%s' % (name.ljust(int(t2len * 1.65)), title2nd.encode('utf-8'))
                                            next = True
                                        else: 
                                            plot += '[COLOR FF999999]\n\n%s-%s %s[/COLOR]\n' % (ebgn, eend, title) 
                                            next = False
                                            break
                                    elif dnow < stime and not next: 
                                        break
                                    

                
                if logos is not None and logos != ''  and image != "" and not image.startswith('http'):
                    image = logos + image
                AddDir(name, chUrl, 3, image, epg=epg, index=-1, isFolder=False, IsPlayable=True, plot=plot, fanart=fanart)
            tmpList.append({"url": chUrl.decode("utf-8"), "image": image.decode("utf-8"), "name": name.decode("utf-8")})
    
    common.SaveList(tmpListFile, tmpList)