Search and download copyright-free video clips from Pexels API. Clips are downloaded to a local directory for use by shorts-compose (--footage-dir mode).
Use this skill when:
shorts-compose --footage-dirPrerequisites: PEXELS_API_KEY must be set. Register free at https://www.pexels.com/api/
python3 {baseDir}/scripts/pexels_search.py \
--terms "sunset ocean,mountain landscape,forest path" \
--aspect 9:16 \
--output-dir ./video_assets/footage \
[--min-duration 5] \
[--max-clips 15]
| Option | Default | Description |
|---|
--terms | required | Comma-separated search keywords (one per scene) |
--aspect | 9:16 | 9:16 (portrait) | 16:9 (landscape) | 1:1 (square) |
--output-dir | required | Directory to save downloaded clips |
--min-duration | 5 | Minimum clip duration in seconds |
--max-clips | 15 | Maximum total clips to download |
✅ Downloaded 12 clips to ./video_assets/footage/
pexels-sunset-ocean-abc123.mp4 (8s)
pexels-mountain-def456.mp4 (12s)
...
Returns JSON to stdout:
{
"ok": true,
"clips": ["path1.mp4", "path2.mp4"],
"total": 12,
"output_dir": "./video_assets/footage"
}
Use with shorts-compose:
python3 {shorts_compose_baseDir}/scripts/compose.py \
--topic "主题" \
--footage-dir ./video_assets/footage \
--aspect 9:16 \
--output-dir ./output_videos
| Variable | Description |
|---|---|
PEXELS_API_KEY | Pexels API key (required) |
| Error | Action |
|---|---|
PEXELS_API_KEY not set | Check environment variables |
| No clips found for term | Try broader/simpler keywords (English works best) |
| Download fails | Retry once; skip if fails again |
| Rate limit (HTTP 429) | Wait 60s, then retry |