360 Secure SkillHub
360 安全技能中心

YouTube Video Downloader

该 Skill 指导代理调用第三方按次计费的 YouTube 下载 API,凭 API Key 下载指定分辨率(360p/480p/720p/1080p/best)的视频或仅提取音频,返回文件下载地址,失败不扣费;文档给出接口端点、错误码及 curl 与 Python 调用示例,并包含在 OpenClaw 中安装和获取密钥的步骤。

jxyyjm
jxyyjm
热度 48.85
最近更新 2026-05-11 17:37:08
分类:自动化依赖:第三方 API / 代码执行应用场景:工作流 / 文件转换

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add youtube-downloader-skill
Metadata
name
youtube-downloader
description
Download YouTube videos by URL in various resolutions using a pay-per-use API with credit-based authentication and no charge on failed downloads. Use when users request to download YouTube videos, extract audio, or specify resolution requirements (360p, 480p, 720p, 1080p, best quality). Triggers on phrases like "download YouTube video", "download from YouTube", "save YouTube video", "extract YouTube audio", "download video in [resolution]".

YouTube Video Downloader Skill

Download any YouTube video in various resolutions with a simple command. Supports 360p, 480p, 720p, 1080p, best quality, and audio-only extraction.

Quick Install

Just tell OpenClaw:

"Help me install this skill: https://clawhub.ai/jxyyjm/youtube-downloader-skill"

OpenClaw will ask you for an API Key. Follow these steps to get one:

That's it! You're ready to use the skill.

Usage

Once installed, just tell OpenClaw what you want. For example:

"Download this YouTube video: https://youtube.com/watch?v=dQw4w9WgXcQ"

"Download this video in 1080p: https://youtube.com/watch?v=xxxxx"

"Extract audio from this video: https://youtube.com/watch?v=xxxxx"

Supported resolutions: 360p, 480p, 720p (default), 1080p, best, audio-only.

Authentication

All API calls require an API Key in the Authorization header:

Authorization: Bearer sk-yt-xxxxx

Get your API Key at: https://skill.lordest.cn/?page=apikeys

Endpoints

POST /api/v1/download

Download a YouTube video.

Request:

{
  "youtube_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "resolution": "720"
}

Parameters:

  • youtube_url (required): YouTube video URL
  • resolution (optional): "360", "480", "720", "1080", "best", "audio". Default: "720"

Response (success):

{
  "success": true,
  "download_url": "https://oss-bucket.aliyuncs.com/skill/abc123/video.mp4",
  "video_title": "Video Title",
  "video_duration": 212,
  "file_size": 52428800,
  "resolution": "720",
  "processing_time": 45.2
}

GET /api/v1/balance

Check account status.

Response:

{
  "username": "user123"
}

GET /health

Health check (no authentication required).

Response:

{
  "status": "healthy",
  "service": "YouTube Video Downloader Service",
  "version": "1.0.0"
}

Error Codes

Code Meaning
200 Success
401 Invalid or missing API Key
400 Invalid request (bad URL, etc.)
500 Server error

Example (curl)

# Download a video
curl -X POST https://skill.lordest.cn/api/v1/download \
  -H "Authorization: Bearer sk-yt-xxxxx" \
  -H "Content-Type: application/json" \
  -d '{"youtube_url": "https://youtube.com/watch?v=dQw4w9WgXcQ", "resolution": "720"}'

Example (Python)

import requests

API_KEY = "sk-yt-xxxxx"
BASE_URL = "https://skill.lordest.cn"

# Download
resp = requests.post(
    f"{BASE_URL}/api/v1/download",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={"youtube_url": "https://youtube.com/watch?v=dQw4w9WgXcQ", "resolution": "720"}
)
data = resp.json()
if data["success"]:
    print(f"Download URL: {data['download_url']}")