share_url_parse_tool_wrapper
Extract video information from share links across 20+ platforms including TikTok and Kuaishou. Parses URLs to retrieve video details without watermarks.
Instructions
解析视频分享链接,获取视频信息
参数:
- url: 视频分享链接
返回:
- code: 状态码
- msg: 状态信息
- data: 视频信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes |
Implementation Reference
- yby6_video_mcp_server/server.py:21-31 (registration)Tool registration decorator with schema description for input (url: str) and output (Dict[str, Any] with code, msg, data)@mcp.tool( description=""" 解析视频分享链接,获取视频信息 参数: - url: 视频分享链接 返回: - code: 状态码 - msg: 状态信息 - data: 视频信息 """ )
- yby6_video_mcp_server/server.py:32-35 (handler)Thin wrapper handler that calls the core share_url_parse_tool implementationasync def share_url_parse_tool_wrapper(url: str) -> Dict[str, Any]: """解析视频分享链接,获取视频信息""" return await share_url_parse_tool(url)
- Core helper function implementing the parsing logic: validates input, extracts URL from text, calls parse_video_share_url, handles exceptions, returns standardized responseasync 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)}")