SnipHunter API

Resolve

媒体链接解析。

Base URL https://api.sniphunter.com

OpenAPI JSON · 完整 Markdown

请求与响应中的 $ref 在 OpenAPI 的 components 中定义。

1 个接口

Resolve

POST/api/v1/resolveResolve

统一内容解析接口 - 支持抖音/快手/小红书/B站/TikTok/YouTube 返回统一格式的数据结构,包含: - 基本信息:title, type, video_url, audio_url, cover_url, platform - 作者信息:author, author_id, author_avatar - 视频属性:duration, width, height - 统计数据:view_count, like_count, comment_count, share_count, collect_count - 发布时间:release_time

{
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ResolveRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "Successful Response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ResolveResponse"
          }
        }
      }
    },
    "422": {
      "description": "Validation Error",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/HTTPValidationError"
          }
        }
      }
    }
  }
}

数据模型

展开 components
{
  "schemas": {
    "HTTPValidationError": {
      "properties": {
        "detail": {
          "items": {
            "$ref": "#/components/schemas/ValidationError"
          },
          "type": "array",
          "title": "Detail"
        }
      },
      "type": "object",
      "title": "HTTPValidationError"
    },
    "MusicInfo": {
      "properties": {
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name",
          "description": "原声名称"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Title",
          "description": "原声标题(同 name)"
        },
        "author": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Author",
          "description": "原声作者"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Url",
          "description": "原声直链(多为 ies-music mp3)"
        },
        "cover": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cover",
          "description": "原声封面"
        },
        "avatar": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Avatar",
          "description": "原声作者头像"
        }
      },
      "type": "object",
      "title": "MusicInfo",
      "description": "原声/BGM 元数据"
    },
    "ResolveRequest": {
      "properties": {
        "url": {
          "type": "string",
          "title": "Url",
          "description": "视频/图文分享链接"
        }
      },
      "type": "object",
      "required": [
        "url"
      ],
      "title": "ResolveRequest",
      "description": "统一解析请求"
    },
    "ResolveResponse": {
      "properties": {
        "success": {
          "type": "boolean",
          "title": "Success",
          "description": "是否成功"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Title",
          "description": "标题"
        },
        "type": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "video",
                "audio",
                "image"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Type",
          "description": "内容类型"
        },
        "video_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Video Url",
          "description": "视频直链URL(可播优先)"
        },
        "audio_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Audio Url",
          "description": "作品原声/默认可播音频(抖音多为 ies-music mp3)"
        },
        "audio_track_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Audio Track Url",
          "description": "视频音轨直链(media-audio 等,供 ASR;可选)"
        },
        "bgm_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Bgm Url",
          "description": "人声分离后的伴奏直链;L0 解析不返回,需 extract_bgm"
        },
        "music": {
          "anyOf": [
            {
              "$ref": "#/components/schemas/MusicInfo"
            },
            {
              "type": "null"
            }
          ],
          "description": "原声元数据"
        },
        "cover_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cover Url",
          "description": "封面图URL"
        },
        "platform": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Platform",
          "description": "平台标识 (douyin/kuaishou/xiaohongshu/bilibili/tiktok/youtube)"
        },
        "work_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Work Type",
          "description": "作品类型 video/images"
        },
        "image_urls": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Image Urls",
          "description": "图文原图列表"
        },
        "author": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Author",
          "description": "作者昵称"
        },
        "author_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Author Id",
          "description": "作者ID"
        },
        "author_avatar": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Author Avatar",
          "description": "作者头像URL"
        },
        "author_signature": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Author Signature",
          "description": "作者签名"
        },
        "author_age": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Author Age",
          "description": "作者年龄(若平台提供)"
        },
        "duration": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Duration",
          "description": "时长(秒)"
        },
        "duration_text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Duration Text",
          "description": "时长文案,如 30秒"
        },
        "width": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Width",
          "description": "视频宽度"
        },
        "height": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Height",
          "description": "视频高度"
        },
        "view_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "View Count",
          "description": "播放量"
        },
        "like_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Like Count",
          "description": "点赞量"
        },
        "comment_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Comment Count",
          "description": "评论数"
        },
        "share_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Share Count",
          "description": "分享数"
        },
        "collect_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Collect Count",
          "description": "收藏数"
        },
        "download_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Download Count",
          "description": "下载数"
        },
        "release_time": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Release Time",
          "description": "发布时间 (格式: YYYY-MM-DD HH:MM:SS)"
        },
        "video_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Video Id",
          "description": "作品/视频 ID"
        },
        "source_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source Url",
          "description": "用户输入的分享链(规范化)"
        },
        "exec_time_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Exec Time Ms",
          "description": "解析耗时毫秒"
        },
        "message": {
          "type": "string",
          "title": "Message",
          "description": "响应消息",
          "default": "获取成功"
        }
      },
      "type": "object",
      "required": [
        "success"
      ],
      "title": "ResolveResponse",
      "description": "统一 L0 解析响应(纯直链,不转存)。\n\n- video_url / audio_url:原始平台 CDN(可播优先)\n- audio_track_url:视频音轨(可选,供 ASR)\n- 禁止返回本站 proxy/TOS 改写地址"
    },
    "ValidationError": {
      "properties": {
        "loc": {
          "items": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          },
          "type": "array",
          "title": "Location"
        },
        "msg": {
          "type": "string",
          "title": "Message"
        },
        "type": {
          "type": "string",
          "title": "Error Type"
        }
      },
      "type": "object",
      "required": [
        "loc",
        "msg",
        "type"
      ],
      "title": "ValidationError"
    }
  },
  "securitySchemes": {
    "HTTPBearer": {
      "type": "http",
      "scheme": "bearer"
    }
  }
}