share_url_parse_tool_wrapper
Extract video information such as no-watermark links and metadata by parsing video share URLs from over 20 platforms, including TikTok and Kuaishou, using the Short Video MCP Server.
Instructions
解析视频分享链接,获取视频信息
参数:
- url: 视频分享链接
返回:
- code: 状态码
- msg: 状态信息
- data: 视频信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes |
Implementation Reference
- yby6_video_mcp_server/server.py:21-35 (handler)The MCP tool handler and registration for 'share_url_parse_tool_wrapper'. It wraps the core parsing logic by calling share_url_parse_tool.@mcp.tool( description=""" 解析视频分享链接,获取视频信息 参数: - url: 视频分享链接 返回: - code: 状态码 - msg: 状态信息 - data: 视频信息 """ ) async def share_url_parse_tool_wrapper(url: str) -> Dict[str, Any]: """解析视频分享链接,获取视频信息""" return await share_url_parse_tool(url)
- Core helper function share_url_parse_tool that implements the URL parsing logic, extracting video share URL and using parse_video_share_url to get video info.async def share_url_parse_tool(url: str) -> Dict[str, Any]: """解析视频分享链接,获取视频信息""" if not url or not isinstance(url, str): return create_error_response("URL参数无效") try: video_share_url = extract_url_from_text(url) if not video_share_url: return create_error_response("无法从输入文本中提取有效的URL") video_info = await parse_video_share_url(video_share_url) logger.info(f"成功解析视频URL: {video_share_url}") return create_success_response("解析成功", video_info.__dict__) except ValueError as err: logger.error(f"URL解析失败: {err}") return create_error_response(str(err)) except Exception as err: logger.error(f"未知错误: {err}") return create_error_response(f"解析失败: {str(err)}")