main.py 文件源码

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

项目:YoutubeTV 作者: dude56987 项目源码 文件源码
def play_video(path):
    """
    Play a video by the provided path.

    :param path: str
    """
    # if the previous two if statements dont hit then the path is a
    # video path so modify the string and play it with the youtube plugin
    ###############
    # the path to let videos be played by the youtube plugin
    youtubePath='plugin://plugin.video.youtube/?action=play_video&videoid='
    # remove the full webaddress to make youtube plugin work correctly
    path=path.replace('https://youtube.com/watch?v=','')
    # also check for partial webaddresses we only need the video id
    path=path.replace('watch?v=','')
    # add youtube path to path to make videos play with the kodi youtube plugin
    path=youtubePath+path
    # Create a playable item with a path to play.
    play_item = xbmcgui.ListItem(path=path)
    # Pass the item to the Kodi player.
    xbmcplugin.setResolvedUrl(_handle, True, listitem=play_item)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号