addon.py 文件源码

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

项目:crossplatform_iptvplayer 作者: j00zek 项目源码 文件源码
def SelectHost():
    for host in HostsList:
            if ADDON.getSetting(host[0]) == 'true':
                hostName = host[1].replace("https:",'').replace("http:",'').replace("/",'').replace("www.",'')
                hostImage = '%s/icons/%s.png' % (ADDON.getSetting("kodiIPTVpath"), host[0])
                list_item = xbmcgui.ListItem(label = hostName)
                list_item.setArt({'thumb': hostImage,})
                list_item.setInfo('video', {'title': hostName, 'genre': hostName})
                url = get_url(action='startHost', host=host[0])
                myLog(url)
                is_folder = True
                # Add our item to the Kodi virtual folder listing.
                xbmcplugin.addDirectoryItem(ADDON_handle, url, list_item, is_folder)
    # Add a sort method for the virtual folder items (alphabetically, ignore articles)
    xbmcplugin.addSortMethod(ADDON_handle, xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE)
    # Finish creating a virtual folder.
    xbmcplugin.endOfDirectory(ADDON_handle)
    return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号