def list_streams(streams):
stream_list = []
# iterate over the contents of the dictionary songs to build the list
for stream in streams:
# create a list item using the stream's name for the label
li = xbmcgui.ListItem(label=stream['name'])
# set the thumbnail image
li.setArt({'thumb': stream['logo']})
# set the list item to playable
li.setProperty('IsPlayable', 'true')
# build the plugin url for Kodi
url = build_url({'mode': 'stream', 'url': stream['url'], 'title': stream['name']})
# add the current list item to a list
stream_list.append((url, li, False))
# add list to Kodi per Martijn
# http://forum.kodi.tv/showthread.php?tid=209948&pid=2094170#pid2094170
xbmcplugin.addDirectoryItems(addon_handle, stream_list, len(stream_list))
# set the content of the directory
xbmcplugin.setContent(addon_handle, 'songs')
xbmcplugin.endOfDirectory(addon_handle)
default.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录