plugin.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:plugin.video.skystreaming 作者: Ideneal 项目源码 文件源码
def list_channels():
    """show channels on the kodi list."""
    playlist = utility.read_list(playlists_file)

    if not playlist:
        ok(ADDON.getLocalizedString(11005), ADDON.getLocalizedString(11006))
        return None

    for channel in playlist:
        url = channel['url'].encode('utf-8')
        name = channel['display_name'].encode('utf-8')
        action_url = build_url({'mode': 'play', 'url': url, 'name': name})
        item = xbmcgui.ListItem(name, iconImage='DefaultVideo.png')
        item.setInfo(type='Video', infoLabels={'Title': name})
        xbmcplugin.addDirectoryItem(handle=HANDLE, url=action_url, listitem=item)

    xbmcplugin.endOfDirectory(HANDLE, cacheToDisc=False)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号