addon.py 文件源码

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

项目:plugin.video.douyutv2 作者: yangqian 项目源码 文件源码
def router(paramstring):
    """
    Router function that calls other functions
    depending on the provided paramstring
    :param paramstring:
    :return:
    """
    # Parse a URL-encoded paramstring to the dictionary of
    # {<parameter>: <value>} elements
    params = dict(parse_qsl(paramstring))
    # Check the parameters passed to the plugin
    if 'action' in params:
        if params['action'] == 'listing':
            # Display the list of videos in a provided category.
            list_videos(params['category'],int(params['offset']))
        elif params['action'] == 'play':
            # Play a video from a provided URL.
            play_video(params['video'])
    else:
        # If the plugin is called from Kodi UI without any parameters,
        # display the list of video categories
        if 'offset' in params:
          list_categories(int(params['offset']))
        else:
          list_categories(0)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号