SuperAPI AI Directory

media-downloader

General & other

View repository

Updated 10-15 21:39

About this skill

🎬 Media Downloader / Smart Media Downloader

Just tell me what you want, and I'll help you find and download the relevant images and videos!

Just tell me what you want, and I'll find and download relevant images and videos for you!


🚀 What Can I Do? / What Can I Do?

You say... / You say... I will... / I will...
"Download some cute cat pictures" Search for and download 5 cat pictures
"Download sunset photos" Search and download sunset images
"Find a video of ocean waves, about 15 seconds" Download a 15-second ocean waves video
"Get me a 30-second cooking video" Download a trimmed cooking clip
"Download 1:30-2:00 of this YouTube video" Download and automatically trim the specified segment

✨ Features / Features

  • 🖼️ Image Download - Search high-definition images from professional stock libraries
  • 🎬 Video Footage - Get free commercial-use video clips
  • 📺 YouTube Download - Supports download and trimming
  • ✂️ Smart Trimming - Automatically crop to the length you need
  • 🌍 Bilingual Chinese-English - Supports Chinese and English commands

📋 Skill Execution Logic / Skill Execution Logic

🔑 On-Demand API Key Configuration / On-Demand API Key Configuration

Important: Do not require API Key configuration when the user installs! Handle it according to the following logic:

  1. When the user downloads a YouTube video: Execute directly, no API Key required
  2. When the user downloads images for the first time:
    • Check whether the PEXELS_API_KEY environment variable exists
    • If it does not exist, guide the user to configure it:
      检测到你还没有配置图库 API Key。下载图片需要一个免费的 API Key。
      
      请按以下步骤操作:
      1. 打开 https://www.pexels.com,点击 Join 注册(支持 Google/Apple 一键注册)
      2. 注册后访问 https://www.pexels.com/api/,点击 Your API Key
      3. 复制显示的密钥,粘贴给我
      
    • After the user provides the API Key, help the user save it to the system environment variables:
      echo 'export PEXELS_API_KEY="用户的密钥"' >> ~/.zshrc && source ~/.zshrc
      
    • Then continue completing the image download task

🎬 YouTube First / YouTube First

When the user says "download video" but does not specify a source, recommend YouTube first:

  • YouTube does not require an API Key
  • Richer content
  • Supports time-range trimming

💬 Examples / Examples

Download Images / Download Images

"帮我下载 5 张星空的图片"
"Download 10 coffee shop photos"
"找一些适合做壁纸的风景图"

Download Video Clips / Download Video Clips

"下载一段城市夜景的视频,30秒以内"
"Find me a 15-second ocean wave video"
"找一些适合做背景的自然风光视频"

YouTube Download & Trim / YouTube Download & Trim

"下载这个视频:https://youtube.com/watch?v=xxx"
"下载这个 YouTube 视频的第 2 分钟到第 3 分钟"
"只下载这个视频的音频"

📁 Download Location / Download Location

All files are saved by default in:

~/.claude/skills/media-downloader/downloads/

❓ FAQ / FAQ

Q: Why do image searches return no results?

A: Please confirm that the API Key has been configured. Run status command to check the configuration status.

Q: YouTube video download failed?

A: YouTube downloads do not require an API Key, but yt-dlp must be installed. Run pip install yt-dlp to install.

Q: The video trimming feature is not working?

A: ffmpeg must be installed. macOS users run brew install ffmpeg。

Q: Can these images/videos be used commercially?

A: Materials from Pexels, Pixabay, and Unsplash can all be used commercially for free without attribution (but attribution is a courtesy).


🛠️ CLI Reference / CLI Reference

For advanced users to use the command line directly:

# 检查配置状态
media_cli.py status

# 下载图片
media_cli.py image "关键词" -n 数量 -o 输出目录

# 下载视频素材
media_cli.py video "关键词" -d 最大时长 -n 数量

# 下载 YouTube 视频
media_cli.py youtube "URL" --start 开始秒数 --end 结束秒数

# 搜索媒体(不下载)
media_cli.py search "关键词" --type image/video/all

# 剪辑本地视频
media_cli.py trim 输入文件 --start 开始 --end 结束

📦 Supported Sources

Source Type Features
Pexels Images + Videos High quality, fast updates
Pixabay Images + Videos Large quantity, full variety
Unsplash Images Highly artistic, suitable for wallpapers
YouTube Videos Rich content, supports editing

🎬 Get started! Just tell me what images or videos you want!

🎬 Start using! Just tell me what images or videos you want!