ingest
Thin yt-dlp wrapper. Atomic: one URL in, one source.mp4 + ingest.json out.
Idempotent — if source.mp4 and ingest.json already exist for the same
URL hash, skips the download.
Inputs
url: video URL (required)id(optional): source id slug; defaults to a short sha1 of the URLworkdir(optional): root work directory; defaults to./work
Output
./work/<id>/source.mp4— the downloaded video, mp4 container./work/<id>/ingest.json— metadata, shaped as:
{
"id": "<id>",
"url": "<url>",
"title": "...",
"duration": 183.4,
"fps": 30.0,
"width": 1920,
"height": 1080,
"path": "work/<id>/source.mp4"
}
How
- Compute
idfrom URL (sha1(url)[:10]) if not given. mkdir -p work/<id>.yt-dlp -f 'bv*+ba/b' --merge-output-format mp4 --embed-metadata --print-to-file '%(title)s' work/<id>/.title.txt -o 'work/<id>/source.%(ext)s' <url>ffprobe -v error -print_format json -show_format -show_streams work/<id>/source.mp4→ extract duration, fps, width, height.- Title comes from yt-dlp's
.title.txt(merged-mp4 container tags are unreliable and often empty); falls back to the containertitletag. - Write
ingest.json.
Invoke
.claude/skills/ingest/ingest.sh <url> [id]
Status
Implemented. See ingest.sh.