Skip to content

网络音视频抓取接口 (/v1/files/fetch-url) ​

OneASR 内置基于 yt-dlp 与 ffmpeg 的流媒体抓取引擎,可直接将网页视频转换为标准化音频。


1. 提交抓取任务 ​

http
POST /v1/files/fetch-url
Authorization: Bearer sk-oneasr-...
Content-Type: application/json

{
  "url": "https://www.youtube.com/watch?v=example",
  "extract_audio": true,
  "format": "mp3"
}

响应体: ​

json
{
  "task_id": "fetch_9d8e7f6a5b4c3d2e",
  "status": "downloading",
  "url": "https://www.youtube.com/watch?v=example"
}

2. 轮询抓取进度 ​

http
GET /v1/files/fetch-url/fetch_9d8e7f6a5b4c3d2e
Authorization: Bearer sk-oneasr-...

响应体(抓取完成): ​

json
{
  "task_id": "fetch_9d8e7f6a5b4c3d2e",
  "status": "completed",
  "file_id": "file_4a2c9b1e0f3d5a7b",
  "title": "Engineering Keynote 2026",
  "duration": 3600.0
}