xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=False) elif mode == 'getrecording': stream_url = get_recording(url,date_title,date) liz = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') liz.setInfo(type='Video', infoLabels={'Title':title}) liz.setProperty("IsPlayable","true") liz.setPath(stream_url) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz) elif mode == "add_fav": favs = ADDON.getSetting('favs').split(",") if title in favs: ADDON_HELPER.show_small_popup("[COLOR white][B]Husahm.iptv[/B][/COLOR]", "Channel already in favorites.", image=".") else: favs.append(title) ADDON.setSetting('favs', ",".join(favs)) ADDON_HELPER.show_small_popup("[COLOR white][B]Husahm.iptv[/B][/COLOR]", "Channel added to favorites.", image=".") xbmc.executebuiltin('Container.Refresh') elif mode == "remove_fav": favs = ADDON.getSetting('favs').split(",") if title not in favs: ADDON_HELPER.show_small_popup("[COLOR white][B]Husahm.iptv[/B][/COLOR]", "Channel not in favorites.", image=".") else: favs.remove(title) ADDON.setSetting('favs', ",".join(favs)) ADDON_HELPER.show_small_popup("[COLOR white][B]Husahm.iptv[/B][/COLOR]", "Channel removed from favorites.", image=".") xbmc.executebuiltin('Container.Refresh')