def ShowItems(list_items, data, regex, title, label): if title == "": title = label label = "" # get show info info = re.compile(REGEX_ITEM_INFO, re.DOTALL + re.IGNORECASE + re.M).search(data) # get show thumb thumb = re.compile(REGEX_ITEM_THUMB, re.DOTALL + re.IGNORECASE + re.M).search(data) # get items results = re.compile(regex, re.DOTALL + re.IGNORECASE + re.M).findall(data) # specify thumb try: if thumb.group(1): thumbUri = thumb.group(1) except: thumbUri = "" # loop through items for result in results: list_item = mc.ListItem(mc.ListItem.MEDIA_VIDEO_CLIP) # set label list_item.SetLabel(str(uzgf.unescape(result[1]).encode("utf-8").replace("()", "(onbekende datum)"))) # set description list_item.SetDescription(str(uzgf.unescape(info.group(1).replace("\n", " ").strip()).encode("utf-8"))) # set thumb list_item.SetThumbnail(str(thumbUri.encode("utf-8"))) # set the path for doAction list_item.SetPath("feed://play/" + base64.b64encode(result[0], "_;")) list_item.SetProperty("title", title) list_item.SetProperty("subtitle", label) # add the item to the list items container list_items.append(list_item) # return it return list_items
def ShowItems(list_items, data, regex, title, label): if title == "": title = label label = "" # get show info info = re.compile(REGEX_ITEM_INFO, re.DOTALL + re.IGNORECASE + re.M).search(data) # get show thumb thumb = re.compile(REGEX_ITEM_THUMB, re.DOTALL + re.IGNORECASE + re.M).search(data) # get items results = re.compile(regex, re.DOTALL + re.IGNORECASE + re.M).findall(data) # specify thumb try: if thumb.group(1): thumbUri = thumb.group(1) except: thumbUri = '' # loop through items for result in results: list_item = mc.ListItem(mc.ListItem.MEDIA_VIDEO_CLIP) # set label list_item.SetLabel(str(uzgf.unescape(result[1]).encode('utf-8').replace("()", "(onbekende datum)"))) # set description list_item.SetDescription(str(uzgf.unescape(info.group(1).replace("\n", " ").strip()).encode('utf-8'))) # set thumb list_item.SetThumbnail(str(thumbUri.encode('utf-8'))) # set the path for doAction list_item.SetPath("feed://play/"+base64.b64encode(result[0], "_;")) list_item.SetProperty("title", title) list_item.SetProperty("subtitle", label) # add the item to the list items container list_items.append(list_item) # return it return list_items
def Shows(list_items, data, regex, title, subtitle): # Get show for zender results = re.compile(regex, re.DOTALL + re.IGNORECASE + re.M).findall(data) if len(results) > 0: for result in results: list_item = mc.ListItem(mc.ListItem.MEDIA_VIDEO_CLIP) # set everything in the list item list_item.SetProperty("title", title) list_item.SetProperty("subtitle", subtitle) list_item.SetLabel(str(uzgf.unescape(result[1]).encode("utf-8"))) list_item.SetDescription("Bekijk uitzendingen van " + str(uzgf.unescape(result[1]).encode("utf-8"))) # set the path for doAction list_item.SetPath("feed://shows/" + base64.b64encode(result[0], "_;")) # add the item to the list items container list_items.append(list_item) return list_items
def Shows(list_items, data, regex, title, subtitle): # Get show for zender results = re.compile(regex, re.DOTALL + re.IGNORECASE + re.M).findall(data) if len(results) > 0: for result in results: list_item = mc.ListItem(mc.ListItem.MEDIA_VIDEO_CLIP) # set everything in the list item list_item.SetProperty("title", title) list_item.SetProperty("subtitle", subtitle) list_item.SetLabel(str(uzgf.unescape(result[1]).encode('utf-8'))) list_item.SetDescription("Bekijk uitzendingen van " + str(uzgf.unescape(result[1]).encode('utf-8'))) # set the path for doAction list_item.SetPath("feed://shows/"+base64.b64encode(result[0], "_;")) # add the item to the list items container list_items.append(list_item) return list_items