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)
评论列表
文章目录